Skip to content

Commit 52be023

Browse files
committed
feat: adds the DropdownButtonFormField for ContentStatus to the EditHeadlinePage UI. This allows administrators to view and modify the status of an existing headline.
1 parent 73e116f commit 52be023

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

lib/content_management/view/edit_headline_page.dart

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,31 @@ class _EditHeadlineViewState extends State<_EditHeadlineView> {
273273
.read<EditHeadlineBloc>()
274274
.add(EditHeadlineCategoryChanged(value)),
275275
),
276+
const SizedBox(height: AppSpacing.lg),
277+
DropdownButtonFormField<ContentStatus>(
278+
value: state.contentStatus,
279+
decoration: InputDecoration(
280+
labelText: l10n.status,
281+
border: const OutlineInputBorder(),
282+
),
283+
items: ContentStatus.values.map((status) {
284+
return DropdownMenuItem(
285+
value: status,
286+
child: Text(
287+
status.name.replaceFirst(
288+
status.name[0],
289+
status.name[0].toUpperCase(),
290+
),
291+
),
292+
);
293+
}).toList(),
294+
onChanged: (value) {
295+
if (value == null) return;
296+
context
297+
.read<EditHeadlineBloc>()
298+
.add(EditHeadlineStatusChanged(value));
299+
},
300+
),
276301
],
277302
),
278303
),

0 commit comments

Comments
 (0)