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.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;

View File

@ -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<bool> darkModeReducer = combineReducers([
}),
]);
Reducer<bool> showKanbanReducer = combineReducers([
TypedReducer<bool, UpdateUserPreferences>((showKanban, action) {
return action.showKanban ?? showKanban;
}),
]);
Reducer<bool> showFilterSidebarReducer = combineReducers([
TypedReducer<bool, UpdateUserPreferences>((value, action) {
return action.showFilterSidebar ?? value;

View File

@ -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),