Add separate loading messages
This commit is contained in:
parent
b706ab545f
commit
d2e8df63d2
|
|
@ -162,7 +162,15 @@ class MenuDrawer extends StatelessWidget {
|
|||
onSelected: (String companyId) {
|
||||
if (companyId == 'logout') {
|
||||
viewModel.onLogoutTap(context);
|
||||
} else if (!state.isLoaded || state.isLoading || state.isSaving) {
|
||||
} else if (state.isLoading) {
|
||||
showMessageDialog(
|
||||
context: context, message: localization.waitForLoading);
|
||||
return;
|
||||
} else if (state.isSaving) {
|
||||
showMessageDialog(
|
||||
context: context, message: localization.waitForSaving);
|
||||
return;
|
||||
} else if (!state.isLoaded) {
|
||||
showMessageDialog(
|
||||
context: context, message: localization.waitForData);
|
||||
return;
|
||||
|
|
@ -221,9 +229,15 @@ class MenuDrawer extends StatelessWidget {
|
|||
onChanged: (dynamic value) {
|
||||
if (value == 'logout' && !state.isLoading && !state.isSaving) {
|
||||
viewModel.onLogoutTap(context);
|
||||
} else if (!state.isLoaded ||
|
||||
state.isLoading ||
|
||||
state.isSaving) {
|
||||
} else if (state.isLoading) {
|
||||
showMessageDialog(
|
||||
context: context, message: localization.waitForLoading);
|
||||
return;
|
||||
} else if (state.isSaving) {
|
||||
showMessageDialog(
|
||||
context: context, message: localization.waitForSaving);
|
||||
return;
|
||||
} else if (!state.isLoaded) {
|
||||
showMessageDialog(
|
||||
context: context, message: localization.waitForData);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
static final Map<String, Map<String, String>> _localizedValues = {
|
||||
'en': {
|
||||
// STARTER: lang key - do not remove comment
|
||||
'wait_for_loading': 'Data loading - please wait for it to complete',
|
||||
'wait_for_saving': 'Data saving - please wait for it to complete',
|
||||
'html_preview_warning':
|
||||
'Note: changes made here are only previewed, they must be applied in the tabs above to be saved',
|
||||
'remaining': 'Remaining',
|
||||
|
|
@ -70925,6 +70927,14 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
|||
_localizedValues[localeCode]['html_preview_warning'] ??
|
||||
_localizedValues['en']['html_preview_warning'];
|
||||
|
||||
String get waitForLoading =>
|
||||
_localizedValues[localeCode]['wait_for_loading'] ??
|
||||
_localizedValues['en']['wait_for_loading'];
|
||||
|
||||
String get waitForSaving =>
|
||||
_localizedValues[localeCode]['wait_for_saving'] ??
|
||||
_localizedValues['en']['wait_for_saving'];
|
||||
|
||||
// STARTER: lang field - do not remove comment
|
||||
|
||||
String lookup(String key) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue