Skip to content

Commit a82042f

Browse files
committed
feat(content_management): replace DropdownButtonFormField with SearchableSelectionInput
- Replace DropdownButtonFormField with SearchableSelectionInput for content status selection - Add import for SearchableSelectionInput widget - Update widget to use SearchableSelectionInput for better user experience
1 parent b023f37 commit a82042f

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

lib/content_management/view/edit_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/edit_topic/edit_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

@@ -190,18 +191,12 @@ class _EditTopicViewState extends State<_EditTopicView> {
190191
),
191192
),
192193
const SizedBox(height: AppSpacing.lg),
193-
DropdownButtonFormField<ContentStatus>(
194-
value: state.contentStatus,
195-
decoration: InputDecoration(
196-
labelText: l10n.status,
197-
border: const OutlineInputBorder(),
198-
),
199-
items: ContentStatus.values.map((status) {
200-
return DropdownMenuItem(
201-
value: status,
202-
child: Text(status.l10n(context)),
203-
);
204-
}).toList(),
194+
SearchableSelectionInput<ContentStatus>(
195+
label: l10n.status,
196+
selectedItem: state.contentStatus,
197+
staticItems: ContentStatus.values.toList(),
198+
itemBuilder: (context, status) => Text(status.l10n(context)),
199+
itemToString: (status) => status.l10n(context),
205200
onChanged: (value) {
206201
if (value == null) return;
207202
context.read<EditTopicBloc>().add(

0 commit comments

Comments
 (0)