🐛 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) {
if (SolianRouter.currentRoute.name == 'chat.channel') {
SolianRouter.router.pushReplacementNamed( SolianRouter.router.pushReplacementNamed(
'chat.channel', 'chat.channel',
pathParameters: {'channel': item.alias}, 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,9 +13,7 @@ class TwoColumnLayout extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ScaffoldMessenger( return Row(
child: Scaffold(
body: Row(
children: [ children: [
SizedBox( SizedBox(
width: 400, width: 400,
@ -24,8 +22,6 @@ class TwoColumnLayout extends StatelessWidget {
const VerticalDivider(width: 0.3, thickness: 0.3), const VerticalDivider(width: 0.3, thickness: 0.3),
Expanded(child: mainChild ?? const PageEmptyWidget()), Expanded(child: mainChild ?? const PageEmptyWidget()),
], ],
),
),
); );
} }
} }