This commit is contained in:
Hillel Coren 2021-04-15 12:21:11 +03:00
parent c887f9cbe7
commit 8d0daa658a
3 changed files with 14 additions and 3 deletions

View File

@ -123,6 +123,7 @@ class UpdateUserPreferences implements PersistPrefs {
this.accentColor, this.accentColor,
this.menuMode, this.menuMode,
this.historyMode, this.historyMode,
this.showKanban,
this.showFilterSidebar, this.showFilterSidebar,
this.alwaysShowFilterSidebar, this.alwaysShowFilterSidebar,
this.rowsPerPage, this.rowsPerPage,
@ -140,6 +141,7 @@ class UpdateUserPreferences implements PersistPrefs {
final bool isPreviewVisible; final bool isPreviewVisible;
final bool showFilterSidebar; final bool showFilterSidebar;
final bool alwaysShowFilterSidebar; final bool alwaysShowFilterSidebar;
final bool showKanban;
final String accentColor; final String accentColor;
final int rowsPerPage; final int rowsPerPage;
final String colorTheme; final String colorTheme;

View File

@ -52,6 +52,7 @@ PrefState prefReducer(
..isMenuVisible = menuVisibleReducer(state.isMenuVisible, action) ..isMenuVisible = menuVisibleReducer(state.isMenuVisible, action)
..isHistoryVisible = historyVisibleReducer(state.isHistoryVisible, action) ..isHistoryVisible = historyVisibleReducer(state.isHistoryVisible, action)
..enableDarkMode = darkModeReducer(state.enableDarkMode, action) ..enableDarkMode = darkModeReducer(state.enableDarkMode, action)
..showKanban = showKanbanReducer(state.enableDarkMode, action)
..showFilterSidebar = ..showFilterSidebar =
showFilterSidebarReducer(state.showFilterSidebar, action) showFilterSidebarReducer(state.showFilterSidebar, action)
..longPressSelectionIsDefault = ..longPressSelectionIsDefault =
@ -162,6 +163,12 @@ Reducer<bool> darkModeReducer = combineReducers([
}), }),
]); ]);
Reducer<bool> showKanbanReducer = combineReducers([
TypedReducer<bool, UpdateUserPreferences>((showKanban, action) {
return action.showKanban ?? showKanban;
}),
]);
Reducer<bool> showFilterSidebarReducer = combineReducers([ Reducer<bool> showFilterSidebarReducer = combineReducers([
TypedReducer<bool, UpdateUserPreferences>((value, action) { TypedReducer<bool, UpdateUserPreferences>((value, action) {
return action.showFilterSidebar ?? value; return action.showFilterSidebar ?? value;

View File

@ -48,12 +48,14 @@ class TaskScreen extends StatelessWidget {
IconButton( IconButton(
icon: Icon(MdiIcons.trello), icon: Icon(MdiIcons.trello),
onPressed: () { onPressed: () {
// store.dispatch(
UpdateUserPreferences(showKanban: !state.prefState.showKanban),
);
}, },
) )
], ],
body: TaskListBuilder(), body:
//body: KanbanViewBuilder(), state.prefState.showKanban ? KanbanViewBuilder() : TaskListBuilder(),
bottomNavigationBar: AppBottomBar( bottomNavigationBar: AppBottomBar(
entityType: EntityType.task, entityType: EntityType.task,
tableColumns: TaskPresenter.getAllTableFields(userCompany), tableColumns: TaskPresenter.getAllTableFields(userCompany),