diff --git a/lib/redux/app/app_actions.dart b/lib/redux/app/app_actions.dart index 27e543fa9..ad801b514 100644 --- a/lib/redux/app/app_actions.dart +++ b/lib/redux/app/app_actions.dart @@ -123,6 +123,7 @@ class UpdateUserPreferences implements PersistPrefs { this.accentColor, this.menuMode, this.historyMode, + this.showKanban, this.showFilterSidebar, this.alwaysShowFilterSidebar, this.rowsPerPage, @@ -140,6 +141,7 @@ class UpdateUserPreferences implements PersistPrefs { final bool isPreviewVisible; final bool showFilterSidebar; final bool alwaysShowFilterSidebar; + final bool showKanban; final String accentColor; final int rowsPerPage; final String colorTheme; diff --git a/lib/redux/ui/pref_reducer.dart b/lib/redux/ui/pref_reducer.dart index a24417075..eb8af619c 100644 --- a/lib/redux/ui/pref_reducer.dart +++ b/lib/redux/ui/pref_reducer.dart @@ -52,6 +52,7 @@ PrefState prefReducer( ..isMenuVisible = menuVisibleReducer(state.isMenuVisible, action) ..isHistoryVisible = historyVisibleReducer(state.isHistoryVisible, action) ..enableDarkMode = darkModeReducer(state.enableDarkMode, action) + ..showKanban = showKanbanReducer(state.enableDarkMode, action) ..showFilterSidebar = showFilterSidebarReducer(state.showFilterSidebar, action) ..longPressSelectionIsDefault = @@ -162,6 +163,12 @@ Reducer darkModeReducer = combineReducers([ }), ]); +Reducer showKanbanReducer = combineReducers([ + TypedReducer((showKanban, action) { + return action.showKanban ?? showKanban; + }), +]); + Reducer showFilterSidebarReducer = combineReducers([ TypedReducer((value, action) { return action.showFilterSidebar ?? value; diff --git a/lib/ui/task/task_screen.dart b/lib/ui/task/task_screen.dart index 7612392e4..b353e40c7 100644 --- a/lib/ui/task/task_screen.dart +++ b/lib/ui/task/task_screen.dart @@ -48,12 +48,14 @@ class TaskScreen extends StatelessWidget { IconButton( icon: Icon(MdiIcons.trello), onPressed: () { - // + store.dispatch( + UpdateUserPreferences(showKanban: !state.prefState.showKanban), + ); }, ) ], - body: TaskListBuilder(), - //body: KanbanViewBuilder(), + body: + state.prefState.showKanban ? KanbanViewBuilder() : TaskListBuilder(), bottomNavigationBar: AppBottomBar( entityType: EntityType.task, tableColumns: TaskPresenter.getAllTableFields(userCompany),