TextSetting<T> constructor
TextSetting<T> ({
- Key? key,
- required dynamic settingsKey,
- required dynamic title,
- dynamic defaultValue,
- dynamic subtitle,
- Widget? leading,
- TextInputType? keyboardType,
- bool enabled = true,
- bool? obscureText,
- String? obscuringCharacter,
- List<
TextInputFormatter> ? inputFormatters, - FormFieldValidator<
T> ? validator, - String okText = 'OK',
- String cancelText = 'Cancel',
- bool? autocorrect,
- SmartDashesType? smartDashesType,
- SmartQuotesType? smartQuotesType,
- bool? enableSuggestions,
- int? maxLines,
- int? minLines,
- bool? expands,
- int? maxLength,
- double? cursorHeight,
- Color? cursorColor,
- Brightness? keyboardAppearance,
- EdgeInsets? scrollPadding,
- bool? enableInteractiveSelection,
- TextSelectionControls? selectionControls,
- SettingChangedCallback<
T> ? onChanged,
Implementation
TextSetting({
Key? key,
required settingsKey,
required title,
defaultValue,
subtitle,
Widget? leading,
this.keyboardType,
bool enabled = true,
this.obscureText,
this.obscuringCharacter,
this.inputFormatters,
this.validator,
this.okText = 'OK',
this.cancelText = 'Cancel',
this.autocorrect,
this.smartDashesType,
this.smartQuotesType,
this.enableSuggestions,
this.maxLines,
this.minLines,
this.expands,
this.maxLength,
this.cursorHeight,
this.cursorColor,
this.keyboardAppearance,
this.scrollPadding,
this.enableInteractiveSelection,
this.selectionControls,
SettingChangedCallback<T>? onChanged,
}) : super(
key: key,
settingsKey: settingsKey,
title: title,
defaultValue: defaultValue,
subtitle: subtitle,
enabled: enabled,
leading: leading,
onChanged: onChanged
)
{
if (T != String && T != int && T != double) {
throw Exception('TextSetting only supports String, int and double as generic types');
}
if (subtitle == null) {
subtitle = defaultValue;
}
}