percent static method
Implementation
static TextDynamicInput<double> percent({
required String hintText,
double? initialValue,
ValueChanged<double?>? onChanged,
bool enabled = true,
String? errorText,
}) {
return TextDynamicInput<double>(
hintText: hintText,
initialValue: _toPercent(initialValue),
onChanged: (value) {
if (onChanged == null) return;
onChanged(_fromPercent(value));
},
enabled: enabled,
formatters: [DecimalFormatter()],
keyboardType: const TextInputType.numberWithOptions(decimal: true),
decoration: InputDecoration(
suffixIcon: const Icon(Icons.percent),
suffixIconColor: SepteoColors.blue.shade900,
),
errorText: errorText,
);
}