mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 12:25:11 +00:00
chore: Follow up migration notification
This commit is contained in:
parent
ea790f43ac
commit
dea0bfd723
1 changed files with 4 additions and 6 deletions
|
@ -1,8 +1,4 @@
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:ui';
|
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||||
|
@ -134,13 +130,14 @@ abstract class ClientManager {
|
||||||
static void sendMigrationNotification(
|
static void sendMigrationNotification(
|
||||||
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin,
|
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin,
|
||||||
) async {
|
) async {
|
||||||
final l10n = lookupL10n(Locale(Platform.localeName));
|
final l10n = lookupL10n(PlatformDispatcher.instance.locale);
|
||||||
|
|
||||||
if (kIsWeb) {
|
if (kIsWeb) {
|
||||||
html.Notification(
|
html.Notification(
|
||||||
l10n.databaseMigrationTitle,
|
l10n.databaseMigrationTitle,
|
||||||
body: l10n.databaseMigrationBody,
|
body: l10n.databaseMigrationBody,
|
||||||
);
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await flutterLocalNotificationsPlugin.initialize(
|
await flutterLocalNotificationsPlugin.initialize(
|
||||||
|
@ -164,7 +161,8 @@ abstract class ClientManager {
|
||||||
fullScreenIntent: true, // To show notification popup
|
fullScreenIntent: true, // To show notification popup
|
||||||
showProgress: true,
|
showProgress: true,
|
||||||
),
|
),
|
||||||
iOS: DarwinNotificationDetails(),
|
iOS: DarwinNotificationDetails(sound: 'notification.caf'),
|
||||||
|
linux: LinuxNotificationDetails(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue