diff --git a/glade_forms/lib/src/core/glade_input.dart b/glade_forms/lib/src/core/glade_input.dart index 51c9b1d..12748f5 100644 --- a/glade_forms/lib/src/core/glade_input.dart +++ b/glade_forms/lib/src/core/glade_input.dart @@ -143,7 +143,7 @@ class GladeInput extends ChangeNotifier { required this.validatorInstance, required bool isPure, required this.valueComparator, - required this.inputKey, + required String? inputKey, required this.translateError, required this.stringTovalueConverter, required InputDependenciesFactory? dependenciesFactory, @@ -157,6 +157,7 @@ class GladeInput extends ChangeNotifier { _value = value, _initialValue = initialValue, dependenciesFactory = dependenciesFactory ?? (() => []), + inputKey = inputKey ?? '__${T.runtimeType}__${Random().nextInt(100000000)}', valueTransform = valueTransform ?? _defaultTransform, _textEditingController = textEditingController ?? (createTextController @@ -201,7 +202,7 @@ class GladeInput extends ChangeNotifier { initialValue: initialValue, translateError: translateError, valueComparator: valueComparator, - inputKey: inputKey ?? '__${T.runtimeType}__${Random().nextInt(100)}', + inputKey: inputKey, stringTovalueConverter: valueConverter, dependenciesFactory: dependencies, onChange: onChange, @@ -219,7 +220,7 @@ class GladeInput extends ChangeNotifier { /// In case of need of any validation use [GladeInput.create] directly. factory GladeInput.optional({ required T value, - required String inputKey, + String? inputKey, T? initialValue, bool pure = true, ErrorTranslator? translateError, @@ -252,7 +253,7 @@ class GladeInput extends ChangeNotifier { /// In case of need of any aditional validation use [GladeInput.create] directly. factory GladeInput.required({ required T value, - required String inputKey, + String? inputKey, T? initialValue, bool pure = true, ErrorTranslator? translateError, @@ -286,7 +287,7 @@ class GladeInput extends ChangeNotifier { static GladeInput intInput({ required int value, - required String inputKey, + String? inputKey, ValidatorFactory? validator, int? initialValue, bool pure = true, @@ -316,7 +317,7 @@ class GladeInput extends ChangeNotifier { static GladeInput boolInput({ required bool value, - required String inputKey, + String? inputKey, ValidatorFactory? validator, bool? initialValue, bool pure = true, @@ -345,7 +346,7 @@ class GladeInput extends ChangeNotifier { ); static GladeInput stringInput({ - required String inputKey, + String? inputKey, String? value, StringValidatorFactory? validator, String? initialValue,