diff --git a/lib/Backend/firebase.dart b/lib/Backend/firebase.dart index 68125823..9dcb4830 100644 --- a/lib/Backend/firebase.dart +++ b/lib/Backend/firebase.dart @@ -17,7 +17,7 @@ Future initFirebase() async { await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); FirebaseMessaging messaging = FirebaseMessaging.instance; - messaging.app.setAutomaticDataCollectionEnabled(false); + Firebase.app().setAutomaticDataCollectionEnabled(false); FirebaseMessaging.onBackgroundMessage(firebaseMessagingBackgroundHandler); await messaging.subscribeToTopic("newsletter"); final notificationSettings = await messaging.requestPermission( @@ -38,10 +38,8 @@ Future initFirebase() async { fireLogger.info('Message data: ${message.data}'); if (message.notification != null) { - fireLogger.info( - 'Message also contained a notification: ${message.notification}'); - const AndroidNotificationDetails androidNotificationDetails = - AndroidNotificationDetails( + fireLogger.info('Message also contained a notification: ${message.notification}'); + const AndroidNotificationDetails androidNotificationDetails = AndroidNotificationDetails( 'newsletter', 'Newsletter', channelDescription: 'Notifications from the Tail Company Newsletter', @@ -50,8 +48,7 @@ Future initFirebase() async { enableVibration: false, enableLights: false, ); - const NotificationDetails notificationDetails = - NotificationDetails(android: androidNotificationDetails); + const NotificationDetails notificationDetails = NotificationDetails(android: androidNotificationDetails); await flutterLocalNotificationsPlugin?.show( message.notification.hashCode, message.notification?.title, @@ -60,9 +57,8 @@ Future initFirebase() async { ); } }); - } - catch(e,s) { - fireLogger.shout('error setting up firebase',e,s); + } catch (e, s) { + fireLogger.shout('error setting up firebase', e, s); } } @@ -75,11 +71,8 @@ FlutterLocalNotificationsPlugin? flutterLocalNotificationsPlugin; Future initNotificationPlugin() async { flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); // initialise the plugin. app_icon needs to be a added as a drawable resource to the Android head project - const AndroidInitializationSettings initializationSettingsAndroid = - AndroidInitializationSettings("@mipmap/ic_launcher"); - const DarwinInitializationSettings initializationSettingsDarwin = - DarwinInitializationSettings( - defaultPresentSound: false, requestSoundPermission: false); + const AndroidInitializationSettings initializationSettingsAndroid = AndroidInitializationSettings("@mipmap/ic_launcher"); + const DarwinInitializationSettings initializationSettingsDarwin = DarwinInitializationSettings(defaultPresentSound: false, requestSoundPermission: false); const InitializationSettings initializationSettings = InitializationSettings( android: initializationSettingsAndroid, iOS: initializationSettingsDarwin, @@ -87,14 +80,12 @@ Future initNotificationPlugin() async { await flutterLocalNotificationsPlugin?.initialize( initializationSettings, onDidReceiveNotificationResponse: onDidReceiveNotificationResponse, - onDidReceiveBackgroundNotificationResponse: - onDidReceiveBackgroundNotificationResponse, + onDidReceiveBackgroundNotificationResponse: onDidReceiveBackgroundNotificationResponse, ); } //Foreground -void onDidReceiveNotificationResponse( - NotificationResponse notificationResponse) async { +void onDidReceiveNotificationResponse(NotificationResponse notificationResponse) async { final String? payload = notificationResponse.payload; if (notificationResponse.payload != null) { fireLogger.info('notification payload: $payload'); @@ -103,8 +94,7 @@ void onDidReceiveNotificationResponse( //background @pragma('vm:entry-point') -void onDidReceiveBackgroundNotificationResponse( - NotificationResponse notificationResponse) { +void onDidReceiveBackgroundNotificationResponse(NotificationResponse notificationResponse) { final String? payload = notificationResponse.payload; if (notificationResponse.payload != null) { fireLogger.info('notification payload: $payload'); diff --git a/lib/Frontend/pages/developer/developer_pincode.dart b/lib/Frontend/pages/developer/developer_pincode.dart index 4d5c705f..66617e1b 100644 --- a/lib/Frontend/pages/developer/developer_pincode.dart +++ b/lib/Frontend/pages/developer/developer_pincode.dart @@ -18,7 +18,7 @@ class _DeveloperPincodeState extends State { Widget build(BuildContext context) { return Scaffold( body: ScreenLock( - title: LottieLazyLoad( + title: const LottieLazyLoad( asset: 'assets/tailcostickers/tgs/TailCoStickers_file_144834344.tgs', renderCache: true, width: 80,