Skip to content

Commit 05a38ab

Browse files
committed
refactor(content_management): replace DropdownButtonFormField with SearchableSelectionInput
- Replace DropdownButtonFormField with SearchableSelectionInput for content status selection - Improve accessibility and usability of content status input field - Update imports to include SearchableSelectionInput widget
1 parent 888e734 commit 05a38ab

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

lib/content_management/view/create_topic_page.dart

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'package:flutter_news_app_web_dashboard_full_source_code/content_manageme
66
import 'package:flutter_news_app_web_dashboard_full_source_code/content_management/bloc/create_topic/create_topic_bloc.dart';
77
import 'package:flutter_news_app_web_dashboard_full_source_code/l10n/l10n.dart';
88
import 'package:flutter_news_app_web_dashboard_full_source_code/shared/shared.dart';
9+
import 'package:flutter_news_app_web_dashboard_full_source_code/shared/widgets/searchable_selection_input.dart';
910
import 'package:go_router/go_router.dart';
1011
import 'package:ui_kit/ui_kit.dart';
1112

@@ -141,18 +142,12 @@ class _CreateTopicViewState extends State<_CreateTopicView> {
141142
),
142143
),
143144
const SizedBox(height: AppSpacing.lg),
144-
DropdownButtonFormField<ContentStatus>(
145-
value: state.contentStatus,
146-
decoration: InputDecoration(
147-
labelText: l10n.status,
148-
border: const OutlineInputBorder(),
149-
),
150-
items: ContentStatus.values.map((status) {
151-
return DropdownMenuItem(
152-
value: status,
153-
child: Text(status.l10n(context)),
154-
);
155-
}).toList(),
145+
SearchableSelectionInput<ContentStatus>(
146+
label: l10n.status,
147+
selectedItem: state.contentStatus,
148+
staticItems: ContentStatus.values.toList(),
149+
itemBuilder: (context, status) => Text(status.l10n(context)),
150+
itemToString: (status) => status.l10n(context),
156151
onChanged: (value) {
157152
if (value == null) return;
158153
context.read<CreateTopicBloc>().add(

0 commit comments

Comments
 (0)