mirror of
https://github.com/foss42/apidash.git
synced 2025-06-02 16:02:12 +08:00
fix: navbar responsiveness
This commit is contained in:
@ -124,6 +124,7 @@ class NavRail extends ConsumerWidget {
|
|||||||
Icons.help,
|
Icons.help,
|
||||||
Icons.help_outline,
|
Icons.help_outline,
|
||||||
'About',
|
'About',
|
||||||
|
showLabel: false,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
customNavigationDestination(
|
customNavigationDestination(
|
||||||
@ -134,6 +135,7 @@ class NavRail extends ConsumerWidget {
|
|||||||
Icons.settings,
|
Icons.settings,
|
||||||
Icons.settings_outlined,
|
Icons.settings_outlined,
|
||||||
'Settings',
|
'Settings',
|
||||||
|
showLabel: false,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:apidash/consts.dart';
|
import 'package:apidash/consts.dart';
|
||||||
|
import 'package:apidash/extensions/extensions.dart';
|
||||||
import 'package:apidash/providers/providers.dart';
|
import 'package:apidash/providers/providers.dart';
|
||||||
import 'package:apidash/widgets/window_caption.dart';
|
import 'package:apidash/widgets/window_caption.dart';
|
||||||
|
import '../navbar.dart';
|
||||||
|
|
||||||
class PageBase extends ConsumerWidget {
|
class PageBase extends ConsumerWidget {
|
||||||
final String title;
|
final String title;
|
||||||
@ -13,13 +15,7 @@ class PageBase extends ConsumerWidget {
|
|||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final isDarkMode =
|
final isDarkMode =
|
||||||
ref.watch(settingsProvider.select((value) => value.isDark));
|
ref.watch(settingsProvider.select((value) => value.isDark));
|
||||||
return Stack(
|
final scaffold = Scaffold(
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.only(bottom: 70) +
|
|
||||||
(kIsWindows || kIsMacOS ? kPt28 : EdgeInsets.zero),
|
|
||||||
color: Theme.of(context).colorScheme.surface,
|
|
||||||
child: Scaffold(
|
|
||||||
backgroundColor: Theme.of(context).colorScheme.background,
|
backgroundColor: Theme.of(context).colorScheme.background,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: Theme.of(context).colorScheme.background,
|
backgroundColor: Theme.of(context).colorScheme.background,
|
||||||
@ -33,7 +29,25 @@ class PageBase extends ConsumerWidget {
|
|||||||
),
|
),
|
||||||
child: scaffoldBody,
|
child: scaffoldBody,
|
||||||
),
|
),
|
||||||
|
);
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: (context.isCompactWindow
|
||||||
|
? const EdgeInsets.only(bottom: 70)
|
||||||
|
: EdgeInsets.zero) +
|
||||||
|
(kIsWindows || kIsMacOS ? kPt28 : EdgeInsets.zero),
|
||||||
|
color: Theme.of(context).colorScheme.surface,
|
||||||
|
child: !context.isCompactWindow
|
||||||
|
? Row(
|
||||||
|
children: [
|
||||||
|
const NavRail(),
|
||||||
|
Expanded(
|
||||||
|
child: scaffold,
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: scaffold,
|
||||||
),
|
),
|
||||||
if (kIsWindows)
|
if (kIsWindows)
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
Reference in New Issue
Block a user