feat : unit_text_field
This commit is contained in:
@@ -8,7 +8,7 @@ class UnitTextField extends StatefulWidget {
|
||||
super.key,
|
||||
required this.hint,
|
||||
required this.unit,
|
||||
required this.onChanged,
|
||||
this.onChanged,
|
||||
this.initialValue,
|
||||
this.controller,
|
||||
this.keyboardType,
|
||||
@@ -20,6 +20,7 @@ class UnitTextField extends StatefulWidget {
|
||||
this.textStyle,
|
||||
this.textColor,
|
||||
this.inputFormatters,
|
||||
this.validator
|
||||
});
|
||||
|
||||
final String hint;
|
||||
@@ -32,6 +33,7 @@ class UnitTextField extends StatefulWidget {
|
||||
final TextInputType? keyboardType;
|
||||
final TextInputAction? textInputAction;
|
||||
final List<TextInputFormatter>? inputFormatters;
|
||||
final FormFieldValidator<String>? validator;
|
||||
final bool? enabled;
|
||||
final bool? readOnly;
|
||||
final int? maxLines;
|
||||
@@ -81,7 +83,7 @@ class _UnitTextFieldState extends State<UnitTextField> {
|
||||
const SizedBox(width: 8),
|
||||
|
||||
Expanded(
|
||||
child: TextField(
|
||||
child: TextFormField(
|
||||
controller: tmpController,
|
||||
keyboardType: TextInputType.number,
|
||||
textInputAction: widget.textInputAction,
|
||||
@@ -92,6 +94,7 @@ class _UnitTextFieldState extends State<UnitTextField> {
|
||||
textAlign: TextAlign.center,
|
||||
textDirection: TextDirection.ltr,
|
||||
inputFormatters: widget.inputFormatters,
|
||||
validator: widget.validator,
|
||||
style: AppFonts.yekan18.copyWith(color: AppColor.darkGreyNormalActive),
|
||||
decoration: const InputDecoration(
|
||||
isDense: true,
|
||||
|
||||
Reference in New Issue
Block a user