From 3403461988405a90950e0caeba1234f3249d3536 Mon Sep 17 00:00:00 2001 From: andoriyaprashant Date: Tue, 7 Nov 2023 11:27:36 +0530 Subject: [PATCH 01/10] Notification Related Implementation Removed --- lib/main.dart | 118 ++++++++++++------------- test/helpers/setup_firebase_mocks.dart | 51 ++++++----- 2 files changed, 86 insertions(+), 83 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 19350a4cc..fb39525c3 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -65,10 +65,10 @@ late Map androidFirebaseOptions; late Map iosFirebaseOptions; /// Create a [AndroidNotificationChannel] for heads up notifications. -late AndroidNotificationChannel channel; +/// late AndroidNotificationChannel channel; /// Initialize the [FlutterLocalNotificationsPlugin] package. -late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; +/// late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; /// First function to initialize the application, invoked automatically. /// @@ -81,25 +81,25 @@ Future main() async { // Returns an instance of the binding that implements WidgetsBinding. WidgetsFlutterBinding.ensureInitialized(); - if (!kIsWeb) { - channel = const AndroidNotificationChannel( - 'high_importance_channel', // id - 'High Importance Notifications', // title - description: - 'This channel is used for important notifications.', // description - importance: Importance.high, - ); - - flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); - - // Create an Android Notification Channel. - // We use this channel in the `AndroidManifest.xml` file to override the - // default FCM channel to enable heads up notifications. - await flutterLocalNotificationsPlugin - .resolvePlatformSpecificImplementation< - AndroidFlutterLocalNotificationsPlugin>() - ?.createNotificationChannel(channel); - } + // if (!kIsWeb) { + // channel = const AndroidNotificationChannel( + // 'high_importance_channel', // id + // 'High Importance Notifications', // title + // description: + // 'This channel is used for important notifications.', // description + // importance: Importance.high, + // ); + + // flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); + + // // Create an Android Notification Channel. + // // We use this channel in the `AndroidManifest.xml` file to override the + // // default FCM channel to enable heads up notifications. + // await flutterLocalNotificationsPlugin + // .resolvePlatformSpecificImplementation< + // AndroidFlutterLocalNotificationsPlugin>() + // ?.createNotificationChannel(channel); + // } final Directory dir = await path.getApplicationDocumentsDirectory(); Hive @@ -120,7 +120,7 @@ Future main() async { await setUpFirebaseKeys(); await setUpFirebase(); - await setUpFirebaseMessaging(); + // await setUpFirebaseMessaging(); } } catch (e) { print("Firebase not working"); @@ -337,40 +337,40 @@ class DemoViewModel extends BaseModel { /// /// **returns**: /// * `Future`: promise that will be fulfilled Firebase is setted up. -Future setUpFirebaseMessaging() async { - /// Set the background messaging handler early on, as a named top-level function - FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler); - - // Update the iOS foreground notification presentation options to allow heads up notifications. - await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions( - alert: true, - badge: true, - sound: true, - ); - - FirebaseMessaging.instance - .getInitialMessage() - .then((RemoteMessage? message) {}); - - FirebaseMessaging.onMessage.listen((RemoteMessage message) { - final RemoteNotification? notification = message.notification; - final AndroidNotification? android = message.notification?.android; - if (notification != null && android != null && !kIsWeb) { - flutterLocalNotificationsPlugin.show( - notification.hashCode, - notification.title, - notification.body, - NotificationDetails( - android: AndroidNotificationDetails( - channel.id, - channel.name, - channelDescription: channel.description, - icon: 'launch_background', - ), - ), - ); - } - }); - - FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {}); -} +// Future setUpFirebaseMessaging() async { +// /// Set the background messaging handler early on, as a named top-level function +// FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler); + +// // Update the iOS foreground notification presentation options to allow heads up notifications. +// await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions( +// alert: true, +// badge: true, +// sound: true, +// ); + + // FirebaseMessaging.instance + // .getInitialMessage() + // .then((RemoteMessage? message) {}); + + // FirebaseMessaging.onMessage.listen((RemoteMessage message) { + // final RemoteNotification? notification = message.notification; + // final AndroidNotification? android = message.notification?.android; + // if (notification != null && android != null && !kIsWeb) { + // flutterLocalNotificationsPlugin.show( + // notification.hashCode, + // notification.title, + // notification.body, + // NotificationDetails( + // android: AndroidNotificationDetails( + // channel.id, + // channel.name, + // channelDescription: channel.description, + // icon: 'launch_background', + // ), + // ), + // ); + // } + // }); + +// FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {}); +// } diff --git a/test/helpers/setup_firebase_mocks.dart b/test/helpers/setup_firebase_mocks.dart index 57bfaae23..622f975ac 100644 --- a/test/helpers/setup_firebase_mocks.dart +++ b/test/helpers/setup_firebase_mocks.dart @@ -156,30 +156,33 @@ class MockFirebaseMessaging extends Mock ); } - @override - Future requestPermission({ - bool? alert = true, - bool? announcement = false, - bool? badge = true, - bool? carPlay = false, - bool? criticalAlert = false, - bool? provisional = false, - bool? sound = true, - }) { - return super.noSuchMethod( - Invocation.method(#requestPermission, [], { - #alert: alert, - #announcement: announcement, - #badge: badge, - #carPlay: carPlay, - #criticalAlert: criticalAlert, - #provisional: provisional, - #sound: sound, - }), - returnValue: neverEndingFuture(), - returnValueForMissingStub: neverEndingFuture(), - ); - } +// Comment out the notification logic for the MVP +// TODO: Re-enable notifications when needed for the final release. + + // @override + // Future requestPermission({ + // bool? alert = true, + // bool? announcement = false, + // bool? badge = true, + // bool? carPlay = false, + // bool? criticalAlert = false, + // bool? provisional = false, + // bool? sound = true, + // }) { + // return super.noSuchMethod( + // Invocation.method(#requestPermission, [], { + // #alert: alert, + // #announcement: announcement, + // #badge: badge, + // #carPlay: carPlay, + // #criticalAlert: criticalAlert, + // #provisional: provisional, + // #sound: sound, + // }), + // returnValue: neverEndingFuture(), + // returnValueForMissingStub: neverEndingFuture(), + // ); + // } @override Future subscribeToTopic(String? topic) { From 6b16192d07041954af5fe4425023eb3de815bd3b Mon Sep 17 00:00:00 2001 From: andoriyaprashant Date: Sat, 11 Nov 2023 09:18:27 +0530 Subject: [PATCH 02/10] Dart formatting changes --- lib/main.dart | 48 +++++++++---------- .../login_view_model.dart | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index fb39525c3..f7bb59b94 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,7 +5,7 @@ import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart' as fs; -import 'package:flutter_local_notifications/flutter_local_notifications.dart'; +// import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:hive/hive.dart'; import 'package:path_provider/path_provider.dart' as path; @@ -348,29 +348,29 @@ class DemoViewModel extends BaseModel { // sound: true, // ); - // FirebaseMessaging.instance - // .getInitialMessage() - // .then((RemoteMessage? message) {}); - - // FirebaseMessaging.onMessage.listen((RemoteMessage message) { - // final RemoteNotification? notification = message.notification; - // final AndroidNotification? android = message.notification?.android; - // if (notification != null && android != null && !kIsWeb) { - // flutterLocalNotificationsPlugin.show( - // notification.hashCode, - // notification.title, - // notification.body, - // NotificationDetails( - // android: AndroidNotificationDetails( - // channel.id, - // channel.name, - // channelDescription: channel.description, - // icon: 'launch_background', - // ), - // ), - // ); - // } - // }); +// FirebaseMessaging.instance +// .getInitialMessage() +// .then((RemoteMessage? message) {}); + +// FirebaseMessaging.onMessage.listen((RemoteMessage message) { +// final RemoteNotification? notification = message.notification; +// final AndroidNotification? android = message.notification?.android; +// if (notification != null && android != null && !kIsWeb) { +// flutterLocalNotificationsPlugin.show( +// notification.hashCode, +// notification.title, +// notification.body, +// NotificationDetails( +// android: AndroidNotificationDetails( +// channel.id, +// channel.name, +// channelDescription: channel.description, +// icon: 'launch_background', +// ), +// ), +// ); +// } +// }); // FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {}); // } diff --git a/lib/view_model/pre_auth_view_models/login_view_model.dart b/lib/view_model/pre_auth_view_models/login_view_model.dart index 0f909bfdb..cf548df48 100644 --- a/lib/view_model/pre_auth_view_models/login_view_model.dart +++ b/lib/view_model/pre_auth_view_models/login_view_model.dart @@ -119,7 +119,7 @@ class LoginViewModel extends BaseModel { queries.saveFcmToken(token), ); - await setUpFirebaseMessaging(); + //await setUpFirebaseMessaging(); final androidFirebaseOptionsBox = await Hive.openBox('androidFirebaseOptions'); From 9f54f6b5b83b34320e80ea74ef2dcecff2a934c9 Mon Sep 17 00:00:00 2001 From: andoriyaprashant Date: Sat, 11 Nov 2023 09:23:53 +0530 Subject: [PATCH 03/10] Analyzing talawa --- lib/main.dart | 16 ++++++++-------- .../pre_auth_view_models/login_view_model.dart | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index f7bb59b94..d19060e79 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -33,14 +33,14 @@ import 'package:talawa/views/base_view.dart'; /// /// **returns**: /// * `Future`: promise that will be fulfilled message background activities are successful. -Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { - // If you're going to use other Firebase services in the background, such as Firestore, - // make sure you call `initializeApp` before using other Firebase services. - final Directory dir = await path.getApplicationDocumentsDirectory(); - Hive.init(dir.path); - await setUpFirebaseKeys(); - await setUpFirebase(); -} +// Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { +// // If you're going to use other Firebase services in the background, such as Firestore, +// // make sure you call `initializeApp` before using other Firebase services. +// final Directory dir = await path.getApplicationDocumentsDirectory(); +// Hive.init(dir.path); +// await setUpFirebaseKeys(); +// await setUpFirebase(); +// } /// Initializes the firebase in the app according to the userplatform (android/iOS). /// diff --git a/lib/view_model/pre_auth_view_models/login_view_model.dart b/lib/view_model/pre_auth_view_models/login_view_model.dart index cf548df48..53fde4aa8 100644 --- a/lib/view_model/pre_auth_view_models/login_view_model.dart +++ b/lib/view_model/pre_auth_view_models/login_view_model.dart @@ -119,7 +119,7 @@ class LoginViewModel extends BaseModel { queries.saveFcmToken(token), ); - //await setUpFirebaseMessaging(); + ///await setUpFirebaseMessaging(); final androidFirebaseOptionsBox = await Hive.openBox('androidFirebaseOptions'); From 8eec4530a08a0d758bb648dd51ddadbabbd57bb0 Mon Sep 17 00:00:00 2001 From: andoriyaprashant Date: Sat, 11 Nov 2023 09:28:30 +0530 Subject: [PATCH 04/10] login_view_model file fixed --- lib/view_model/pre_auth_view_models/login_view_model.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/view_model/pre_auth_view_models/login_view_model.dart b/lib/view_model/pre_auth_view_models/login_view_model.dart index 53fde4aa8..0070a44d5 100644 --- a/lib/view_model/pre_auth_view_models/login_view_model.dart +++ b/lib/view_model/pre_auth_view_models/login_view_model.dart @@ -119,7 +119,7 @@ class LoginViewModel extends BaseModel { queries.saveFcmToken(token), ); - ///await setUpFirebaseMessaging(); + // await setUpFirebaseMessaging(); final androidFirebaseOptionsBox = await Hive.openBox('androidFirebaseOptions'); From dc258098dfe7b43c58ea1d5abf0e54f1f9f38771 Mon Sep 17 00:00:00 2001 From: andoriyaprashant Date: Sat, 11 Nov 2023 09:28:50 +0530 Subject: [PATCH 05/10] Dart formatting changes --- lib/view_model/pre_auth_view_models/login_view_model.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/view_model/pre_auth_view_models/login_view_model.dart b/lib/view_model/pre_auth_view_models/login_view_model.dart index 0070a44d5..0dd3e46df 100644 --- a/lib/view_model/pre_auth_view_models/login_view_model.dart +++ b/lib/view_model/pre_auth_view_models/login_view_model.dart @@ -119,7 +119,7 @@ class LoginViewModel extends BaseModel { queries.saveFcmToken(token), ); - // await setUpFirebaseMessaging(); + // await setUpFirebaseMessaging(); final androidFirebaseOptionsBox = await Hive.openBox('androidFirebaseOptions'); From 6bfb16768200f4cc16b7359368d1e1cb0e54d9dd Mon Sep 17 00:00:00 2001 From: andoriyaprashant Date: Sat, 11 Nov 2023 09:34:47 +0530 Subject: [PATCH 06/10] Gitub workflow --- lib/main.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index d19060e79..94a12317f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,7 +5,7 @@ import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart' as fs; -// import 'package:flutter_local_notifications/flutter_local_notifications.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:hive/hive.dart'; import 'package:path_provider/path_provider.dart' as path; From 86cfacadcbbb50c053df43d184041b6ca128d33a Mon Sep 17 00:00:00 2001 From: andoriyaprashant Date: Sat, 11 Nov 2023 09:39:12 +0530 Subject: [PATCH 07/10] unauthorized file changes --- lib/main.dart | 134 +++++++++--------- .../login_view_model.dart | 2 +- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 94a12317f..19350a4cc 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -33,14 +33,14 @@ import 'package:talawa/views/base_view.dart'; /// /// **returns**: /// * `Future`: promise that will be fulfilled message background activities are successful. -// Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { -// // If you're going to use other Firebase services in the background, such as Firestore, -// // make sure you call `initializeApp` before using other Firebase services. -// final Directory dir = await path.getApplicationDocumentsDirectory(); -// Hive.init(dir.path); -// await setUpFirebaseKeys(); -// await setUpFirebase(); -// } +Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { + // If you're going to use other Firebase services in the background, such as Firestore, + // make sure you call `initializeApp` before using other Firebase services. + final Directory dir = await path.getApplicationDocumentsDirectory(); + Hive.init(dir.path); + await setUpFirebaseKeys(); + await setUpFirebase(); +} /// Initializes the firebase in the app according to the userplatform (android/iOS). /// @@ -65,10 +65,10 @@ late Map androidFirebaseOptions; late Map iosFirebaseOptions; /// Create a [AndroidNotificationChannel] for heads up notifications. -/// late AndroidNotificationChannel channel; +late AndroidNotificationChannel channel; /// Initialize the [FlutterLocalNotificationsPlugin] package. -/// late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; +late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin; /// First function to initialize the application, invoked automatically. /// @@ -81,25 +81,25 @@ Future main() async { // Returns an instance of the binding that implements WidgetsBinding. WidgetsFlutterBinding.ensureInitialized(); - // if (!kIsWeb) { - // channel = const AndroidNotificationChannel( - // 'high_importance_channel', // id - // 'High Importance Notifications', // title - // description: - // 'This channel is used for important notifications.', // description - // importance: Importance.high, - // ); - - // flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); - - // // Create an Android Notification Channel. - // // We use this channel in the `AndroidManifest.xml` file to override the - // // default FCM channel to enable heads up notifications. - // await flutterLocalNotificationsPlugin - // .resolvePlatformSpecificImplementation< - // AndroidFlutterLocalNotificationsPlugin>() - // ?.createNotificationChannel(channel); - // } + if (!kIsWeb) { + channel = const AndroidNotificationChannel( + 'high_importance_channel', // id + 'High Importance Notifications', // title + description: + 'This channel is used for important notifications.', // description + importance: Importance.high, + ); + + flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); + + // Create an Android Notification Channel. + // We use this channel in the `AndroidManifest.xml` file to override the + // default FCM channel to enable heads up notifications. + await flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< + AndroidFlutterLocalNotificationsPlugin>() + ?.createNotificationChannel(channel); + } final Directory dir = await path.getApplicationDocumentsDirectory(); Hive @@ -120,7 +120,7 @@ Future main() async { await setUpFirebaseKeys(); await setUpFirebase(); - // await setUpFirebaseMessaging(); + await setUpFirebaseMessaging(); } } catch (e) { print("Firebase not working"); @@ -337,40 +337,40 @@ class DemoViewModel extends BaseModel { /// /// **returns**: /// * `Future`: promise that will be fulfilled Firebase is setted up. -// Future setUpFirebaseMessaging() async { -// /// Set the background messaging handler early on, as a named top-level function -// FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler); - -// // Update the iOS foreground notification presentation options to allow heads up notifications. -// await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions( -// alert: true, -// badge: true, -// sound: true, -// ); - -// FirebaseMessaging.instance -// .getInitialMessage() -// .then((RemoteMessage? message) {}); - -// FirebaseMessaging.onMessage.listen((RemoteMessage message) { -// final RemoteNotification? notification = message.notification; -// final AndroidNotification? android = message.notification?.android; -// if (notification != null && android != null && !kIsWeb) { -// flutterLocalNotificationsPlugin.show( -// notification.hashCode, -// notification.title, -// notification.body, -// NotificationDetails( -// android: AndroidNotificationDetails( -// channel.id, -// channel.name, -// channelDescription: channel.description, -// icon: 'launch_background', -// ), -// ), -// ); -// } -// }); - -// FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {}); -// } +Future setUpFirebaseMessaging() async { + /// Set the background messaging handler early on, as a named top-level function + FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler); + + // Update the iOS foreground notification presentation options to allow heads up notifications. + await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions( + alert: true, + badge: true, + sound: true, + ); + + FirebaseMessaging.instance + .getInitialMessage() + .then((RemoteMessage? message) {}); + + FirebaseMessaging.onMessage.listen((RemoteMessage message) { + final RemoteNotification? notification = message.notification; + final AndroidNotification? android = message.notification?.android; + if (notification != null && android != null && !kIsWeb) { + flutterLocalNotificationsPlugin.show( + notification.hashCode, + notification.title, + notification.body, + NotificationDetails( + android: AndroidNotificationDetails( + channel.id, + channel.name, + channelDescription: channel.description, + icon: 'launch_background', + ), + ), + ); + } + }); + + FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {}); +} diff --git a/lib/view_model/pre_auth_view_models/login_view_model.dart b/lib/view_model/pre_auth_view_models/login_view_model.dart index 0dd3e46df..0f909bfdb 100644 --- a/lib/view_model/pre_auth_view_models/login_view_model.dart +++ b/lib/view_model/pre_auth_view_models/login_view_model.dart @@ -119,7 +119,7 @@ class LoginViewModel extends BaseModel { queries.saveFcmToken(token), ); - // await setUpFirebaseMessaging(); + await setUpFirebaseMessaging(); final androidFirebaseOptionsBox = await Hive.openBox('androidFirebaseOptions'); From 99d8c9c61f1a099002c06b423dd7413a45bb2f11 Mon Sep 17 00:00:00 2001 From: andoriyaprashant Date: Sat, 11 Nov 2023 10:04:16 +0530 Subject: [PATCH 08/10] app_setting_page_test.dart --- .../app_settings/app_setting_page_test.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart b/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart index 016cecb44..efa36c15d 100644 --- a/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart +++ b/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart @@ -102,6 +102,10 @@ Future main() async { await Hive.openBox('currentOrg'); await Hive.openBox('url'); + tearDown(() async { + await Hive.close(); + }); + group('Setting Page Screen Widget Test in dark mode', () { testWidgets("Testing if Settings Screen shows up", (tester) async { await tester.pumpWidget(createChangePassScreenDark()); From 6a058d3b05c69785461c580573a9f9074dda33e2 Mon Sep 17 00:00:00 2001 From: andoriyaprashant Date: Sat, 11 Nov 2023 12:54:43 +0530 Subject: [PATCH 09/10] Update app_setting_page_test.dart --- .../app_settings/app_setting_page_test.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart b/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart index efa36c15d..76bc0cca6 100644 --- a/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart +++ b/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart @@ -94,7 +94,10 @@ Future main() async { locator().test(); locator().test(); final Directory dir = Directory('temporaryPath'); - Hive + if (!dir.existsSync()) { + dir.createSync(recursive: true); + } + await Hive ..init(dir.path) ..registerAdapter(UserAdapter()) ..registerAdapter(OrgInfoAdapter()); From bb69a9af8ef5382bccb19e0a146b73cb7081d7a8 Mon Sep 17 00:00:00 2001 From: andoriyaprashant Date: Sat, 11 Nov 2023 12:57:50 +0530 Subject: [PATCH 10/10] Update app_setting_page_test.dart file --- .../app_settings/app_setting_page_test.dart | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart b/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart index 76bc0cca6..016cecb44 100644 --- a/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart +++ b/test/widget_tests/after_auth_screens/app_settings/app_setting_page_test.dart @@ -94,10 +94,7 @@ Future main() async { locator().test(); locator().test(); final Directory dir = Directory('temporaryPath'); - if (!dir.existsSync()) { - dir.createSync(recursive: true); - } - await Hive + Hive ..init(dir.path) ..registerAdapter(UserAdapter()) ..registerAdapter(OrgInfoAdapter()); @@ -105,10 +102,6 @@ Future main() async { await Hive.openBox('currentOrg'); await Hive.openBox('url'); - tearDown(() async { - await Hive.close(); - }); - group('Setting Page Screen Widget Test in dark mode', () { testWidgets("Testing if Settings Screen shows up", (tester) async { await tester.pumpWidget(createChangePassScreenDark());