Adjust create button

This commit is contained in:
Hillel Coren 2022-08-28 21:35:24 +03:00
parent c6264789c4
commit 3b909c1fa5
3 changed files with 16 additions and 18 deletions

View File

@ -100,10 +100,10 @@ class ListScaffold extends StatelessWidget {
double leadingWidth = 0; double leadingWidth = 0;
if (entityType == EntityType.settings) { if (entityType == EntityType.settings) {
leadingWidth = isDesktop(context) ? 0 : 40; leadingWidth = isDesktop(context) ? 0 : kMinInteractiveDimension;
} else { } else {
leadingWidth = (isDesktop(context) ? 90 : 10) + leadingWidth = (isDesktop(context) ? 100 : 10) +
kMinInteractiveDimension * (kMinInteractiveDimension - 4) *
(appBarLeadingActions.length + (appBarLeadingActions.length +
(onCheckboxPressed == null || isMobile(context) ? 1 : 2)); (onCheckboxPressed == null || isMobile(context) ? 1 : 2));
} }
@ -120,6 +120,7 @@ class ListScaffold extends StatelessWidget {
? null ? null
: () => onCheckboxPressed(), : () => onCheckboxPressed(),
), ),
if (appBarLeadingActions.isNotEmpty) SizedBox(width: 4),
...appBarLeadingActions, ...appBarLeadingActions,
], ],
); );

View File

@ -319,7 +319,7 @@ class ReportsScreen extends StatelessWidget {
appBar: AppBar( appBar: AppBar(
centerTitle: false, centerTitle: false,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
leadingWidth: isMobile(context) ? 40 : 0, leadingWidth: isMobile(context) ? kMinInteractiveDimension : 0,
leading: leading, leading: leading,
title: Row( title: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,

View File

@ -86,20 +86,17 @@ class TaskScreen extends StatelessWidget {
} }
}, },
appBarLeadingActions: [ appBarLeadingActions: [
Expanded( IconButton(
child: IconButton( icon: Icon(
icon: Icon( state.prefState.showKanban ? Icons.view_list : MdiIcons.trello),
state.prefState.showKanban ? Icons.view_list : MdiIcons.trello), onPressed: () {
onPressed: () { if (isDesktop(context) && !state.prefState.showKanban) {
if (isDesktop(context) && !state.prefState.showKanban) { store.dispatch(ViewTask(taskId: ''));
store.dispatch(ViewTask(taskId: '')); }
} store.dispatch(
UpdateUserPreferences(showKanban: !state.prefState.showKanban),
store.dispatch( );
UpdateUserPreferences(showKanban: !state.prefState.showKanban), },
);
},
),
) )
], ],
body: body: