🐛 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(
initialEntries: [
OverlayEntry(builder: (context) {
return NotificationNotifier(child: child ?? Container());
return ScaffoldMessenger(
child: Scaffold(
body: NotificationNotifier(child: child ?? Container()),
),
);
}),
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(
BuildContext context,
GoRouterState state,

View File

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

View File

@ -25,10 +25,17 @@ class ChatListScreen extends StatelessWidget {
fixedAppBarColor: SolianTheme.isLargeScreen(context),
child: ChatListWidget(
onSelect: (item) {
SolianRouter.router.pushReplacementNamed(
'chat.channel',
pathParameters: {'channel': item.alias},
);
if (SolianRouter.currentRoute.name == 'chat.channel') {
SolianRouter.router.pushReplacementNamed(
'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,
useMaterial3: true,
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
Widget build(BuildContext context) {
return ScaffoldMessenger(
child: Scaffold(
body: Row(
children: [
SizedBox(
width: 400,
child: sideChild,
),
const VerticalDivider(width: 0.3, thickness: 0.3),
Expanded(child: mainChild ?? const PageEmptyWidget()),
],
return Row(
children: [
SizedBox(
width: 400,
child: sideChild,
),
),
const VerticalDivider(width: 0.3, thickness: 0.3),
Expanded(child: mainChild ?? const PageEmptyWidget()),
],
);
}
}