Mobile fixes

This commit is contained in:
Hillel Coren 2020-07-19 18:07:49 +03:00
parent 0c289135be
commit 417a2f81c7
2 changed files with 60 additions and 55 deletions

View File

@ -49,66 +49,70 @@ class _ChangeLayoutBannerState extends State<ChangeLayoutBanner> {
}
}
return Column(
children: [
AnimatedContainer(
height: message == null ? 0 : kTopBottomBarHeight,
duration: Duration(milliseconds: kDefaultAnimationDuration),
curve: Curves.easeInOutCubic,
child: Material(
color: Colors.orange,
child: Padding(
padding: const EdgeInsets.only(left: 10),
child: Row(
children: [
Expanded(
child: IconText(
style: TextStyle(color: Colors.white),
icon: Icons.info_outline,
text: message,
return SafeArea(
child: Column(
children: [
AnimatedContainer(
height: message == null ? 0 : kTopBottomBarHeight,
duration: Duration(milliseconds: kDefaultAnimationDuration),
curve: Curves.easeInOutCubic,
child: Material(
color: Colors.orange,
child: Padding(
padding: const EdgeInsets.only(left: 10),
child: Row(
children: [
Expanded(
child: IconText(
style: TextStyle(color: Colors.white),
icon: Icons.info_outline,
text: message,
),
),
),
FlatButton(
child: Text(
localization.dismiss.toUpperCase(),
style: TextStyle(color: Colors.white),
FlatButton(
child: Text(
localization.dismiss.toUpperCase(),
style: TextStyle(color: Colors.white),
),
onPressed: () {
setState(() => _dismissedChange = true);
},
),
onPressed: () {
setState(() => _dismissedChange = true);
},
),
FlatButton(
child: Text(
localization.change.toUpperCase(),
style: TextStyle(color: Colors.white),
FlatButton(
child: Text(
localization.change.toUpperCase(),
style: TextStyle(color: Colors.white),
),
onPressed: () {
final layout =
widget.suggestedLayout == AppLayout.desktop
? AppLayout.mobile
: AppLayout.desktop;
store.dispatch(UserPreferencesChanged(layout: layout));
AppBuilder.of(context).rebuild();
WidgetsBinding.instance
.addPostFrameCallback((duration) {
if (layout == AppLayout.mobile) {
store.dispatch(ViewDashboard(
navigator: Navigator.of(context)));
} else {
store.dispatch(ViewMainScreen(
navigator: Navigator.of(context),
addDelay: true));
}
});
},
),
onPressed: () {
final layout = widget.suggestedLayout == AppLayout.desktop
? AppLayout.mobile
: AppLayout.desktop;
store.dispatch(UserPreferencesChanged(layout: layout));
AppBuilder.of(context).rebuild();
WidgetsBinding.instance.addPostFrameCallback((duration) {
if (layout == AppLayout.mobile) {
store.dispatch(
ViewDashboard(navigator: Navigator.of(context)));
} else {
store.dispatch(ViewMainScreen(
navigator: Navigator.of(context),
addDelay: true));
}
});
},
),
],
],
),
),
),
),
),
Expanded(
child: widget.child,
)
],
Expanded(
child: widget.child,
)
],
),
);
}
}

View File

@ -220,7 +220,8 @@ class SettingsListTile extends StatelessWidget {
return Container(
color: Theme.of(context).cardColor,
child: SelectedIndicator(
isSelected: viewModel.state.uiState.containsRoute('/$section'),
isSelected: viewModel.state.uiState.containsRoute('/$section') &&
isDesktop(context),
child: ListTile(
leading: Padding(
padding: const EdgeInsets.only(left: 6, top: 2),