Improve navigation

This commit is contained in:
Hillel Coren 2020-11-11 21:01:59 +02:00
parent e9b130434b
commit 7b99c77480
2 changed files with 18 additions and 7 deletions

View File

@ -205,11 +205,12 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
prefState.moduleLayout == ModuleLayout.table) || prefState.moduleLayout == ModuleLayout.table) ||
uiState.isEditing || uiState.isEditing ||
entityType.isSetting || entityType.isSetting ||
entityList.isEmpty) { (entityList.isEmpty && (entityUIState.selectedId ?? '').isEmpty)) {
return false; return false;
} }
if ((entityUIState.selectedId ?? '').isEmpty) { if ((entityUIState.selectedId ?? '').isEmpty ||
!entityList.contains(entityUIState.selectedId)) {
return true; return true;
} else if (unfilteredHistoryList.isNotEmpty && } else if (unfilteredHistoryList.isNotEmpty &&
uiState.isViewing && uiState.isViewing &&
@ -424,13 +425,17 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
// STARTER: state getters - do not remove comment // STARTER: state getters - do not remove comment
TaskStatusState get taskStatusState => userCompanyState.taskStatusState; TaskStatusState get taskStatusState => userCompanyState.taskStatusState;
ListUIState get taskStatusListState => uiState.taskStatusUIState.listUIState; ListUIState get taskStatusListState => uiState.taskStatusUIState.listUIState;
TaskStatusUIState get taskStatusUIState => uiState.taskStatusUIState; TaskStatusUIState get taskStatusUIState => uiState.taskStatusUIState;
ExpenseCategoryState get expenseCategoryState => ExpenseCategoryState get expenseCategoryState =>
userCompanyState.expenseCategoryState; userCompanyState.expenseCategoryState;
ListUIState get expenseCategoryListState => ListUIState get expenseCategoryListState =>
uiState.expenseCategoryUIState.listUIState; uiState.expenseCategoryUIState.listUIState;
ExpenseCategoryUIState get expenseCategoryUIState => ExpenseCategoryUIState get expenseCategoryUIState =>
uiState.expenseCategoryUIState; uiState.expenseCategoryUIState;

View File

@ -4904,12 +4904,18 @@ mixin LocalizationsProvider on LocaleCodeAware {
return key; return key;
} }
if (!_localizedValues[localeCode].containsKey(lookupKey)) { final value = _localizedValues[localeCode][lookupKey] ??
print('ERROR: localization key not found - |$key|');
}
return _localizedValues[localeCode][lookupKey] ??
_localizedValues[localeCode][lookupKey.replaceFirst('_id', '')] ?? _localizedValues[localeCode][lookupKey.replaceFirst('_id', '')] ??
key; key;
if (value.isEmpty) {
print('ERROR: localization key not found - $key');
final englishValue = _localizedValues['en'][lookupKey];
return englishValue.isEmpty ? key : englishValue;
}
return value;
} }
} }