Skip to content

Commit c7fc830

Browse files
committed
feat(content_management): add loading indicator and disable dropdowns when fetching items
- Add helper text and disable onChanged callback for language dropdown when loading more languages - Add helper text and disable onChanged callback for country dropdown when loading more countries - Improve user experience by indicating when the full list is being loaded
1 parent 5c47314 commit c7fc830

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

lib/content_management/view/edit_source_page.dart

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ class _EditSourceViewState extends State<_EditSourceView> {
196196
decoration: InputDecoration(
197197
labelText: l10n.language,
198198
border: const OutlineInputBorder(),
199+
helperText: state.languagesIsLoadingMore
200+
? l10n.loadingFullList
201+
: null,
199202
),
200203
items: [
201204
DropdownMenuItem(value: null, child: Text(l10n.none)),
@@ -206,9 +209,11 @@ class _EditSourceViewState extends State<_EditSourceView> {
206209
),
207210
),
208211
],
209-
onChanged: (value) => context
210-
.read<EditSourceBloc>()
211-
.add(EditSourceLanguageChanged(value)),
212+
onChanged: state.languagesIsLoadingMore
213+
? null
214+
: (value) => context
215+
.read<EditSourceBloc>()
216+
.add(EditSourceLanguageChanged(value)),
212217
),
213218
const SizedBox(height: AppSpacing.lg),
214219
DropdownButtonFormField<SourceType?>(
@@ -236,6 +241,9 @@ class _EditSourceViewState extends State<_EditSourceView> {
236241
decoration: InputDecoration(
237242
labelText: l10n.headquarters,
238243
border: const OutlineInputBorder(),
244+
helperText: state.countriesIsLoadingMore
245+
? l10n.loadingFullList
246+
: null,
239247
),
240248
items: [
241249
DropdownMenuItem(value: null, child: Text(l10n.none)),
@@ -262,9 +270,11 @@ class _EditSourceViewState extends State<_EditSourceView> {
262270
),
263271
),
264272
],
265-
onChanged: (value) => context
266-
.read<EditSourceBloc>()
267-
.add(EditSourceHeadquartersChanged(value)),
273+
onChanged: state.countriesIsLoadingMore
274+
? null
275+
: (value) => context
276+
.read<EditSourceBloc>()
277+
.add(EditSourceHeadquartersChanged(value)),
268278
),
269279
const SizedBox(height: AppSpacing.lg),
270280
DropdownButtonFormField<ContentStatus>(

0 commit comments

Comments
 (0)