Skip to content

Commit 6e89b70

Browse files
committed
feat(AppConfigIntField): add enabled parameter to TextFormField
- Add 'enabled' parameter to AppConfigIntField widget - Allow control over the input field's editability - Update TextFormField to use the new 'enabled' parameter
1 parent fb622a6 commit 6e89b70

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/app_configuration/widgets/app_config_form_fields.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class AppConfigIntField extends StatelessWidget {
1313
required this.value,
1414
required this.onChanged,
1515
this.controller,
16+
this.enabled = true,
1617
super.key,
1718
});
1819

@@ -31,6 +32,9 @@ class AppConfigIntField extends StatelessWidget {
3132
/// Optional text editing controller for more control.
3233
final TextEditingController? controller;
3334

35+
/// Whether the input field is enabled. Defaults to true.
36+
final bool enabled;
37+
3438
@override
3539
Widget build(BuildContext context) {
3640
final theme = Theme.of(context);
@@ -50,6 +54,7 @@ class AppConfigIntField extends StatelessWidget {
5054
),
5155
const SizedBox(height: AppSpacing.xs),
5256
TextFormField(
57+
enabled: enabled,
5358
controller: controller,
5459
initialValue: controller == null ? value.toString() : null,
5560
keyboardType: TextInputType.number,

0 commit comments

Comments
 (0)