Static Nav Drawer in landscape

This commit is contained in:
Sewmina
2022-04-25 15:01:05 +05:30
parent 9f5ef1a7f1
commit 8af736fab1
11 changed files with 507 additions and 366 deletions

View File

@@ -565,6 +565,7 @@ class _MyHomePageState extends State<MyHomePage> {
avgProd = avgProd / _avgProdCount;
pastAvgProd = pastAvgProd / _pastAvgProdCount;
bool landscape=((MediaQuery.of(context).size.width / MediaQuery.of(context).size.height) > 1);
return Scaffold(
floatingActionButton: FloatingActionButton.extended(
onPressed: () {
@@ -602,13 +603,13 @@ class _MyHomePageState extends State<MyHomePage> {
//Container(color: Colors.red,child: Text("Offline",style:TextStyle(fontSize: 5))),
],
)),
drawer: navDrawer(context, 0),
drawer: landscape ? null : navDrawer(context, 0),
body: SafeArea(
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
children: [
((MediaQuery.of(context).size.width / MediaQuery.of(context).size.height) > 1) ?navDrawer(context, 0) : Container(),
landscape?navDrawer(context, 0) : Container(),
(User.activities.isEmpty) ? Container(
width: 1000,
child: Column(