Add preview stack
This commit is contained in:
parent
03cbeac3de
commit
9cd6cd6eca
|
|
@ -171,6 +171,8 @@ class PreviewEntity {
|
||||||
|
|
||||||
class ClearPreviewStack {}
|
class ClearPreviewStack {}
|
||||||
|
|
||||||
|
class PopPreviewStack {}
|
||||||
|
|
||||||
class ClearData {}
|
class ClearData {}
|
||||||
|
|
||||||
class RefreshDataFailure implements StopLoading {
|
class RefreshDataFailure implements StopLoading {
|
||||||
|
|
|
||||||
|
|
@ -298,4 +298,8 @@ Reducer<BuiltList<EntityType>> previewStackReducer = combineReducers([
|
||||||
(previewStack, action) {
|
(previewStack, action) {
|
||||||
return BuiltList(<EntityType>[]);
|
return BuiltList(<EntityType>[]);
|
||||||
}),
|
}),
|
||||||
|
TypedReducer<BuiltList<EntityType>, PopPreviewStack>((previewStack, action) {
|
||||||
|
return BuiltList(
|
||||||
|
<EntityType>[...previewStack.sublist(0, previewStack.length - 1)]);
|
||||||
|
}),
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ class ViewScaffold extends StatelessWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget leading;
|
Widget leading;
|
||||||
if (!isMobile(context)) {
|
if (isDesktop(context)) {
|
||||||
if ((isFilter ?? false) &&
|
if ((isFilter ?? false) &&
|
||||||
entity.entityType == state.uiState.filterEntityType) {
|
entity.entityType == state.uiState.filterEntityType) {
|
||||||
leading = IconButton(
|
leading = IconButton(
|
||||||
|
|
@ -61,6 +61,10 @@ class ViewScaffold extends StatelessWidget {
|
||||||
store.dispatch(UpdateUserPreferences(showFilterSidebar: false));
|
store.dispatch(UpdateUserPreferences(showFilterSidebar: false));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
} else if (state.uiState.previewStack.isNotEmpty) {
|
||||||
|
leading = IconButton(
|
||||||
|
icon: Icon(Icons.arrow_back),
|
||||||
|
onPressed: () => store.dispatch(PopPreviewStack()));
|
||||||
} else if (isSettings) {
|
} else if (isSettings) {
|
||||||
leading = IconButton(
|
leading = IconButton(
|
||||||
icon: Icon(Icons.arrow_back),
|
icon: Icon(Icons.arrow_back),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue