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