Reflect reserved screen areas on dashboard

This commit is contained in:
Miroslav Mazel
2023-08-21 15:51:59 +02:00
parent 020d6eea07
commit 245e51b4e3

View File

@ -31,15 +31,13 @@ class DashboardScreen extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final projectsBloc = BlocProvider.of<ProjectsBloc>(context); final projectsBloc = BlocProvider.of<ProjectsBloc>(context);
final settingsBloc = BlocProvider.of<SettingsBloc>(context); final settingsBloc = BlocProvider.of<SettingsBloc>(context);
final screenBorders = MediaQuery.of(context).padding;
return BlocProvider<DashboardBloc>( return BlocProvider<DashboardBloc>(
create: (_) => DashboardBloc(projectsBloc, settingsBloc), create: (_) => DashboardBloc(projectsBloc, settingsBloc),
child: Scaffold( child: Scaffold(
appBar: const TopBar(), appBar: const TopBar(),
body: body: Column(
Scrollable(
viewportBuilder: (BuildContext context, position) =>
Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -53,11 +51,11 @@ class DashboardScreen extends StatelessWidget {
elevation: 8.0, elevation: 8.0,
color: Theme.of(context).bottomSheetTheme.backgroundColor, color: Theme.of(context).bottomSheetTheme.backgroundColor,
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: EdgeInsets.fromLTRB(8 + screenBorders.left, 8,
child: Row( 8 + screenBorders.right, 8 + screenBorders.bottom),
child: const Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
//crossAxisAlignment: CrossAxisAlignment.end, children: <Widget>[
children: const <Widget>[
ProjectSelectField(), ProjectSelectField(),
Expanded( Expanded(
flex: 1, flex: 1,
@ -76,7 +74,6 @@ class DashboardScreen extends StatelessWidget {
) )
], ],
), ),
),
floatingActionButton: const StartTimerButton(), floatingActionButton: const StartTimerButton(),
)); ));
} }