11import 'package:flutter/material.dart' ;
22import 'package:flutter_riverpod/flutter_riverpod.dart' ;
33import 'package:apidash/consts.dart' ;
4+ import 'package:apidash/extensions/extensions.dart' ;
45import 'package:apidash/providers/providers.dart' ;
56import 'package:apidash/widgets/window_caption.dart' ;
7+ import '../navbar.dart' ;
68
79class PageBase extends ConsumerWidget {
810 final String title;
@@ -13,27 +15,39 @@ class PageBase extends ConsumerWidget {
1315 Widget build (BuildContext context, WidgetRef ref) {
1416 final isDarkMode =
1517 ref.watch (settingsProvider.select ((value) => value.isDark));
18+ final scaffold = Scaffold (
19+ backgroundColor: Theme .of (context).colorScheme.background,
20+ appBar: AppBar (
21+ backgroundColor: Theme .of (context).colorScheme.background,
22+ primary: true ,
23+ title: Text (title),
24+ centerTitle: true ,
25+ ),
26+ body: Padding (
27+ padding: EdgeInsets .only (
28+ bottom: MediaQuery .paddingOf (context).bottom,
29+ ),
30+ child: scaffoldBody,
31+ ),
32+ );
1633 return Stack (
1734 children: [
1835 Container (
19- padding: const EdgeInsets .only (bottom: 70 ) +
36+ padding: (context.isCompactWindow
37+ ? const EdgeInsets .only (bottom: 70 )
38+ : EdgeInsets .zero) +
2039 (kIsWindows || kIsMacOS ? kPt28 : EdgeInsets .zero),
2140 color: Theme .of (context).colorScheme.surface,
22- child: Scaffold (
23- backgroundColor: Theme .of (context).colorScheme.background,
24- appBar: AppBar (
25- backgroundColor: Theme .of (context).colorScheme.background,
26- primary: true ,
27- title: Text (title),
28- centerTitle: true ,
29- ),
30- body: Padding (
31- padding: EdgeInsets .only (
32- bottom: MediaQuery .paddingOf (context).bottom,
33- ),
34- child: scaffoldBody,
35- ),
36- ),
41+ child: ! context.isCompactWindow
42+ ? Row (
43+ children: [
44+ const NavRail (),
45+ Expanded (
46+ child: scaffold,
47+ ),
48+ ],
49+ )
50+ : scaffold,
3751 ),
3852 if (kIsWindows)
3953 SizedBox (
0 commit comments