💄 Optimize snackbars
This commit is contained in:
@@ -411,7 +411,7 @@ final routerProvider = Provider<GoRouter>((ref) {
|
|||||||
pageBuilder:
|
pageBuilder:
|
||||||
(context, state, child) => CustomTransitionPage(
|
(context, state, child) => CustomTransitionPage(
|
||||||
key: const ValueKey('chat'),
|
key: const ValueKey('chat'),
|
||||||
child: child,
|
child: ChatShellScreen(child: child),
|
||||||
transitionsBuilder: _tabPagesTransitionBuilder,
|
transitionsBuilder: _tabPagesTransitionBuilder,
|
||||||
),
|
),
|
||||||
routes: [
|
routes: [
|
||||||
@@ -492,7 +492,7 @@ final routerProvider = Provider<GoRouter>((ref) {
|
|||||||
pageBuilder:
|
pageBuilder:
|
||||||
(context, state, child) => CustomTransitionPage(
|
(context, state, child) => CustomTransitionPage(
|
||||||
key: const ValueKey('account'),
|
key: const ValueKey('account'),
|
||||||
child: child,
|
child: AccountShellScreen(child: child),
|
||||||
transitionsBuilder: _tabPagesTransitionBuilder,
|
transitionsBuilder: _tabPagesTransitionBuilder,
|
||||||
),
|
),
|
||||||
routes: [
|
routes: [
|
||||||
|
@@ -26,7 +26,12 @@ StreamSubscription<WebSocketPacket> setupNotificationListener(
|
|||||||
final notification = SnNotification.fromJson(pkt.data!);
|
final notification = SnNotification.fromJson(pkt.data!);
|
||||||
showTopSnackBar(
|
showTopSnackBar(
|
||||||
globalOverlay.currentState!,
|
globalOverlay.currentState!,
|
||||||
NotificationCard(notification: notification),
|
Center(
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: const BoxConstraints(maxWidth: 480),
|
||||||
|
child: NotificationCard(notification: notification),
|
||||||
|
),
|
||||||
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (notification.meta['action_uri'] != null) {
|
if (notification.meta['action_uri'] != null) {
|
||||||
var uri = notification.meta['action_uri'] as String;
|
var uri = notification.meta['action_uri'] as String;
|
||||||
@@ -53,9 +58,9 @@ StreamSubscription<WebSocketPacket> setupNotificationListener(
|
|||||||
(Platform.isMacOS ||
|
(Platform.isMacOS ||
|
||||||
Platform.isWindows ||
|
Platform.isWindows ||
|
||||||
Platform.isLinux))
|
Platform.isLinux))
|
||||||
? 24
|
? 28
|
||||||
// ignore: use_build_context_synchronously
|
// ignore: use_build_context_synchronously
|
||||||
: MediaQuery.of(context).padding.top + 8,
|
: MediaQuery.of(context).padding.top + 16,
|
||||||
bottom: 16,
|
bottom: 16,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@@ -11,7 +11,12 @@ export 'content/alert.native.dart'
|
|||||||
void showSnackBar(String message, {SnackBarAction? action}) {
|
void showSnackBar(String message, {SnackBarAction? action}) {
|
||||||
showTopSnackBar(
|
showTopSnackBar(
|
||||||
globalOverlay.currentState!,
|
globalOverlay.currentState!,
|
||||||
Card(child: Text(message).padding(horizontal: 20, vertical: 16)),
|
ConstrainedBox(
|
||||||
|
constraints: const BoxConstraints(maxWidth: 480),
|
||||||
|
child: Center(
|
||||||
|
child: Card(child: Text(message).padding(horizontal: 20, vertical: 16)),
|
||||||
|
),
|
||||||
|
),
|
||||||
snackBarPosition: SnackBarPosition.bottom,
|
snackBarPosition: SnackBarPosition.bottom,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user