@@ -14,6 +14,8 @@ import 'package:taskwarrior/app/utils/home_path/home_path.dart' as rc;
1414import '../controllers/home_controller.dart' ;
1515
1616class HomeView extends GetView <HomeController > {
17+ static const double _largeScreenBreakpoint = 800.0 ;
18+
1719 const HomeView ({super .key});
1820 @override
1921 Widget build (BuildContext context) {
@@ -34,29 +36,65 @@ class HomeView extends GetView<HomeController> {
3436 controller.checkForSync (context);
3537
3638 return Obx (
37- () => Scaffold (
38- appBar: HomePageAppBar (
39- server: server,
40- credentials: credentials,
41- controller: controller,
42- ),
43- backgroundColor: controller.isDarkModeOn.value
44- ? TaskWarriorColors .kprimaryBackgroundColor
45- : TaskWarriorColors .kLightPrimaryBackgroundColor,
46- drawer: NavDrawer (homeController: controller),
47- body: HomePageBody (
48- controller: controller,
49- ),
50- endDrawer: Obx (
51- () => FilterDrawer (
52- filters: controller.getFilters (),
53- homeController: controller,
39+ () {
40+ // Get the current screen width
41+ final screenWidth = MediaQuery .of (context).size.width;
42+ final bool isLargeScreen = screenWidth >= _largeScreenBreakpoint;
43+
44+ return Scaffold (
45+ appBar: HomePageAppBar (
46+ server: server,
47+ credentials: credentials,
48+ controller: controller,
5449 ),
55- ),
56- floatingActionButton:
57- HomePageFloatingActionButton (controller: controller),
58- resizeToAvoidBottomInset: false ,
59- ),
50+ backgroundColor: controller.isDarkModeOn.value
51+ ? TaskWarriorColors .kprimaryBackgroundColor
52+ : TaskWarriorColors .kLightPrimaryBackgroundColor,
53+ // Only show default Scaffold drawer/endDrawer on small screens
54+ drawer: isLargeScreen ? null : NavDrawer (homeController: controller),
55+ endDrawer: isLargeScreen
56+ ? null
57+ : Obx (
58+ () => FilterDrawer (
59+ filters: controller.getFilters (),
60+ homeController: controller,
61+ ),
62+ ),
63+ body: isLargeScreen
64+ ? Row (
65+ children: [
66+ // Static Drawer
67+ SizedBox (
68+ width: 250 , // Adjust width as needed for your drawer
69+ child: NavDrawer (homeController: controller),
70+ ),
71+ // Main content takes remaining space
72+ Expanded (
73+ child: HomePageBody (
74+ controller: controller,
75+ ),
76+ ),
77+ // Static End Drawer
78+ SizedBox (
79+ width: 250 , // Adjust width as needed for your end drawer
80+ child: Obx (
81+ () => FilterDrawer (
82+ filters: controller.getFilters (),
83+ homeController: controller,
84+ ),
85+ ),
86+ ),
87+ ],
88+ )
89+ : HomePageBody (
90+ // Regular body for small screens
91+ controller: controller,
92+ ),
93+ floatingActionButton:
94+ HomePageFloatingActionButton (controller: controller),
95+ resizeToAvoidBottomInset: false ,
96+ );
97+ },
6098 );
6199 }
62100}
0 commit comments