🐛 Bug fixes of scaffold

This commit is contained in:
LittleSheep 2024-05-03 14:04:34 +08:00
parent d179d907ad
commit e742338d92
6 changed files with 26 additions and 21 deletions

View File

@ -47,7 +47,11 @@ class SolianApp extends StatelessWidget {
child: Overlay( child: Overlay(
initialEntries: [ initialEntries: [
OverlayEntry(builder: (context) { OverlayEntry(builder: (context) {
return NotificationNotifier(child: child ?? Container()); return ScaffoldMessenger(
child: Scaffold(
body: NotificationNotifier(child: child ?? Container()),
),
);
}), }),
OverlayEntry(builder: (context) => const CallOverlay()), OverlayEntry(builder: (context) => const CallOverlay()),
], ],

View File

@ -159,6 +159,8 @@ abstract class SolianRouter {
], ],
); );
static GoRoute get currentRoute => SolianRouter.router.routerDelegate.currentConfiguration.last.route;
static Page defaultPageBuilder( static Page defaultPageBuilder(
BuildContext context, BuildContext context,
GoRouterState state, GoRouterState state,

View File

@ -32,7 +32,6 @@ class ChatScreen extends StatelessWidget {
title: chat.focusChannel?.name ?? 'Loading...', title: chat.focusChannel?.name ?? 'Loading...',
hideDrawer: true, hideDrawer: true,
fixedAppBarColor: SolianTheme.isLargeScreen(context), fixedAppBarColor: SolianTheme.isLargeScreen(context),
appBarLeading: IconButton(icon: const Icon(Icons.tag), onPressed: () {}),
appBarActions: chat.focusChannel != null appBarActions: chat.focusChannel != null
? [ ? [
ChannelCallAction( ChannelCallAction(

View File

@ -25,10 +25,17 @@ class ChatListScreen extends StatelessWidget {
fixedAppBarColor: SolianTheme.isLargeScreen(context), fixedAppBarColor: SolianTheme.isLargeScreen(context),
child: ChatListWidget( child: ChatListWidget(
onSelect: (item) { onSelect: (item) {
SolianRouter.router.pushReplacementNamed( if (SolianRouter.currentRoute.name == 'chat.channel') {
'chat.channel', SolianRouter.router.pushReplacementNamed(
pathParameters: {'channel': item.alias}, 'chat.channel',
); pathParameters: {'channel': item.alias},
);
} else {
SolianRouter.router.pushNamed(
'chat.channel',
pathParameters: {'channel': item.alias},
);
}
}, },
), ),
); );

View File

@ -9,9 +9,6 @@ abstract class SolianTheme {
brightness: brightness, brightness: brightness,
useMaterial3: true, useMaterial3: true,
colorScheme: ColorScheme.fromSeed(brightness: brightness, seedColor: Colors.indigo), colorScheme: ColorScheme.fromSeed(brightness: brightness, seedColor: Colors.indigo),
snackBarTheme: const SnackBarThemeData(
behavior: SnackBarBehavior.floating,
),
); );
} }
} }

View File

@ -13,19 +13,15 @@ class TwoColumnLayout extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ScaffoldMessenger( return Row(
child: Scaffold( children: [
body: Row( SizedBox(
children: [ width: 400,
SizedBox( child: sideChild,
width: 400,
child: sideChild,
),
const VerticalDivider(width: 0.3, thickness: 0.3),
Expanded(child: mainChild ?? const PageEmptyWidget()),
],
), ),
), const VerticalDivider(width: 0.3, thickness: 0.3),
Expanded(child: mainChild ?? const PageEmptyWidget()),
],
); );
} }
} }