|
|
|
@ -4,6 +4,7 @@ import 'package:mohem_flutter_app/classes/colors.dart';
|
|
|
|
class DynamicTextFieldWidget extends StatelessWidget {
|
|
|
|
class DynamicTextFieldWidget extends StatelessWidget {
|
|
|
|
final String labelText;
|
|
|
|
final String labelText;
|
|
|
|
final String hintText;
|
|
|
|
final String hintText;
|
|
|
|
|
|
|
|
|
|
|
|
// final TextEditingController controller;
|
|
|
|
// final TextEditingController controller;
|
|
|
|
final VoidCallback? onTap;
|
|
|
|
final VoidCallback? onTap;
|
|
|
|
final IconData? suffixIconData;
|
|
|
|
final IconData? suffixIconData;
|
|
|
|
@ -13,6 +14,7 @@ class DynamicTextFieldWidget extends StatelessWidget {
|
|
|
|
final bool isPopup;
|
|
|
|
final bool isPopup;
|
|
|
|
final int? lines;
|
|
|
|
final int? lines;
|
|
|
|
final bool isInputTypeNum;
|
|
|
|
final bool isInputTypeNum;
|
|
|
|
|
|
|
|
final bool isInputTypeNumSigned;
|
|
|
|
final bool isObscureText;
|
|
|
|
final bool isObscureText;
|
|
|
|
final bool isBackgroundEnable;
|
|
|
|
final bool isBackgroundEnable;
|
|
|
|
final void Function(String)? onChange;
|
|
|
|
final void Function(String)? onChange;
|
|
|
|
@ -28,6 +30,7 @@ class DynamicTextFieldWidget extends StatelessWidget {
|
|
|
|
this.inputAction,
|
|
|
|
this.inputAction,
|
|
|
|
this.onChange,
|
|
|
|
this.onChange,
|
|
|
|
this.isInputTypeNum = false,
|
|
|
|
this.isInputTypeNum = false,
|
|
|
|
|
|
|
|
this.isInputTypeNumSigned = true,
|
|
|
|
this.isBackgroundEnable = false});
|
|
|
|
this.isBackgroundEnable = false});
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
@ -63,8 +66,13 @@ class DynamicTextFieldWidget extends StatelessWidget {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
TextField(
|
|
|
|
TextField(
|
|
|
|
enabled: isEnable,
|
|
|
|
enabled: isEnable,
|
|
|
|
scrollPadding: EdgeInsets.zero, readOnly: isReadOnly,
|
|
|
|
scrollPadding: EdgeInsets.zero,
|
|
|
|
keyboardType: isInputTypeNum ? const TextInputType.numberWithOptions(signed: true) : TextInputType.text,
|
|
|
|
readOnly: isReadOnly,
|
|
|
|
|
|
|
|
keyboardType: (isInputTypeNum)
|
|
|
|
|
|
|
|
? isInputTypeNumSigned
|
|
|
|
|
|
|
|
? const TextInputType.numberWithOptions(signed: true)
|
|
|
|
|
|
|
|
: TextInputType.number
|
|
|
|
|
|
|
|
: TextInputType.text,
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
//controller: controller,
|
|
|
|
//controller: controller,
|
|
|
|
maxLines: lines,
|
|
|
|
maxLines: lines,
|
|
|
|
|