From 2cc9ddceaf050dc1af19b6b19ae2c239b68b8520 Mon Sep 17 00:00:00 2001 From: MukalDadhwal Date: Mon, 20 Jan 2025 19:37:07 +0530 Subject: [PATCH 1/5] migrated qr_scanner to mobile_scanner --- lib/locator.dart | 6 +- lib/services/graphql_config.dart | 6 + .../select_organization_view_model.dart | 3 +- .../set_url_view_model.dart | 207 +++++++++++++----- .../join_organisation_after_auth.dart | 88 ++++++-- pubspec.lock | 72 ++---- pubspec.yaml | 7 +- 7 files changed, 255 insertions(+), 134 deletions(-) diff --git a/lib/locator.dart b/lib/locator.dart index 15e156508..429f979d4 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,5 +1,6 @@ import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:get_it/get_it.dart'; +import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:image_cropper/image_cropper.dart'; import 'package:image_picker/image_picker.dart'; import 'package:talawa/main.dart'; @@ -100,10 +101,13 @@ final actionHandlerService = locator(); /// /// **returns**: /// None + Future setupLocator() async { locator.registerSingleton(DataBaseMutationFunctions()); - locator.registerSingleton(GraphqlConfig()); + locator.registerSingleton(GraphqlConfig( + httpLink: HttpLink('http://10.0.2.2:4000/'), + webSocketLink: WebSocketLink("ws://10.0.2.2:4000/graphql/"))); //services locator.registerSingleton(NavigationService()); diff --git a/lib/services/graphql_config.dart b/lib/services/graphql_config.dart index 374485d08..ae1fd27f3 100644 --- a/lib/services/graphql_config.dart +++ b/lib/services/graphql_config.dart @@ -16,6 +16,12 @@ class GraphqlConfig { static String? token; late HttpLink httpLink; late WebSocketLink webSocketLink; + + GraphqlConfig({required this.httpLink, required this.webSocketLink}); + // httpLink = HttpLink('http://10.0.2.2:4000/graphql'); + // webSocketLink = WebSocketLink("http://10.0.2.2:4000/graphql"); + + //prefix route for showing images String? displayImgRoute; diff --git a/lib/view_model/pre_auth_view_models/select_organization_view_model.dart b/lib/view_model/pre_auth_view_models/select_organization_view_model.dart index e74f702cb..d30bdda38 100644 --- a/lib/view_model/pre_auth_view_models/select_organization_view_model.dart +++ b/lib/view_model/pre_auth_view_models/select_organization_view_model.dart @@ -2,7 +2,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:graphql_flutter/graphql_flutter.dart'; -import 'package:qr_code_scanner/qr_code_scanner.dart'; +// import 'package:qr_code_scanner/qr_code_scanner.dart'; +import 'package:mobile_scanner/mobile_scanner.dart'; import 'package:talawa/constants/routing_constants.dart'; import 'package:talawa/enums/enums.dart'; import 'package:talawa/locator.dart'; diff --git a/lib/view_model/pre_auth_view_models/set_url_view_model.dart b/lib/view_model/pre_auth_view_models/set_url_view_model.dart index 8ed6dc7ac..ff72bfb50 100644 --- a/lib/view_model/pre_auth_view_models/set_url_view_model.dart +++ b/lib/view_model/pre_auth_view_models/set_url_view_model.dart @@ -1,6 +1,9 @@ import 'package:flutter/material.dart'; import 'package:hive/hive.dart'; -import 'package:qr_code_scanner/qr_code_scanner.dart'; +// import 'package:qr_code_scanner/qr_code_scanner.dart'; +import 'package:mobile_scanner/mobile_scanner.dart'; +import 'dart:developer'; + import 'package:qr_flutter/qr_flutter.dart'; import 'package:talawa/constants/app_strings.dart'; import 'package:talawa/enums/enums.dart'; @@ -236,21 +239,67 @@ class SetUrlViewModel extends BaseModel { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ + // SizedBox( + // height: 250, + // width: 250, + // child: QRView( + // key: qrKey, + // onQRViewCreated: _onQRViewCreated, + // overlay: QrScannerOverlayShape( + // borderRadius: 10, + // borderLength: 20, + // borderWidth: 10, + // cutOutSize: 250, + // ), + // /*overlayMargin: EdgeInsets.all(50)*/ + // ), + // ), + SizedBox( height: 250, width: 250, - child: QRView( - key: qrKey, - onQRViewCreated: _onQRViewCreated, - overlay: QrScannerOverlayShape( - borderRadius: 10, - borderLength: 20, - borderWidth: 10, - cutOutSize: 250, - ), - /*overlayMargin: EdgeInsets.all(50)*/ + child: MobileScanner( + fit: BoxFit.contain, + onDetectError: (error, stackTrace) { + debugPrint('On detect Error: $error'); + }, + errorBuilder: (p0, error, p2) { + if (error.errorCode == + MobileScannerErrorCode.permissionDenied) { + log('Camera permission was denied.'); + navigationService.showTalawaErrorSnackBar( + 'The Camera is not working', + MessageType.error, + ); + } else if (error.errorCode == + MobileScannerErrorCode.unsupported) { + log('This device does not support scanning.'); + navigationService.showTalawaErrorSnackBar( + 'Scanning is unsupported on this device', + MessageType.error, + ); + } else { + log('An unknown error occurred: $error'); + navigationService.showTalawaErrorSnackBar( + 'An unknown error occurred', + MessageType.error, + ); + } + return const Text("Something went wrong"); + }, + onDetect: (barcode) { + if (barcode.raw != null && barcode.barcodes.isNotEmpty) { + final String code = + barcode.barcodes.first.displayValue!; + // Handle the scanned QR code here + print('QR Code found: $code'); + } else { + print('Failed to scan QR Code'); + } + }, ), ), + SizedBox( height: SizeConfig.safeBlockVertical! * 4, ), @@ -274,51 +323,101 @@ class SetUrlViewModel extends BaseModel { /// **returns**: /// None - void _onQRViewCreated(QRViewController controller) { - controller.scannedDataStream.listen((scanData) { + void _onQRViewCreated(MobileScannerController controller) { + controller.barcodes.listen((BarcodeCapture scanData) { /// if the scanData is not empty. - if (scanData.code!.isNotEmpty) { - print(scanData.code); - try { - final List data = scanData.code!.split('?'); - url.text = data[0]; - final List queries = data[1].split('&'); - orgId = queries[0].split('=')[1]; - Vibration.vibrate(duration: 100); - controller.stopCamera(); - controller.dispose(); - final box = Hive.box('url'); - box.put(urlKey, url.text); - box.put(imageUrlKey, "${url.text}/talawa/"); - graphqlConfig.getOrgUrl(); - Navigator.pop(navigationService.navigatorKey.currentContext!); - navigationService.pushScreen('/selectOrg', arguments: orgId); - } on CameraException catch (e) { - debugPrint(e.toString()); - navigationService.showTalawaErrorSnackBar( - "The Camera is not working", - MessageType.error, - ); - } on QrEmbeddedImageException catch (e) { - debugPrint(e.toString()); - navigationService.showTalawaErrorDialog( - "The QR is not Working", - MessageType.error, - ); - } on QrUnsupportedVersionException catch (e) { - debugPrint(e.toString()); - navigationService.showTalawaErrorDialog( - "This QR version is not Supported.", - MessageType.error, - ); - } on Exception catch (e) { - debugPrint(e.toString()); - navigationService.showTalawaErrorSnackBar( - "This QR is not for the App", - MessageType.error, - ); - } + if (scanData.barcodes.isNotEmpty) { + final String code = scanData.barcodes.first.displayValue!; + print(code); + // try { + final List data = code.split('?'); + url.text = data[0]; + final List queries = data[1].split('&'); + orgId = queries[0].split('=')[1]; + Vibration.vibrate(duration: 100); + controller.stop(); + controller.dispose(); + final box = Hive.box('url'); + box.put(urlKey, url.text); + box.put(imageUrlKey, "${url.text}/talawa/"); + graphqlConfig.getOrgUrl(); + Navigator.pop(navigationService.navigatorKey.currentContext!); + navigationService.pushScreen('/selectOrg', arguments: orgId); + // } on MobileScannerBarcodeException catch (e) { + // debugPrint(e.toString()); + // navigationService.showTalawaErrorSnackBar( + // "The Camera is not working", + // MessageType.error, + // ); + // } on QrEmbeddedImageException catch (e) { + // debugPrint(e.toString()); + // navigationService.showTalawaErrorDialog( + // "The QR is not Working", + // MessageType.error, + // ); + // } on QrUnsupportedVersionException catch (e) { + // debugPrint(e.toString()); + // navigationService.showTalawaErrorDialog( + // "This QR version is not Supported.", + // MessageType.error, + // ); + // } on Exception catch (e) { + // debugPrint(e.toString()); + // navigationService.showTalawaErrorSnackBar( + // "This QR is not for the App", + // MessageType.error, + // ); + // } + // } } }); + +// void _onQRViewCreated(QRViewController controller) { +// controller.scannedDataStream.listen((scanData) { +// /// if the scanData is not empty. +// if (scanData.code!.isNotEmpty) { +// print(scanData.code); +// try { +// final List data = scanData.code!.split('?'); +// url.text = data[0]; +// final List queries = data[1].split('&'); +// orgId = queries[0].split('=')[1]; +// Vibration.vibrate(duration: 100); +// controller.stopCamera(); +// controller.dispose(); +// final box = Hive.box('url'); +// box.put(urlKey, url.text); +// box.put(imageUrlKey, "${url.text}/talawa/"); +// graphqlConfig.getOrgUrl(); +// Navigator.pop(navigationService.navigatorKey.currentContext!); +// navigationService.pushScreen('/selectOrg', arguments: orgId); +// } on CameraException catch (e) { +// debugPrint(e.toString()); +// navigationService.showTalawaErrorSnackBar( +// "The Camera is not working", +// MessageType.error, +// ); +// } on QrEmbeddedImageException catch (e) { +// debugPrint(e.toString()); +// navigationService.showTalawaErrorDialog( +// "The QR is not Working", +// MessageType.error, +// ); +// } on QrUnsupportedVersionException catch (e) { +// debugPrint(e.toString()); +// navigationService.showTalawaErrorDialog( +// "This QR version is not Supported.", +// MessageType.error, +// ); +// } on Exception catch (e) { +// debugPrint(e.toString()); +// navigationService.showTalawaErrorSnackBar( +// "This QR is not for the App", +// MessageType.error, +// ); +// } +// } +// }); +// } } } diff --git a/lib/views/after_auth_screens/join_org_after_auth/join_organisation_after_auth.dart b/lib/views/after_auth_screens/join_org_after_auth/join_organisation_after_auth.dart index fa519edbb..b852614b5 100644 --- a/lib/views/after_auth_screens/join_org_after_auth/join_organisation_after_auth.dart +++ b/lib/views/after_auth_screens/join_org_after_auth/join_organisation_after_auth.dart @@ -1,6 +1,9 @@ // ignore_for_file: talawa_api_doc, talawa_good_doc_comments import 'package:flutter/material.dart'; -import 'package:qr_code_scanner/qr_code_scanner.dart'; + +import 'dart:developer'; +import 'package:mobile_scanner/mobile_scanner.dart'; +// import 'package:qr_code_scanner/qr_code_scanner.dart'; import 'package:talawa/enums/enums.dart'; import 'package:talawa/locator.dart'; import 'package:talawa/services/graphql_config.dart'; @@ -112,20 +115,66 @@ class JoinOrganisationAfterAuth extends StatelessWidget { SizedBox( height: 250, width: 250, - child: QRView( - key: model.qrKey, - onQRViewCreated: (controller) => - _onQRViewCreated(controller, model), - overlay: QrScannerOverlayShape( - overlayColor: Theme.of(context).colorScheme.secondary, - borderRadius: 10, - borderLength: 20, - borderWidth: 10, - cutOutSize: 250, - ), - /*overlayMargin: EdgeInsets.all(50)*/ + child: MobileScanner( + fit: BoxFit.contain, + onDetectError: (error, stackTrace) { + log('On detect Error: $error'); + }, + errorBuilder: (p0, error, p2) { + if (error.errorCode == + MobileScannerErrorCode.permissionDenied) { + log('Camera permission was denied.'); + navigationService.showTalawaErrorSnackBar( + 'The Camera is not working', + MessageType.error, + ); + } else if (error.errorCode == + MobileScannerErrorCode.unsupported) { + log('This device does not support scanning.'); + navigationService.showTalawaErrorSnackBar( + 'Scanning is unsupported on this device', + MessageType.error, + ); + } else { + log('An unknown error occurred: $error'); + navigationService.showTalawaErrorSnackBar( + 'An unknown error occurred', + MessageType.error, + ); + } + return const Text("Something went wrong"); + }, + onDetect: (barcode) { + if (barcode.raw != null && barcode.barcodes.isNotEmpty) { + final String code = + barcode.barcodes.first.displayValue!; + // Handle the scanned QR code here + print('QR Code found: $code'); + } else { + print('Failed to scan QR Code'); + } + }, ), ), + + + // SizedBox( + // height: 250, + // width: 250, + // child: QRView( + // key: model.qrKey, + // onQRViewCreated: (controller) => + // _onQRViewCreated(controller, model), + // overlay: QrScannerOverlayShape( + // overlayColor: Theme.of(context).colorScheme.secondary, + // borderRadius: 10, + // borderLength: 20, + // borderWidth: 10, + // cutOutSize: 250, + // ), + // /*overlayMargin: EdgeInsets.all(50)*/ + // ), + // ), SizedBox( height: SizeConfig.safeBlockVertical! * 4, ), @@ -152,20 +201,21 @@ class JoinOrganisationAfterAuth extends StatelessWidget { /// **returns**: /// None void _onQRViewCreated( - QRViewController controller, + MobileScannerController controller, SelectOrganizationViewModel model, ) { - controller.scannedDataStream.listen((scanData) { - if (scanData.code!.isNotEmpty) { - print(scanData.code); + controller.barcodes.listen((scanData) { + if (scanData.barcodes.isNotEmpty) { + final String code = scanData.barcodes.first.displayValue!; + print(code); try { - final List data = scanData.code!.split('?'); + final List data = code.split('?'); final String url = data[0]; Vibration.vibrate(duration: 100); if (url == GraphqlConfig.orgURI) { final List queries = data[1].split('&'); model.orgId = queries[0].split('=')[1]; - controller.stopCamera(); + controller.stop(); controller.dispose(); Navigator.pop(navigationService.navigatorKey.currentContext!); model.initialise(model.orgId); diff --git a/pubspec.lock b/pubspec.lock index 81be681f3..2d33d00a8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -495,50 +495,10 @@ packages: dependency: "direct main" description: name: flutter_secure_storage - sha256: "165164745e6afb5c0e3e3fcc72a012fb9e58496fb26ffb92cf22e16a821e85d0" + sha256: "9f3dd2ac3b6875b0fde5b04734789c3ef35ba3965c18e99dd564a7a2f8056df6" url: "https://pub.dev" source: hosted - version: "9.2.2" - flutter_secure_storage_linux: - dependency: transitive - description: - name: flutter_secure_storage_linux - sha256: "4d91bfc23047422cbcd73ac684bc169859ee766482517c22172c86596bf1464b" - url: "https://pub.dev" - source: hosted - version: "1.2.1" - flutter_secure_storage_macos: - dependency: transitive - description: - name: flutter_secure_storage_macos - sha256: "1693ab11121a5f925bbea0be725abfcfbbcf36c1e29e571f84a0c0f436147a81" - url: "https://pub.dev" - source: hosted - version: "3.1.2" - flutter_secure_storage_platform_interface: - dependency: transitive - description: - name: flutter_secure_storage_platform_interface - sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 - url: "https://pub.dev" - source: hosted - version: "1.1.2" - flutter_secure_storage_web: - dependency: transitive - description: - name: flutter_secure_storage_web - sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - flutter_secure_storage_windows: - dependency: transitive - description: - name: flutter_secure_storage_windows - sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709 - url: "https://pub.dev" - source: hosted - version: "3.1.2" + version: "4.2.1" flutter_shaders: dependency: transitive description: @@ -753,18 +713,18 @@ packages: dependency: "direct main" description: name: image_cropper - sha256: f4bad5ed2dfff5a7ce0dfbad545b46a945c702bb6182a921488ef01ba7693111 + sha256: db779a8b620cd509874cb0e2a8bdc8649177f8f5ca46c13273ceaffe071e3f4a url: "https://pub.dev" source: hosted - version: "5.0.1" + version: "6.0.0" image_cropper_for_web: dependency: transitive description: name: image_cropper_for_web - sha256: "865d798b5c9d826f1185b32e5d0018c4183ddb77b7b82a931e1a06aa3b74974e" + sha256: ba67de40a98b3294084eed0b025b557cb594356e1171c9a830b340527dbd5e5f url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "4.0.0" image_cropper_platform_interface: dependency: transitive description: @@ -857,10 +817,10 @@ packages: dependency: transitive description: name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf url: "https://pub.dev" source: hosted - version: "0.6.7" + version: "0.7.1" json_annotation: dependency: "direct main" description: @@ -949,6 +909,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.4" + mobile_scanner: + dependency: "direct main" + description: + name: mobile_scanner + sha256: "728828a798d1a2ee506beb652ca23d974c542c96ed03dcbd5eaf97bef96cdaad" + url: "https://pub.dev" + source: hosted + version: "6.0.2" mockito: dependency: "direct main" description: @@ -1205,14 +1173,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.1" - qr_code_scanner: - dependency: "direct main" - description: - name: qr_code_scanner - sha256: f23b68d893505a424f0bd2e324ebea71ed88465d572d26bb8d2e78a4749591fd - url: "https://pub.dev" - source: hosted - version: "1.0.1" qr_flutter: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index b710b071b..ea8dfac4e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -43,7 +43,7 @@ dependencies: flutter_localizations: sdk: flutter flutter_reaction_button: ^3.0.0+3 - flutter_secure_storage: ^9.2.2 + flutter_secure_storage: ^4.2.1 flutter_speed_dial: ^7.0.0 flutter_svg: ^2.0.16 font_awesome_flutter: ^10.8.0 @@ -51,7 +51,7 @@ dependencies: graphql_flutter: ^5.1.2 hive: ^2.2.3 http: ^1.2.2 - image_cropper: ^5.0.1 + image_cropper: ^6.0.0 image_picker: ^1.1.2 intl: ^0.19.0 json_annotation: ^4.7.0 @@ -62,7 +62,8 @@ dependencies: plugin_platform_interface: ^2.1.7 pointycastle: ^3.9.1 provider: ^6.1.2 - qr_code_scanner: ^1.0.0 + # qr_code_scanner: + mobile_scanner: ^6.0.2 qr_flutter: 4.1.0 quick_actions: ^1.0.8 shared_preferences: ^2.3.3 From b1bb88332e3c7d8a2cc749148eb19f93e3dbdda0 Mon Sep 17 00:00:00 2001 From: MukalDadhwal Date: Fri, 24 Jan 2025 13:02:52 +0530 Subject: [PATCH 2/5] migrated qr_code_scanner to mobile_scanner package --- devtools_options.yaml | 3 + lib/locator.dart | 5 +- .../chats/chat_list_tile_data_model.g.dart | 6 +- lib/services/graphql_config.dart | 4 - lib/services/image_service.dart | 4 - .../set_url_view_model.dart | 180 +- .../join_organisation_after_auth.dart | 157 +- pubspec.lock | 64 +- pubspec.yaml | 7 +- test/helpers/test_helpers.dart | 7 +- test/helpers/test_helpers.mocks.dart | 1690 +++++++++-------- test/service_tests/image_service_test.dart | 8 - .../multi_media_pick_service_test.dart | 8 - .../set_url_view_model_test.dart | 145 +- .../join_organisation_after_auth_test.dart | 96 +- .../pre_auth_screens/set_url_page_test.dart | 5 +- 16 files changed, 1279 insertions(+), 1110 deletions(-) create mode 100644 devtools_options.yaml diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 000000000..fa0b357c4 --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1,3 @@ +description: This file stores settings for Dart & Flutter DevTools. +documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states +extensions: diff --git a/lib/locator.dart b/lib/locator.dart index 429f979d4..5295ba48c 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,6 +1,5 @@ import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:get_it/get_it.dart'; -import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:image_cropper/image_cropper.dart'; import 'package:image_picker/image_picker.dart'; import 'package:talawa/main.dart'; @@ -105,9 +104,7 @@ final actionHandlerService = locator(); Future setupLocator() async { locator.registerSingleton(DataBaseMutationFunctions()); - locator.registerSingleton(GraphqlConfig( - httpLink: HttpLink('http://10.0.2.2:4000/'), - webSocketLink: WebSocketLink("ws://10.0.2.2:4000/graphql/"))); + locator.registerSingleton(GraphqlConfig()); //services locator.registerSingleton(NavigationService()); diff --git a/lib/models/chats/chat_list_tile_data_model.g.dart b/lib/models/chats/chat_list_tile_data_model.g.dart index 200e51549..b50e3025e 100644 --- a/lib/models/chats/chat_list_tile_data_model.g.dart +++ b/lib/models/chats/chat_list_tile_data_model.g.dart @@ -7,8 +7,7 @@ part of 'chat_list_tile_data_model.dart'; // ************************************************************************** ChatListTileDataModel _$ChatListTileDataModelFromJson( - Map json, -) => + Map json) => ChatListTileDataModel( (json['users'] as List?) ?.map((e) => ChatUser.fromJson(e as Map)) @@ -17,8 +16,7 @@ ChatListTileDataModel _$ChatListTileDataModelFromJson( ); Map _$ChatListTileDataModelToJson( - ChatListTileDataModel instance, -) => + ChatListTileDataModel instance) => { 'users': instance.users, 'id': instance.id, diff --git a/lib/services/graphql_config.dart b/lib/services/graphql_config.dart index ae1fd27f3..5d77768ba 100644 --- a/lib/services/graphql_config.dart +++ b/lib/services/graphql_config.dart @@ -16,10 +16,6 @@ class GraphqlConfig { static String? token; late HttpLink httpLink; late WebSocketLink webSocketLink; - - GraphqlConfig({required this.httpLink, required this.webSocketLink}); - // httpLink = HttpLink('http://10.0.2.2:4000/graphql'); - // webSocketLink = WebSocketLink("http://10.0.2.2:4000/graphql"); diff --git a/lib/services/image_service.dart b/lib/services/image_service.dart index b8a2a1a90..daf8ea554 100644 --- a/lib/services/image_service.dart +++ b/lib/services/image_service.dart @@ -29,10 +29,6 @@ class ImageService { try { final CroppedFile? croppedImage = await _imageCropper.cropImage( sourcePath: imageFile.path, - aspectRatioPresets: [ - CropAspectRatioPreset.square, - CropAspectRatioPreset.original, - ], uiSettings: [ AndroidUiSettings( toolbarTitle: 'Crop Image', diff --git a/lib/view_model/pre_auth_view_models/set_url_view_model.dart b/lib/view_model/pre_auth_view_models/set_url_view_model.dart index ff72bfb50..387393b36 100644 --- a/lib/view_model/pre_auth_view_models/set_url_view_model.dart +++ b/lib/view_model/pre_auth_view_models/set_url_view_model.dart @@ -1,10 +1,6 @@ import 'package:flutter/material.dart'; import 'package:hive/hive.dart'; -// import 'package:qr_code_scanner/qr_code_scanner.dart'; import 'package:mobile_scanner/mobile_scanner.dart'; -import 'dart:developer'; - -import 'package:qr_flutter/qr_flutter.dart'; import 'package:talawa/constants/app_strings.dart'; import 'package:talawa/enums/enums.dart'; import 'package:talawa/locator.dart'; @@ -59,6 +55,9 @@ class SetUrlViewModel extends BaseModel { /// qrValidator. AutovalidateMode validate = AutovalidateMode.disabled; + /// qrController. + final MobileScannerController controller = MobileScannerController(); + /// This function initialises the variables. /// /// **params**: @@ -239,64 +238,44 @@ class SetUrlViewModel extends BaseModel { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - // SizedBox( - // height: 250, - // width: 250, - // child: QRView( - // key: qrKey, - // onQRViewCreated: _onQRViewCreated, - // overlay: QrScannerOverlayShape( - // borderRadius: 10, - // borderLength: 20, - // borderWidth: 10, - // cutOutSize: 250, - // ), - // /*overlayMargin: EdgeInsets.all(50)*/ - // ), - // ), - SizedBox( height: 250, width: 250, child: MobileScanner( fit: BoxFit.contain, - onDetectError: (error, stackTrace) { - debugPrint('On detect Error: $error'); - }, - errorBuilder: (p0, error, p2) { - if (error.errorCode == - MobileScannerErrorCode.permissionDenied) { - log('Camera permission was denied.'); - navigationService.showTalawaErrorSnackBar( - 'The Camera is not working', - MessageType.error, - ); - } else if (error.errorCode == - MobileScannerErrorCode.unsupported) { - log('This device does not support scanning.'); - navigationService.showTalawaErrorSnackBar( - 'Scanning is unsupported on this device', - MessageType.error, - ); - } else { - log('An unknown error occurred: $error'); + controller: controller, + errorBuilder: (ctx, error, _) { + String errorMessage = ''; + switch (error.errorCode) { + case MobileScannerErrorCode.controllerUninitialized: + errorMessage = 'camera is not ready'; + break; + case MobileScannerErrorCode.permissionDenied: + errorMessage = + 'Please provide camera permission to scan QR code'; + break; + case MobileScannerErrorCode.unsupported: + errorMessage = + 'This device does not support scanning.'; + break; + default: + errorMessage = 'An unkonwn error occurred'; + } + + WidgetsBinding.instance.addPostFrameCallback((_) { navigationService.showTalawaErrorSnackBar( - 'An unknown error occurred', + errorMessage, MessageType.error, ); - } - return const Text("Something went wrong"); - }, - onDetect: (barcode) { - if (barcode.raw != null && barcode.barcodes.isNotEmpty) { - final String code = - barcode.barcodes.first.displayValue!; - // Handle the scanned QR code here - print('QR Code found: $code'); - } else { - print('Failed to scan QR Code'); - } + }); + + return Center( + child: Text( + errorMessage, + ), + ); }, + onDetect: _onQRViewCreated, ), ), @@ -318,18 +297,15 @@ class SetUrlViewModel extends BaseModel { /// This is the helper function which execute when the on QR view created. /// /// **params**: - /// * `controller`: QRViewController + /// * `scanData`: BarcodeCapture /// /// **returns**: /// None - void _onQRViewCreated(MobileScannerController controller) { - controller.barcodes.listen((BarcodeCapture scanData) { - /// if the scanData is not empty. - if (scanData.barcodes.isNotEmpty) { - final String code = scanData.barcodes.first.displayValue!; - print(code); - // try { + void _onQRViewCreated(BarcodeCapture scanData) { + if (scanData.raw != null && scanData.barcodes.isNotEmpty) { + final String code = scanData.barcodes.first.displayValue!; + try { final List data = code.split('?'); url.text = data[0]; final List queries = data[1].split('&'); @@ -343,81 +319,13 @@ class SetUrlViewModel extends BaseModel { graphqlConfig.getOrgUrl(); Navigator.pop(navigationService.navigatorKey.currentContext!); navigationService.pushScreen('/selectOrg', arguments: orgId); - // } on MobileScannerBarcodeException catch (e) { - // debugPrint(e.toString()); - // navigationService.showTalawaErrorSnackBar( - // "The Camera is not working", - // MessageType.error, - // ); - // } on QrEmbeddedImageException catch (e) { - // debugPrint(e.toString()); - // navigationService.showTalawaErrorDialog( - // "The QR is not Working", - // MessageType.error, - // ); - // } on QrUnsupportedVersionException catch (e) { - // debugPrint(e.toString()); - // navigationService.showTalawaErrorDialog( - // "This QR version is not Supported.", - // MessageType.error, - // ); - // } on Exception catch (e) { - // debugPrint(e.toString()); - // navigationService.showTalawaErrorSnackBar( - // "This QR is not for the App", - // MessageType.error, - // ); - // } - // } + } on Exception catch (e) { + debugPrint(e.toString()); + navigationService.showTalawaErrorSnackBar( + "The Camera is not working", + MessageType.error, + ); } - }); - -// void _onQRViewCreated(QRViewController controller) { -// controller.scannedDataStream.listen((scanData) { -// /// if the scanData is not empty. -// if (scanData.code!.isNotEmpty) { -// print(scanData.code); -// try { -// final List data = scanData.code!.split('?'); -// url.text = data[0]; -// final List queries = data[1].split('&'); -// orgId = queries[0].split('=')[1]; -// Vibration.vibrate(duration: 100); -// controller.stopCamera(); -// controller.dispose(); -// final box = Hive.box('url'); -// box.put(urlKey, url.text); -// box.put(imageUrlKey, "${url.text}/talawa/"); -// graphqlConfig.getOrgUrl(); -// Navigator.pop(navigationService.navigatorKey.currentContext!); -// navigationService.pushScreen('/selectOrg', arguments: orgId); -// } on CameraException catch (e) { -// debugPrint(e.toString()); -// navigationService.showTalawaErrorSnackBar( -// "The Camera is not working", -// MessageType.error, -// ); -// } on QrEmbeddedImageException catch (e) { -// debugPrint(e.toString()); -// navigationService.showTalawaErrorDialog( -// "The QR is not Working", -// MessageType.error, -// ); -// } on QrUnsupportedVersionException catch (e) { -// debugPrint(e.toString()); -// navigationService.showTalawaErrorDialog( -// "This QR version is not Supported.", -// MessageType.error, -// ); -// } on Exception catch (e) { -// debugPrint(e.toString()); -// navigationService.showTalawaErrorSnackBar( -// "This QR is not for the App", -// MessageType.error, -// ); -// } -// } -// }); -// } + } } } diff --git a/lib/views/after_auth_screens/join_org_after_auth/join_organisation_after_auth.dart b/lib/views/after_auth_screens/join_org_after_auth/join_organisation_after_auth.dart index b852614b5..97be010c5 100644 --- a/lib/views/after_auth_screens/join_org_after_auth/join_organisation_after_auth.dart +++ b/lib/views/after_auth_screens/join_org_after_auth/join_organisation_after_auth.dart @@ -1,9 +1,7 @@ // ignore_for_file: talawa_api_doc, talawa_good_doc_comments import 'package:flutter/material.dart'; -import 'dart:developer'; import 'package:mobile_scanner/mobile_scanner.dart'; -// import 'package:qr_code_scanner/qr_code_scanner.dart'; import 'package:talawa/enums/enums.dart'; import 'package:talawa/locator.dart'; import 'package:talawa/services/graphql_config.dart'; @@ -16,17 +14,26 @@ import 'package:talawa/widgets/organization_search_list.dart'; import 'package:vibration/vibration.dart'; /// JoinOrganisationAfterAuth returns a widget for page to join the organization just after user authentication. -class JoinOrganisationAfterAuth extends StatelessWidget { +class JoinOrganisationAfterAuth extends StatefulWidget { const JoinOrganisationAfterAuth({super.key, required this.orgId}); /// org identifier. /// final String orgId; + @override + State createState() => + _JoinOrganisationAfterAuthState(); +} + +class _JoinOrganisationAfterAuthState extends State { + /// qrController. + final MobileScannerController controller = MobileScannerController(); + @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.initialise(orgId), + onModelReady: (model) => model.initialise(widget.orgId), builder: (context, model, child) { return Scaffold( key: const Key('JoinOrgScreen'), @@ -117,64 +124,54 @@ class JoinOrganisationAfterAuth extends StatelessWidget { width: 250, child: MobileScanner( fit: BoxFit.contain, - onDetectError: (error, stackTrace) { - log('On detect Error: $error'); - }, - errorBuilder: (p0, error, p2) { - if (error.errorCode == - MobileScannerErrorCode.permissionDenied) { - log('Camera permission was denied.'); - navigationService.showTalawaErrorSnackBar( - 'The Camera is not working', - MessageType.error, - ); - } else if (error.errorCode == - MobileScannerErrorCode.unsupported) { - log('This device does not support scanning.'); - navigationService.showTalawaErrorSnackBar( - 'Scanning is unsupported on this device', - MessageType.error, - ); - } else { - log('An unknown error occurred: $error'); + controller: controller, + errorBuilder: (ctx, error, _) { + String errorMessage = ''; + switch (error.errorCode) { + case MobileScannerErrorCode.controllerUninitialized: + errorMessage = 'camera is not ready'; + break; + case MobileScannerErrorCode.permissionDenied: + errorMessage = + 'Please provide camera permission to scan QR code'; + break; + case MobileScannerErrorCode.unsupported: + errorMessage = + 'This device does not support scanning.'; + break; + default: + errorMessage = 'An unkonwn error occurred'; + } + + WidgetsBinding.instance.addPostFrameCallback((_) { navigationService.showTalawaErrorSnackBar( - 'An unknown error occurred', + errorMessage, MessageType.error, ); - } - return const Text("Something went wrong"); + }); + + return Center( + child: Text( + errorMessage, + ), + ); }, - onDetect: (barcode) { - if (barcode.raw != null && barcode.barcodes.isNotEmpty) { - final String code = - barcode.barcodes.first.displayValue!; - // Handle the scanned QR code here - print('QR Code found: $code'); - } else { - print('Failed to scan QR Code'); - } + onDetect: (scanData) => _onQRViewCreated(scanData, model), + overlayBuilder: (context, constraints) { + return Container( + width: 250, + height: 250, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + border: Border.all( + color: Theme.of(context).colorScheme.secondary, + width: 10, + ), + ), + ); }, ), ), - - - // SizedBox( - // height: 250, - // width: 250, - // child: QRView( - // key: model.qrKey, - // onQRViewCreated: (controller) => - // _onQRViewCreated(controller, model), - // overlay: QrScannerOverlayShape( - // overlayColor: Theme.of(context).colorScheme.secondary, - // borderRadius: 10, - // borderLength: 20, - // borderWidth: 10, - // cutOutSize: 250, - // ), - // /*overlayMargin: EdgeInsets.all(50)*/ - // ), - // ), SizedBox( height: SizeConfig.safeBlockVertical! * 4, ), @@ -201,35 +198,33 @@ class JoinOrganisationAfterAuth extends StatelessWidget { /// **returns**: /// None void _onQRViewCreated( - MobileScannerController controller, + BarcodeCapture scanData, SelectOrganizationViewModel model, ) { - controller.barcodes.listen((scanData) { - if (scanData.barcodes.isNotEmpty) { - final String code = scanData.barcodes.first.displayValue!; - print(code); - try { - final List data = code.split('?'); - final String url = data[0]; - Vibration.vibrate(duration: 100); - if (url == GraphqlConfig.orgURI) { - final List queries = data[1].split('&'); - model.orgId = queries[0].split('=')[1]; - controller.stop(); - controller.dispose(); - Navigator.pop(navigationService.navigatorKey.currentContext!); - model.initialise(model.orgId); - } else { - navigationService.showTalawaErrorSnackBar( - "Organisation on different server, logout and scan qr again", - MessageType.error, - ); - } - } on Exception catch (e) { - print(e); - print('invalid app qr'); + if (scanData.raw != null && scanData.barcodes.isNotEmpty) { + final String code = scanData.barcodes.first.displayValue!; + print(code); + try { + final List data = code.split('?'); + final String url = data[0]; + Vibration.vibrate(duration: 100); + if (url == GraphqlConfig.orgURI) { + final List queries = data[1].split('&'); + model.orgId = queries[0].split('=')[1]; + controller.stop(); + controller.dispose(); + Navigator.pop(navigationService.navigatorKey.currentContext!); + model.initialise(model.orgId); + } else { + navigationService.showTalawaErrorSnackBar( + "Organisation on different server, logout and scan qr again", + MessageType.error, + ); } + } on Exception catch (e) { + print(e); + print('invalid app qr'); } - }); + } } } diff --git a/pubspec.lock b/pubspec.lock index 2d33d00a8..a66738058 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -495,10 +495,50 @@ packages: dependency: "direct main" description: name: flutter_secure_storage - sha256: "9f3dd2ac3b6875b0fde5b04734789c3ef35ba3965c18e99dd564a7a2f8056df6" + sha256: "9cad52d75ebc511adfae3d447d5d13da15a55a92c9410e50f67335b6d21d16ea" url: "https://pub.dev" source: hosted - version: "4.2.1" + version: "9.2.4" + flutter_secure_storage_linux: + dependency: transitive + description: + name: flutter_secure_storage_linux + sha256: bf7404619d7ab5c0a1151d7c4e802edad8f33535abfbeff2f9e1fe1274e2d705 + url: "https://pub.dev" + source: hosted + version: "1.2.2" + flutter_secure_storage_macos: + dependency: transitive + description: + name: flutter_secure_storage_macos + sha256: "6c0a2795a2d1de26ae202a0d78527d163f4acbb11cde4c75c670f3a0fc064247" + url: "https://pub.dev" + source: hosted + version: "3.1.3" + flutter_secure_storage_platform_interface: + dependency: transitive + description: + name: flutter_secure_storage_platform_interface + sha256: cf91ad32ce5adef6fba4d736a542baca9daf3beac4db2d04be350b87f69ac4a8 + url: "https://pub.dev" + source: hosted + version: "1.1.2" + flutter_secure_storage_web: + dependency: transitive + description: + name: flutter_secure_storage_web + sha256: f4ebff989b4f07b2656fb16b47852c0aab9fed9b4ec1c70103368337bc1886a9 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + flutter_secure_storage_windows: + dependency: transitive + description: + name: flutter_secure_storage_windows + sha256: b20b07cb5ed4ed74fc567b78a72936203f587eba460af1df11281c9326cd3709 + url: "https://pub.dev" + source: hosted + version: "3.1.2" flutter_shaders: dependency: transitive description: @@ -713,26 +753,26 @@ packages: dependency: "direct main" description: name: image_cropper - sha256: db779a8b620cd509874cb0e2a8bdc8649177f8f5ca46c13273ceaffe071e3f4a + sha256: "41617c3b0ede2f398021b3b76d5e1a94cced0d52207cad1c718a9cf24a76c99d" url: "https://pub.dev" source: hosted - version: "6.0.0" + version: "8.0.0" image_cropper_for_web: dependency: transitive description: name: image_cropper_for_web - sha256: ba67de40a98b3294084eed0b025b557cb594356e1171c9a830b340527dbd5e5f + sha256: "34256c8fb7fcb233251787c876bb37271744459b593a948a2db73caa323034d0" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "6.0.2" image_cropper_platform_interface: dependency: transitive description: name: image_cropper_platform_interface - sha256: ee160d686422272aa306125f3b6fb1c1894d9b87a5e20ed33fa008e7285da11e + sha256: e8e9d2ca36360387aee39295ce49029362ae4df3071f23e8e71f2b81e40b7531 url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "7.0.0" image_picker: dependency: "direct main" description: @@ -817,10 +857,10 @@ packages: dependency: transitive description: name: js - sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.7.1" + version: "0.6.7" json_annotation: dependency: "direct main" description: @@ -913,10 +953,10 @@ packages: dependency: "direct main" description: name: mobile_scanner - sha256: "728828a798d1a2ee506beb652ca23d974c542c96ed03dcbd5eaf97bef96cdaad" + sha256: "57d6269d10912d5d583606b46d963d7c5d0299d2c37add8b7192dd769d40a319" url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "6.0.3" mockito: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index ea8dfac4e..38618fba7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -43,7 +43,7 @@ dependencies: flutter_localizations: sdk: flutter flutter_reaction_button: ^3.0.0+3 - flutter_secure_storage: ^4.2.1 + flutter_secure_storage: ^9.2.2 flutter_speed_dial: ^7.0.0 flutter_svg: ^2.0.16 font_awesome_flutter: ^10.8.0 @@ -51,10 +51,11 @@ dependencies: graphql_flutter: ^5.1.2 hive: ^2.2.3 http: ^1.2.2 - image_cropper: ^6.0.0 + image_cropper: 8.0.0 image_picker: ^1.1.2 intl: ^0.19.0 json_annotation: ^4.7.0 + mobile_scanner: ^6.0.2 mockito: ^5.4.4 network_image_mock: ^2.1.1 path_provider: ^2.1.5 @@ -62,8 +63,6 @@ dependencies: plugin_platform_interface: ^2.1.7 pointycastle: ^3.9.1 provider: ^6.1.2 - # qr_code_scanner: - mobile_scanner: ^6.0.2 qr_flutter: 4.1.0 quick_actions: ^1.0.8 shared_preferences: ^2.3.3 diff --git a/test/helpers/test_helpers.dart b/test/helpers/test_helpers.dart index f8e453385..cd97c136b 100644 --- a/test/helpers/test_helpers.dart +++ b/test/helpers/test_helpers.dart @@ -1,12 +1,13 @@ import 'dart:async'; + import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter/material.dart'; import 'package:graphql_flutter/graphql_flutter.dart'; import 'package:image_cropper/image_cropper.dart'; import 'package:image_picker/image_picker.dart'; +import 'package:mobile_scanner/mobile_scanner.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; -import 'package:qr_code_scanner/qr_code_scanner.dart'; import 'package:talawa/enums/enums.dart'; import 'package:talawa/locator.dart'; import 'package:talawa/models/chats/chat_list_tile_data_model.dart'; @@ -86,7 +87,9 @@ import 'test_helpers.mocks.dart'; onMissingStub: OnMissingStub.returnDefault, ), MockSpec(onMissingStub: OnMissingStub.returnDefault), - MockSpec(onMissingStub: OnMissingStub.returnDefault), + MockSpec( + onMissingStub: OnMissingStub.returnDefault, + ), MockSpec(onMissingStub: OnMissingStub.returnDefault), MockSpec(onMissingStub: OnMissingStub.returnDefault), MockSpec(onMissingStub: OnMissingStub.returnDefault), diff --git a/test/helpers/test_helpers.mocks.dart b/test/helpers/test_helpers.mocks.dart index 417efbb51..7e3eb492b 100644 --- a/test/helpers/test_helpers.mocks.dart +++ b/test/helpers/test_helpers.mocks.dart @@ -3,55 +3,58 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; -import 'dart:io' as _i20; +import 'dart:async' as _i6; +import 'dart:io' as _i21; import 'dart:ui' as _i10; import 'package:flutter/material.dart' as _i1; +import 'package:flutter_secure_storage/flutter_secure_storage.dart' as _i11; import 'package:graphql_flutter/graphql_flutter.dart' as _i3; -import 'package:image_cropper/src/cropper.dart' as _i41; +import 'package:image_cropper/src/cropper.dart' as _i44; import 'package:image_cropper_platform_interface/image_cropper_platform_interface.dart' - as _i42; -import 'package:image_picker/image_picker.dart' as _i13; + as _i45; +import 'package:image_picker/image_picker.dart' as _i14; +import 'package:mobile_scanner/src/enums/barcode_format.dart' as _i37; +import 'package:mobile_scanner/src/enums/camera_facing.dart' as _i36; +import 'package:mobile_scanner/src/enums/detection_speed.dart' as _i35; +import 'package:mobile_scanner/src/mobile_scanner_controller.dart' as _i34; +import 'package:mobile_scanner/src/objects/barcode_capture.dart' as _i38; +import 'package:mobile_scanner/src/objects/mobile_scanner_state.dart' as _i13; import 'package:mockito/mockito.dart' as _i2; -import 'package:mockito/src/dummies.dart' as _i18; -import 'package:qr_code_scanner/src/qr_code_scanner.dart' as _i33; -import 'package:qr_code_scanner/src/types/barcode.dart' as _i34; -import 'package:qr_code_scanner/src/types/camera.dart' as _i35; -import 'package:qr_code_scanner/src/types/features.dart' as _i12; -import 'package:talawa/enums/enums.dart' as _i14; -import 'package:talawa/models/chats/chat_list_tile_data_model.dart' as _i24; -import 'package:talawa/models/chats/chat_message.dart' as _i25; -import 'package:talawa/models/events/event_model.dart' as _i21; -import 'package:talawa/models/events/event_venue.dart' as _i39; -import 'package:talawa/models/events/event_volunteer_group.dart' as _i22; -import 'package:talawa/models/organization/org_info.dart' as _i6; -import 'package:talawa/models/post/post_model.dart' as _i17; +import 'package:mockito/src/dummies.dart' as _i19; +import 'package:talawa/enums/enums.dart' as _i15; +import 'package:talawa/models/chats/chat_list_tile_data_model.dart' as _i25; +import 'package:talawa/models/chats/chat_message.dart' as _i26; +import 'package:talawa/models/events/event_model.dart' as _i22; +import 'package:talawa/models/events/event_venue.dart' as _i42; +import 'package:talawa/models/events/event_volunteer_group.dart' as _i23; +import 'package:talawa/models/organization/org_info.dart' as _i5; +import 'package:talawa/models/post/post_model.dart' as _i18; import 'package:talawa/models/user/user_info.dart' as _i7; -import 'package:talawa/services/chat_service.dart' as _i23; -import 'package:talawa/services/comment_service.dart' as _i36; +import 'package:talawa/services/chat_service.dart' as _i24; +import 'package:talawa/services/comment_service.dart' as _i39; import 'package:talawa/services/database_mutation_functions.dart' as _i9; -import 'package:talawa/services/event_service.dart' as _i11; -import 'package:talawa/services/graphql_config.dart' as _i15; +import 'package:talawa/services/event_service.dart' as _i12; +import 'package:talawa/services/graphql_config.dart' as _i16; import 'package:talawa/services/navigation_service.dart' as _i8; -import 'package:talawa/services/org_service.dart' as _i29; -import 'package:talawa/services/post_service.dart' as _i16; +import 'package:talawa/services/org_service.dart' as _i30; +import 'package:talawa/services/post_service.dart' as _i17; import 'package:talawa/services/third_party_service/multi_media_pick_service.dart' - as _i19; -import 'package:talawa/services/user_config.dart' as _i26; -import 'package:talawa/utils/validators.dart' as _i32; + as _i20; +import 'package:talawa/services/user_config.dart' as _i27; +import 'package:talawa/utils/validators.dart' as _i33; import 'package:talawa/view_model/after_auth_view_models/chat_view_models/direct_chat_view_model.dart' - as _i40; + as _i43; import 'package:talawa/view_model/after_auth_view_models/event_view_models/create_event_view_model.dart' - as _i38; + as _i41; import 'package:talawa/view_model/after_auth_view_models/event_view_models/explore_events_view_model.dart' - as _i30; -import 'package:talawa/view_model/after_auth_view_models/feed_view_models/organization_feed_view_model.dart' as _i31; -import 'package:talawa/view_model/lang_view_model.dart' as _i27; +import 'package:talawa/view_model/after_auth_view_models/feed_view_models/organization_feed_view_model.dart' + as _i32; +import 'package:talawa/view_model/lang_view_model.dart' as _i28; import 'package:talawa/view_model/pre_auth_view_models/signup_details_view_model.dart' - as _i28; -import 'package:talawa/view_model/theme_view_model.dart' as _i37; + as _i29; +import 'package:talawa/view_model/theme_view_model.dart' as _i40; import 'package:talawa/widgets/custom_alert_dialog.dart' as _i4; // ignore_for_file: type=lint @@ -186,9 +189,8 @@ class _FakeCustomAlertDialog_10 extends _i2.SmartFake super.toString(); } -class _FakeStreamController_11 extends _i2.SmartFake - implements _i5.StreamController { - _FakeStreamController_11( +class _FakeOrgInfo_11 extends _i2.SmartFake implements _i5.OrgInfo { + _FakeOrgInfo_11( Object parent, Invocation parentInvocation, ) : super( @@ -197,8 +199,9 @@ class _FakeStreamController_11 extends _i2.SmartFake ); } -class _FakeOrgInfo_12 extends _i2.SmartFake implements _i6.OrgInfo { - _FakeOrgInfo_12( +class _FakeStreamController_12 extends _i2.SmartFake + implements _i6.StreamController { + _FakeStreamController_12( Object parent, Invocation parentInvocation, ) : super( @@ -249,9 +252,20 @@ class _FakeLocale_16 extends _i2.SmartFake implements _i10.Locale { ); } -class _FakeTextEditingController_17 extends _i2.SmartFake +class _FakeFlutterSecureStorage_17 extends _i2.SmartFake + implements _i11.FlutterSecureStorage { + _FakeFlutterSecureStorage_17( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeTextEditingController_18 extends _i2.SmartFake implements _i1.TextEditingController { - _FakeTextEditingController_17( + _FakeTextEditingController_18( Object parent, Invocation parentInvocation, ) : super( @@ -260,8 +274,8 @@ class _FakeTextEditingController_17 extends _i2.SmartFake ); } -class _FakeFocusNode_18 extends _i2.SmartFake implements _i1.FocusNode { - _FakeFocusNode_18( +class _FakeFocusNode_19 extends _i2.SmartFake implements _i1.FocusNode { + _FakeFocusNode_19( Object parent, Invocation parentInvocation, ) : super( @@ -274,8 +288,8 @@ class _FakeFocusNode_18 extends _i2.SmartFake implements _i1.FocusNode { super.toString(); } -class _FakeEventService_19 extends _i2.SmartFake implements _i11.EventService { - _FakeEventService_19( +class _FakeEventService_20 extends _i2.SmartFake implements _i12.EventService { + _FakeEventService_20( Object parent, Invocation parentInvocation, ) : super( @@ -284,9 +298,9 @@ class _FakeEventService_19 extends _i2.SmartFake implements _i11.EventService { ); } -class _FakeSystemFeatures_20 extends _i2.SmartFake - implements _i12.SystemFeatures { - _FakeSystemFeatures_20( +class _FakeMobileScannerState_21 extends _i2.SmartFake + implements _i13.MobileScannerState { + _FakeMobileScannerState_21( Object parent, Invocation parentInvocation, ) : super( @@ -295,8 +309,8 @@ class _FakeSystemFeatures_20 extends _i2.SmartFake ); } -class _FakeThemeData_21 extends _i2.SmartFake implements _i1.ThemeData { - _FakeThemeData_21( +class _FakeWidget_22 extends _i2.SmartFake implements _i1.Widget { + _FakeWidget_22( Object parent, Invocation parentInvocation, ) : super( @@ -309,18 +323,22 @@ class _FakeThemeData_21 extends _i2.SmartFake implements _i1.ThemeData { super.toString(); } -class _FakeTimeOfDay_22 extends _i2.SmartFake implements _i1.TimeOfDay { - _FakeTimeOfDay_22( +class _FakeThemeData_23 extends _i2.SmartFake implements _i1.ThemeData { + _FakeThemeData_23( Object parent, Invocation parentInvocation, ) : super( parent, parentInvocation, ); + + @override + String toString({_i1.DiagnosticLevel? minLevel = _i1.DiagnosticLevel.info}) => + super.toString(); } -class _FakeDateTime_23 extends _i2.SmartFake implements DateTime { - _FakeDateTime_23( +class _FakeTimeOfDay_24 extends _i2.SmartFake implements _i1.TimeOfDay { + _FakeTimeOfDay_24( Object parent, Invocation parentInvocation, ) : super( @@ -329,9 +347,19 @@ class _FakeDateTime_23 extends _i2.SmartFake implements DateTime { ); } -class _FakeLostDataResponse_24 extends _i2.SmartFake - implements _i13.LostDataResponse { - _FakeLostDataResponse_24( +class _FakeDateTime_25 extends _i2.SmartFake implements DateTime { + _FakeDateTime_25( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeLostDataResponse_26 extends _i2.SmartFake + implements _i14.LostDataResponse { + _FakeLostDataResponse_26( Object parent, Invocation parentInvocation, ) : super( @@ -368,7 +396,7 @@ class MockNavigationService extends _i2.Mock implements _i8.NavigationService { ); @override - _i5.Future pushScreen( + _i6.Future pushScreen( String? routeName, { dynamic arguments, }) => @@ -378,12 +406,12 @@ class MockNavigationService extends _i2.Mock implements _i8.NavigationService { [routeName], {#arguments: arguments}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future popAndPushScreen( + _i6.Future popAndPushScreen( String? routeName, { dynamic arguments, }) => @@ -393,12 +421,12 @@ class MockNavigationService extends _i2.Mock implements _i8.NavigationService { [routeName], {#arguments: arguments}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future pushReplacementScreen( + _i6.Future pushReplacementScreen( String? routeName, { dynamic arguments, }) => @@ -408,12 +436,12 @@ class MockNavigationService extends _i2.Mock implements _i8.NavigationService { [routeName], {#arguments: arguments}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future removeAllAndPush( + _i6.Future removeAllAndPush( String? routeName, String? tillRoute, { dynamic arguments, @@ -427,9 +455,9 @@ class MockNavigationService extends _i2.Mock implements _i8.NavigationService { ], {#arguments: arguments}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override void pushDialog(_i1.Widget? dialog) => super.noSuchMethod( @@ -457,7 +485,7 @@ class MockNavigationService extends _i2.Mock implements _i8.NavigationService { @override void showTalawaErrorSnackBar( String? errorMessage, - _i14.MessageType? messageType, + _i15.MessageType? messageType, ) => super.noSuchMethod( Invocation.method( @@ -473,7 +501,7 @@ class MockNavigationService extends _i2.Mock implements _i8.NavigationService { @override void showTalawaErrorDialog( String? errorMessage, - _i14.MessageType? messageType, + _i15.MessageType? messageType, ) => super.noSuchMethod( Invocation.method( @@ -517,7 +545,7 @@ class MockNavigationService extends _i2.Mock implements _i8.NavigationService { /// A class which mocks [GraphqlConfig]. /// /// See the documentation for Mockito's code generation for more information. -class MockGraphqlConfig extends _i2.Mock implements _i15.GraphqlConfig { +class MockGraphqlConfig extends _i2.Mock implements _i16.GraphqlConfig { @override _i3.HttpLink get httpLink => (super.noSuchMethod( Invocation.getter(#httpLink), @@ -572,14 +600,14 @@ class MockGraphqlConfig extends _i2.Mock implements _i15.GraphqlConfig { ); @override - _i5.Future getToken() => (super.noSuchMethod( + _i6.Future getToken() => (super.noSuchMethod( Invocation.method( #getToken, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override void getOrgUrl() => super.noSuchMethod( @@ -814,14 +842,14 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { ) as _i3.ObservableQuery); @override - _i5.Future<_i3.QueryResult> query( + _i6.Future<_i3.QueryResult> query( _i3.QueryOptions? options) => (super.noSuchMethod( Invocation.method( #query, [options], ), - returnValue: _i5.Future<_i3.QueryResult>.value( + returnValue: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -829,7 +857,7 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { [options], ), )), - returnValueForMissingStub: _i5.Future<_i3.QueryResult>.value( + returnValueForMissingStub: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -837,17 +865,17 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { [options], ), )), - ) as _i5.Future<_i3.QueryResult>); + ) as _i6.Future<_i3.QueryResult>); @override - _i5.Future<_i3.QueryResult> mutate( + _i6.Future<_i3.QueryResult> mutate( _i3.MutationOptions? options) => (super.noSuchMethod( Invocation.method( #mutate, [options], ), - returnValue: _i5.Future<_i3.QueryResult>.value( + returnValue: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -855,7 +883,7 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { [options], ), )), - returnValueForMissingStub: _i5.Future<_i3.QueryResult>.value( + returnValueForMissingStub: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -863,22 +891,22 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { [options], ), )), - ) as _i5.Future<_i3.QueryResult>); + ) as _i6.Future<_i3.QueryResult>); @override - _i5.Stream<_i3.QueryResult> subscribe( + _i6.Stream<_i3.QueryResult> subscribe( _i3.SubscriptionOptions? options) => (super.noSuchMethod( Invocation.method( #subscribe, [options], ), - returnValue: _i5.Stream<_i3.QueryResult>.empty(), - returnValueForMissingStub: _i5.Stream<_i3.QueryResult>.empty(), - ) as _i5.Stream<_i3.QueryResult>); + returnValue: _i6.Stream<_i3.QueryResult>.empty(), + returnValueForMissingStub: _i6.Stream<_i3.QueryResult>.empty(), + ) as _i6.Stream<_i3.QueryResult>); @override - _i5.Future<_i3.QueryResult> fetchMore( + _i6.Future<_i3.QueryResult> fetchMore( _i3.FetchMoreOptions? fetchMoreOptions, { required _i3.QueryOptions? originalOptions, required _i3.QueryResult? previousResult, @@ -892,7 +920,7 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { #previousResult: previousResult, }, ), - returnValue: _i5.Future<_i3.QueryResult>.value( + returnValue: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -904,7 +932,7 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { }, ), )), - returnValueForMissingStub: _i5.Future<_i3.QueryResult>.value( + returnValueForMissingStub: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -916,7 +944,7 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { }, ), )), - ) as _i5.Future<_i3.QueryResult>); + ) as _i6.Future<_i3.QueryResult>); @override Map? readQuery( @@ -983,7 +1011,7 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { ); @override - _i5.Future?>>? resetStore( + _i6.Future?>>? resetStore( {bool? refetchQueries = true}) => (super.noSuchMethod( Invocation.method( @@ -992,13 +1020,13 @@ class MockGraphQLClient extends _i2.Mock implements _i3.GraphQLClient { {#refetchQueries: refetchQueries}, ), returnValueForMissingStub: null, - ) as _i5.Future?>>?); + ) as _i6.Future?>>?); } /// A class which mocks [PostService]. /// /// See the documentation for Mockito's code generation for more information. -class MockPostService extends _i2.Mock implements _i16.PostService { +class MockPostService extends _i2.Mock implements _i17.PostService { @override set postInfo(Map? _postInfo) => super.noSuchMethod( Invocation.setter( @@ -1045,42 +1073,42 @@ class MockPostService extends _i2.Mock implements _i16.PostService { ); @override - _i5.Stream> get postStream => (super.noSuchMethod( + _i6.Stream> get postStream => (super.noSuchMethod( Invocation.getter(#postStream), - returnValue: _i5.Stream>.empty(), - returnValueForMissingStub: _i5.Stream>.empty(), - ) as _i5.Stream>); + returnValue: _i6.Stream>.empty(), + returnValueForMissingStub: _i6.Stream>.empty(), + ) as _i6.Stream>); @override - _i5.Stream<_i17.Post> get updatedPostStream => (super.noSuchMethod( + _i6.Stream<_i18.Post> get updatedPostStream => (super.noSuchMethod( Invocation.getter(#updatedPostStream), - returnValue: _i5.Stream<_i17.Post>.empty(), - returnValueForMissingStub: _i5.Stream<_i17.Post>.empty(), - ) as _i5.Stream<_i17.Post>); + returnValue: _i6.Stream<_i18.Post>.empty(), + returnValueForMissingStub: _i6.Stream<_i18.Post>.empty(), + ) as _i6.Stream<_i18.Post>); @override String get cacheKey => (super.noSuchMethod( Invocation.getter(#cacheKey), - returnValue: _i18.dummyValue( + returnValue: _i19.dummyValue( this, Invocation.getter(#cacheKey), ), - returnValueForMissingStub: _i18.dummyValue( + returnValueForMissingStub: _i19.dummyValue( this, Invocation.getter(#cacheKey), ), ) as String); @override - _i5.Future> fetchDataFromApi() => (super.noSuchMethod( + _i6.Future> fetchDataFromApi() => (super.noSuchMethod( Invocation.method( #fetchDataFromApi, [], ), - returnValue: _i5.Future>.value(<_i17.Post>[]), + returnValue: _i6.Future>.value(<_i18.Post>[]), returnValueForMissingStub: - _i5.Future>.value(<_i17.Post>[]), - ) as _i5.Future>); + _i6.Future>.value(<_i18.Post>[]), + ) as _i6.Future>); @override void setOrgStreamSubscription() => super.noSuchMethod( @@ -1092,37 +1120,37 @@ class MockPostService extends _i2.Mock implements _i16.PostService { ); @override - _i5.Future fetchPostsInitial() => (super.noSuchMethod( + _i6.Future fetchPostsInitial() => (super.noSuchMethod( Invocation.method( #fetchPostsInitial, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future getPosts() => (super.noSuchMethod( + _i6.Future getPosts() => (super.noSuchMethod( Invocation.method( #getPosts, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future refreshFeed() => (super.noSuchMethod( + _i6.Future refreshFeed() => (super.noSuchMethod( Invocation.method( #refreshFeed, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - void addNewpost(_i17.Post? newPost) => super.noSuchMethod( + void addNewpost(_i18.Post? newPost) => super.noSuchMethod( Invocation.method( #addNewpost, [newPost], @@ -1131,13 +1159,13 @@ class MockPostService extends _i2.Mock implements _i16.PostService { ); @override - _i5.Future<_i3.QueryResult> deletePost(_i17.Post? post) => + _i6.Future<_i3.QueryResult> deletePost(_i18.Post? post) => (super.noSuchMethod( Invocation.method( #deletePost, [post], ), - returnValue: _i5.Future<_i3.QueryResult>.value( + returnValue: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -1145,7 +1173,7 @@ class MockPostService extends _i2.Mock implements _i16.PostService { [post], ), )), - returnValueForMissingStub: _i5.Future<_i3.QueryResult>.value( + returnValueForMissingStub: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -1153,27 +1181,27 @@ class MockPostService extends _i2.Mock implements _i16.PostService { [post], ), )), - ) as _i5.Future<_i3.QueryResult>); + ) as _i6.Future<_i3.QueryResult>); @override - _i5.Future addLike(String? postID) => (super.noSuchMethod( + _i6.Future addLike(String? postID) => (super.noSuchMethod( Invocation.method( #addLike, [postID], ), - returnValue: _i5.Future.value(false), - returnValueForMissingStub: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i6.Future.value(false), + returnValueForMissingStub: _i6.Future.value(false), + ) as _i6.Future); @override - _i5.Future removeLike(String? postID) => (super.noSuchMethod( + _i6.Future removeLike(String? postID) => (super.noSuchMethod( Invocation.method( #removeLike, [postID], ), - returnValue: _i5.Future.value(false), - returnValueForMissingStub: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i6.Future.value(false), + returnValueForMissingStub: _i6.Future.value(false), + ) as _i6.Future); @override void addCommentLocally(String? postID) => super.noSuchMethod( @@ -1185,83 +1213,83 @@ class MockPostService extends _i2.Mock implements _i16.PostService { ); @override - _i5.Future nextPage() => (super.noSuchMethod( + _i6.Future nextPage() => (super.noSuchMethod( Invocation.method( #nextPage, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future previousPage() => (super.noSuchMethod( + _i6.Future previousPage() => (super.noSuchMethod( Invocation.method( #previousPage, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future> loadCachedData() => (super.noSuchMethod( + _i6.Future> loadCachedData() => (super.noSuchMethod( Invocation.method( #loadCachedData, [], ), - returnValue: _i5.Future>.value(<_i17.Post>[]), + returnValue: _i6.Future>.value(<_i18.Post>[]), returnValueForMissingStub: - _i5.Future>.value(<_i17.Post>[]), - ) as _i5.Future>); + _i6.Future>.value(<_i18.Post>[]), + ) as _i6.Future>); @override - _i5.Future saveDataToCache(List<_i17.Post>? data) => + _i6.Future saveDataToCache(List<_i18.Post>? data) => (super.noSuchMethod( Invocation.method( #saveDataToCache, [data], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future> getNewFeedAndRefreshCache() => + _i6.Future> getNewFeedAndRefreshCache() => (super.noSuchMethod( Invocation.method( #getNewFeedAndRefreshCache, [], ), - returnValue: _i5.Future>.value(<_i17.Post>[]), + returnValue: _i6.Future>.value(<_i18.Post>[]), returnValueForMissingStub: - _i5.Future>.value(<_i17.Post>[]), - ) as _i5.Future>); + _i6.Future>.value(<_i18.Post>[]), + ) as _i6.Future>); } /// A class which mocks [MultiMediaPickerService]. /// /// See the documentation for Mockito's code generation for more information. class MockMultiMediaPickerService extends _i2.Mock - implements _i19.MultiMediaPickerService { + implements _i20.MultiMediaPickerService { @override - _i5.Stream get fileStream => (super.noSuchMethod( + _i6.Stream get fileStream => (super.noSuchMethod( Invocation.getter(#fileStream), - returnValue: _i5.Stream.empty(), - returnValueForMissingStub: _i5.Stream.empty(), - ) as _i5.Stream); + returnValue: _i6.Stream.empty(), + returnValueForMissingStub: _i6.Stream.empty(), + ) as _i6.Stream); @override - _i5.Future<_i20.File?> getPhotoFromGallery({bool? camera = false}) => + _i6.Future<_i21.File?> getPhotoFromGallery({bool? camera = false}) => (super.noSuchMethod( Invocation.method( #getPhotoFromGallery, [], {#camera: camera}, ), - returnValue: _i5.Future<_i20.File?>.value(), - returnValueForMissingStub: _i5.Future<_i20.File?>.value(), - ) as _i5.Future<_i20.File?>); + returnValue: _i6.Future<_i21.File?>.value(), + returnValueForMissingStub: _i6.Future<_i21.File?>.value(), + ) as _i6.Future<_i21.File?>); @override _i4.CustomAlertDialog permissionDeniedDialog() => (super.noSuchMethod( @@ -1289,57 +1317,70 @@ class MockMultiMediaPickerService extends _i2.Mock /// A class which mocks [EventService]. /// /// See the documentation for Mockito's code generation for more information. -class MockEventService extends _i2.Mock implements _i11.EventService { +class MockEventService extends _i2.Mock implements _i12.EventService { @override - _i5.Stream> get eventStream => (super.noSuchMethod( + _i6.Stream> get eventStream => (super.noSuchMethod( Invocation.getter(#eventStream), - returnValue: _i5.Stream>.empty(), - returnValueForMissingStub: _i5.Stream>.empty(), - ) as _i5.Stream>); + returnValue: _i6.Stream>.empty(), + returnValueForMissingStub: _i6.Stream>.empty(), + ) as _i6.Stream>); + + @override + _i5.OrgInfo get currentOrg => (super.noSuchMethod( + Invocation.getter(#currentOrg), + returnValue: _FakeOrgInfo_11( + this, + Invocation.getter(#currentOrg), + ), + returnValueForMissingStub: _FakeOrgInfo_11( + this, + Invocation.getter(#currentOrg), + ), + ) as _i5.OrgInfo); @override String get cacheKey => (super.noSuchMethod( Invocation.getter(#cacheKey), - returnValue: _i18.dummyValue( + returnValue: _i19.dummyValue( this, Invocation.getter(#cacheKey), ), - returnValueForMissingStub: _i18.dummyValue( + returnValueForMissingStub: _i19.dummyValue( this, Invocation.getter(#cacheKey), ), ) as String); @override - _i5.Future> fetchDataFromApi() => (super.noSuchMethod( + _i6.Future> fetchDataFromApi() => (super.noSuchMethod( Invocation.method( #fetchDataFromApi, [], ), - returnValue: _i5.Future>.value(<_i21.Event>[]), + returnValue: _i6.Future>.value(<_i22.Event>[]), returnValueForMissingStub: - _i5.Future>.value(<_i21.Event>[]), - ) as _i5.Future>); + _i6.Future>.value(<_i22.Event>[]), + ) as _i6.Future>); @override - _i5.Future fetchEventsInitial() => (super.noSuchMethod( + _i6.Future fetchEventsInitial() => (super.noSuchMethod( Invocation.method( #fetchEventsInitial, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future refreshFeed() => (super.noSuchMethod( + _i6.Future refreshFeed() => (super.noSuchMethod( Invocation.method( #refreshFeed, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override void setOrgStreamSubscription() => super.noSuchMethod( @@ -1351,7 +1392,7 @@ class MockEventService extends _i2.Mock implements _i11.EventService { ); @override - _i5.Future<_i3.QueryResult> createEvent( + _i6.Future<_i3.QueryResult> createEvent( {required Map? variables}) => (super.noSuchMethod( Invocation.method( @@ -1359,7 +1400,7 @@ class MockEventService extends _i2.Mock implements _i11.EventService { [], {#variables: variables}, ), - returnValue: _i5.Future<_i3.QueryResult>.value( + returnValue: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -1368,7 +1409,7 @@ class MockEventService extends _i2.Mock implements _i11.EventService { {#variables: variables}, ), )), - returnValueForMissingStub: _i5.Future<_i3.QueryResult>.value( + returnValueForMissingStub: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -1377,48 +1418,48 @@ class MockEventService extends _i2.Mock implements _i11.EventService { {#variables: variables}, ), )), - ) as _i5.Future<_i3.QueryResult>); + ) as _i6.Future<_i3.QueryResult>); @override - _i5.Future getEvents() => (super.noSuchMethod( + _i6.Future getEvents() => (super.noSuchMethod( Invocation.method( #getEvents, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future fetchAttendeesByEvent(String? eventId) => + _i6.Future fetchAttendeesByEvent(String? eventId) => (super.noSuchMethod( Invocation.method( #fetchAttendeesByEvent, [eventId], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future registerForAnEvent(String? eventId) => + _i6.Future registerForAnEvent(String? eventId) => (super.noSuchMethod( Invocation.method( #registerForAnEvent, [eventId], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future<_i3.QueryResult> deleteEvent(String? eventId) => + _i6.Future<_i3.QueryResult> deleteEvent(String? eventId) => (super.noSuchMethod( Invocation.method( #deleteEvent, [eventId], ), - returnValue: _i5.Future<_i3.QueryResult>.value( + returnValue: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -1426,7 +1467,7 @@ class MockEventService extends _i2.Mock implements _i11.EventService { [eventId], ), )), - returnValueForMissingStub: _i5.Future<_i3.QueryResult>.value( + returnValueForMissingStub: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -1434,10 +1475,10 @@ class MockEventService extends _i2.Mock implements _i11.EventService { [eventId], ), )), - ) as _i5.Future<_i3.QueryResult>); + ) as _i6.Future<_i3.QueryResult>); @override - _i5.Future<_i3.QueryResult> editEvent({ + _i6.Future<_i3.QueryResult> editEvent({ required String? eventId, required Map? variables, }) => @@ -1450,7 +1491,7 @@ class MockEventService extends _i2.Mock implements _i11.EventService { #variables: variables, }, ), - returnValue: _i5.Future<_i3.QueryResult>.value( + returnValue: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -1462,7 +1503,7 @@ class MockEventService extends _i2.Mock implements _i11.EventService { }, ), )), - returnValueForMissingStub: _i5.Future<_i3.QueryResult>.value( + returnValueForMissingStub: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -1474,114 +1515,114 @@ class MockEventService extends _i2.Mock implements _i11.EventService { }, ), )), - ) as _i5.Future<_i3.QueryResult>); + ) as _i6.Future<_i3.QueryResult>); @override - _i5.Future createVolunteerGroup(Map? variables) => + _i6.Future createVolunteerGroup(Map? variables) => (super.noSuchMethod( Invocation.method( #createVolunteerGroup, [variables], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future removeVolunteerGroup(Map? variables) => + _i6.Future removeVolunteerGroup(Map? variables) => (super.noSuchMethod( Invocation.method( #removeVolunteerGroup, [variables], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future addVolunteerToGroup(Map? variables) => + _i6.Future addVolunteerToGroup(Map? variables) => (super.noSuchMethod( Invocation.method( #addVolunteerToGroup, [variables], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future removeVolunteerFromGroup( + _i6.Future removeVolunteerFromGroup( Map? variables) => (super.noSuchMethod( Invocation.method( #removeVolunteerFromGroup, [variables], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future updateVolunteerGroup(Map? variables) => + _i6.Future updateVolunteerGroup(Map? variables) => (super.noSuchMethod( Invocation.method( #updateVolunteerGroup, [variables], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future> fetchVolunteerGroupsByEvent( + _i6.Future> fetchVolunteerGroupsByEvent( String? eventId) => (super.noSuchMethod( Invocation.method( #fetchVolunteerGroupsByEvent, [eventId], ), - returnValue: _i5.Future>.value( - <_i22.EventVolunteerGroup>[]), + returnValue: _i6.Future>.value( + <_i23.EventVolunteerGroup>[]), returnValueForMissingStub: - _i5.Future>.value( - <_i22.EventVolunteerGroup>[]), - ) as _i5.Future>); + _i6.Future>.value( + <_i23.EventVolunteerGroup>[]), + ) as _i6.Future>); @override - _i5.Future fetchAgendaCategories(String? orgId) => + _i6.Future fetchAgendaCategories(String? orgId) => (super.noSuchMethod( Invocation.method( #fetchAgendaCategories, [orgId], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future createAgendaItem(Map? variables) => + _i6.Future createAgendaItem(Map? variables) => (super.noSuchMethod( Invocation.method( #createAgendaItem, [variables], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future deleteAgendaItem(Map? variables) => + _i6.Future deleteAgendaItem(Map? variables) => (super.noSuchMethod( Invocation.method( #deleteAgendaItem, [variables], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future updateAgendaItem( + _i6.Future updateAgendaItem( String? itemId, Map? variables, ) => @@ -1593,19 +1634,19 @@ class MockEventService extends _i2.Mock implements _i11.EventService { variables, ], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future fetchAgendaItems(String? eventId) => (super.noSuchMethod( + _i6.Future fetchAgendaItems(String? eventId) => (super.noSuchMethod( Invocation.method( #fetchAgendaItems, [eventId], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override void dispose() => super.noSuchMethod( @@ -1617,53 +1658,53 @@ class MockEventService extends _i2.Mock implements _i11.EventService { ); @override - _i5.Future> loadCachedData() => (super.noSuchMethod( + _i6.Future> loadCachedData() => (super.noSuchMethod( Invocation.method( #loadCachedData, [], ), - returnValue: _i5.Future>.value(<_i21.Event>[]), + returnValue: _i6.Future>.value(<_i22.Event>[]), returnValueForMissingStub: - _i5.Future>.value(<_i21.Event>[]), - ) as _i5.Future>); + _i6.Future>.value(<_i22.Event>[]), + ) as _i6.Future>); @override - _i5.Future saveDataToCache(List<_i21.Event>? data) => + _i6.Future saveDataToCache(List<_i22.Event>? data) => (super.noSuchMethod( Invocation.method( #saveDataToCache, [data], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future> getNewFeedAndRefreshCache() => + _i6.Future> getNewFeedAndRefreshCache() => (super.noSuchMethod( Invocation.method( #getNewFeedAndRefreshCache, [], ), - returnValue: _i5.Future>.value(<_i21.Event>[]), + returnValue: _i6.Future>.value(<_i22.Event>[]), returnValueForMissingStub: - _i5.Future>.value(<_i21.Event>[]), - ) as _i5.Future>); + _i6.Future>.value(<_i22.Event>[]), + ) as _i6.Future>); } /// A class which mocks [ChatService]. /// /// See the documentation for Mockito's code generation for more information. -class MockChatService extends _i2.Mock implements _i23.ChatService { +class MockChatService extends _i2.Mock implements _i24.ChatService { @override - _i5.Stream<_i3.QueryResult> get chatStream => (super.noSuchMethod( + _i6.Stream<_i3.QueryResult> get chatStream => (super.noSuchMethod( Invocation.getter(#chatStream), - returnValue: _i5.Stream<_i3.QueryResult>.empty(), - returnValueForMissingStub: _i5.Stream<_i3.QueryResult>.empty(), - ) as _i5.Stream<_i3.QueryResult>); + returnValue: _i6.Stream<_i3.QueryResult>.empty(), + returnValueForMissingStub: _i6.Stream<_i3.QueryResult>.empty(), + ) as _i6.Stream<_i3.QueryResult>); @override - set chatStream(_i5.Stream<_i3.QueryResult>? _chatStream) => + set chatStream(_i6.Stream<_i3.QueryResult>? _chatStream) => super.noSuchMethod( Invocation.setter( #chatStream, @@ -1673,23 +1714,23 @@ class MockChatService extends _i2.Mock implements _i23.ChatService { ); @override - _i5.Stream<_i24.ChatListTileDataModel> get chatListStream => + _i6.Stream<_i25.ChatListTileDataModel> get chatListStream => (super.noSuchMethod( Invocation.getter(#chatListStream), - returnValue: _i5.Stream<_i24.ChatListTileDataModel>.empty(), + returnValue: _i6.Stream<_i25.ChatListTileDataModel>.empty(), returnValueForMissingStub: - _i5.Stream<_i24.ChatListTileDataModel>.empty(), - ) as _i5.Stream<_i24.ChatListTileDataModel>); + _i6.Stream<_i25.ChatListTileDataModel>.empty(), + ) as _i6.Stream<_i25.ChatListTileDataModel>); @override - _i5.Stream<_i25.ChatMessage> get chatMessagesStream => (super.noSuchMethod( + _i6.Stream<_i26.ChatMessage> get chatMessagesStream => (super.noSuchMethod( Invocation.getter(#chatMessagesStream), - returnValue: _i5.Stream<_i25.ChatMessage>.empty(), - returnValueForMissingStub: _i5.Stream<_i25.ChatMessage>.empty(), - ) as _i5.Stream<_i25.ChatMessage>); + returnValue: _i6.Stream<_i26.ChatMessage>.empty(), + returnValueForMissingStub: _i6.Stream<_i26.ChatMessage>.empty(), + ) as _i6.Stream<_i26.ChatMessage>); @override - _i5.Future sendMessageToDirectChat( + _i6.Future sendMessageToDirectChat( String? chatId, String? messageContent, ) => @@ -1701,78 +1742,78 @@ class MockChatService extends _i2.Mock implements _i23.ChatService { messageContent, ], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future getDirectChatsByUserId() => (super.noSuchMethod( + _i6.Future getDirectChatsByUserId() => (super.noSuchMethod( Invocation.method( #getDirectChatsByUserId, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future getDirectChatMessagesByChatId(dynamic chatId) => + _i6.Future getDirectChatMessagesByChatId(dynamic chatId) => (super.noSuchMethod( Invocation.method( #getDirectChatMessagesByChatId, [chatId], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); } /// A class which mocks [UserConfig]. /// /// See the documentation for Mockito's code generation for more information. -class MockUserConfig extends _i2.Mock implements _i26.UserConfig { +class MockUserConfig extends _i2.Mock implements _i27.UserConfig { @override - _i5.Stream<_i6.OrgInfo> get currentOrgInfoStream => (super.noSuchMethod( + _i6.Stream<_i5.OrgInfo> get currentOrgInfoStream => (super.noSuchMethod( Invocation.getter(#currentOrgInfoStream), - returnValue: _i5.Stream<_i6.OrgInfo>.empty(), - returnValueForMissingStub: _i5.Stream<_i6.OrgInfo>.empty(), - ) as _i5.Stream<_i6.OrgInfo>); + returnValue: _i6.Stream<_i5.OrgInfo>.empty(), + returnValueForMissingStub: _i6.Stream<_i5.OrgInfo>.empty(), + ) as _i6.Stream<_i5.OrgInfo>); @override - _i5.StreamController<_i6.OrgInfo> get currentOrgInfoController => + _i6.StreamController<_i5.OrgInfo> get currentOrgInfoController => (super.noSuchMethod( Invocation.getter(#currentOrgInfoController), - returnValue: _FakeStreamController_11<_i6.OrgInfo>( + returnValue: _FakeStreamController_12<_i5.OrgInfo>( this, Invocation.getter(#currentOrgInfoController), ), - returnValueForMissingStub: _FakeStreamController_11<_i6.OrgInfo>( + returnValueForMissingStub: _FakeStreamController_12<_i5.OrgInfo>( this, Invocation.getter(#currentOrgInfoController), ), - ) as _i5.StreamController<_i6.OrgInfo>); + ) as _i6.StreamController<_i5.OrgInfo>); @override - _i6.OrgInfo get currentOrg => (super.noSuchMethod( + _i5.OrgInfo get currentOrg => (super.noSuchMethod( Invocation.getter(#currentOrg), - returnValue: _FakeOrgInfo_12( + returnValue: _FakeOrgInfo_11( this, Invocation.getter(#currentOrg), ), - returnValueForMissingStub: _FakeOrgInfo_12( + returnValueForMissingStub: _FakeOrgInfo_11( this, Invocation.getter(#currentOrg), ), - ) as _i6.OrgInfo); + ) as _i5.OrgInfo); @override String get currentOrgName => (super.noSuchMethod( Invocation.getter(#currentOrgName), - returnValue: _i18.dummyValue( + returnValue: _i19.dummyValue( this, Invocation.getter(#currentOrgName), ), - returnValueForMissingStub: _i18.dummyValue( + returnValueForMissingStub: _i19.dummyValue( this, Invocation.getter(#currentOrgName), ), @@ -1786,7 +1827,7 @@ class MockUserConfig extends _i2.Mock implements _i26.UserConfig { ) as bool); @override - set currentOrg(_i6.OrgInfo? org) => super.noSuchMethod( + set currentOrg(_i5.OrgInfo? org) => super.noSuchMethod( Invocation.setter( #currentOrg, org, @@ -1826,71 +1867,71 @@ class MockUserConfig extends _i2.Mock implements _i26.UserConfig { ); @override - _i5.Future userLoggedIn() => (super.noSuchMethod( + _i6.Future userLoggedIn() => (super.noSuchMethod( Invocation.method( #userLoggedIn, [], ), - returnValue: _i5.Future.value(false), - returnValueForMissingStub: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i6.Future.value(false), + returnValueForMissingStub: _i6.Future.value(false), + ) as _i6.Future); @override - _i5.Future userLogOut() => (super.noSuchMethod( + _i6.Future userLogOut() => (super.noSuchMethod( Invocation.method( #userLogOut, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future updateUserJoinedOrg(List<_i6.OrgInfo>? orgDetails) => + _i6.Future updateUserJoinedOrg(List<_i5.OrgInfo>? orgDetails) => (super.noSuchMethod( Invocation.method( #updateUserJoinedOrg, [orgDetails], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future updateUserCreatedOrg(List<_i6.OrgInfo>? orgDetails) => + _i6.Future updateUserCreatedOrg(List<_i5.OrgInfo>? orgDetails) => (super.noSuchMethod( Invocation.method( #updateUserCreatedOrg, [orgDetails], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future updateUserMemberRequestOrg(List<_i6.OrgInfo>? orgDetails) => + _i6.Future updateUserMemberRequestOrg(List<_i5.OrgInfo>? orgDetails) => (super.noSuchMethod( Invocation.method( #updateUserMemberRequestOrg, [orgDetails], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future updateUserAdminOrg(List<_i6.OrgInfo>? orgDetails) => + _i6.Future updateUserAdminOrg(List<_i5.OrgInfo>? orgDetails) => (super.noSuchMethod( Invocation.method( #updateUserAdminOrg, [orgDetails], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future updateAccessToken({ + _i6.Future updateAccessToken({ required String? accessToken, required String? refreshToken, }) => @@ -1903,20 +1944,20 @@ class MockUserConfig extends _i2.Mock implements _i26.UserConfig { #refreshToken: refreshToken, }, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future updateUser(_i7.User? updatedUserDetails) => + _i6.Future updateUser(_i7.User? updatedUserDetails) => (super.noSuchMethod( Invocation.method( #updateUser, [updatedUserDetails], ), - returnValue: _i5.Future.value(false), - returnValueForMissingStub: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i6.Future.value(false), + returnValueForMissingStub: _i6.Future.value(false), + ) as _i6.Future); @override void saveUserInHive() => super.noSuchMethod( @@ -1928,7 +1969,7 @@ class MockUserConfig extends _i2.Mock implements _i26.UserConfig { ); @override - void saveCurrentOrgInHive(_i6.OrgInfo? saveOrgAsCurrent) => + void saveCurrentOrgInHive(_i5.OrgInfo? saveOrgAsCurrent) => super.noSuchMethod( Invocation.method( #saveCurrentOrgInHive, @@ -1941,7 +1982,7 @@ class MockUserConfig extends _i2.Mock implements _i26.UserConfig { /// A class which mocks [AppLanguage]. /// /// See the documentation for Mockito's code generation for more information. -class MockAppLanguage extends _i2.Mock implements _i27.AppLanguage { +class MockAppLanguage extends _i2.Mock implements _i28.AppLanguage { @override bool get isTest => (super.noSuchMethod( Invocation.getter(#isTest), @@ -1989,11 +2030,11 @@ class MockAppLanguage extends _i2.Mock implements _i27.AppLanguage { ) as _i10.Locale); @override - _i14.ViewState get state => (super.noSuchMethod( + _i15.ViewState get state => (super.noSuchMethod( Invocation.getter(#state), - returnValue: _i14.ViewState.idle, - returnValueForMissingStub: _i14.ViewState.idle, - ) as _i14.ViewState); + returnValue: _i15.ViewState.idle, + returnValueForMissingStub: _i15.ViewState.idle, + ) as _i15.ViewState); @override bool get isBusy => (super.noSuchMethod( @@ -2010,24 +2051,24 @@ class MockAppLanguage extends _i2.Mock implements _i27.AppLanguage { ) as bool); @override - _i5.Future initialize() => (super.noSuchMethod( + _i6.Future initialize() => (super.noSuchMethod( Invocation.method( #initialize, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future fetchLocale() => (super.noSuchMethod( + _i6.Future fetchLocale() => (super.noSuchMethod( Invocation.method( #fetchLocale, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override _i10.Locale localeResoultion( @@ -2065,57 +2106,57 @@ class MockAppLanguage extends _i2.Mock implements _i27.AppLanguage { ) as _i10.Locale); @override - _i5.Future changeLanguage(_i10.Locale? type) => (super.noSuchMethod( + _i6.Future changeLanguage(_i10.Locale? type) => (super.noSuchMethod( Invocation.method( #changeLanguage, [type], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future selectLanguagePress() => (super.noSuchMethod( + _i6.Future selectLanguagePress() => (super.noSuchMethod( Invocation.method( #selectLanguagePress, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future dbLanguageUpdate() => (super.noSuchMethod( + _i6.Future dbLanguageUpdate() => (super.noSuchMethod( Invocation.method( #dbLanguageUpdate, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future appLanguageQuery() => (super.noSuchMethod( + _i6.Future appLanguageQuery() => (super.noSuchMethod( Invocation.method( #appLanguageQuery, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future userLanguageQuery(String? userId) => (super.noSuchMethod( + _i6.Future userLanguageQuery(String? userId) => (super.noSuchMethod( Invocation.method( #userLanguageQuery, [userId], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - void setState(_i14.ViewState? viewState) => super.noSuchMethod( + void setState(_i15.ViewState? viewState) => super.noSuchMethod( Invocation.method( #setState, [viewState], @@ -2164,7 +2205,7 @@ class MockAppLanguage extends _i2.Mock implements _i27.AppLanguage { /// /// See the documentation for Mockito's code generation for more information. class MockSignupDetailsViewModel extends _i2.Mock - implements _i28.SignupDetailsViewModel { + implements _i29.SignupDetailsViewModel { @override _i1.GlobalKey<_i1.FormState> get formKey => (super.noSuchMethod( Invocation.getter(#formKey), @@ -2195,20 +2236,20 @@ class MockSignupDetailsViewModel extends _i2.Mock ); @override - _i6.OrgInfo get selectedOrganization => (super.noSuchMethod( + _i5.OrgInfo get selectedOrganization => (super.noSuchMethod( Invocation.getter(#selectedOrganization), - returnValue: _FakeOrgInfo_12( + returnValue: _FakeOrgInfo_11( this, Invocation.getter(#selectedOrganization), ), - returnValueForMissingStub: _FakeOrgInfo_12( + returnValueForMissingStub: _FakeOrgInfo_11( this, Invocation.getter(#selectedOrganization), ), - ) as _i6.OrgInfo); + ) as _i5.OrgInfo); @override - set selectedOrganization(_i6.OrgInfo? _selectedOrganization) => + set selectedOrganization(_i5.OrgInfo? _selectedOrganization) => super.noSuchMethod( Invocation.setter( #selectedOrganization, @@ -2217,14 +2258,37 @@ class MockSignupDetailsViewModel extends _i2.Mock returnValueForMissingStub: null, ); + @override + _i11.FlutterSecureStorage get secureStorage => (super.noSuchMethod( + Invocation.getter(#secureStorage), + returnValue: _FakeFlutterSecureStorage_17( + this, + Invocation.getter(#secureStorage), + ), + returnValueForMissingStub: _FakeFlutterSecureStorage_17( + this, + Invocation.getter(#secureStorage), + ), + ) as _i11.FlutterSecureStorage); + + @override + set secureStorage(_i11.FlutterSecureStorage? _secureStorage) => + super.noSuchMethod( + Invocation.setter( + #secureStorage, + _secureStorage, + ), + returnValueForMissingStub: null, + ); + @override _i1.TextEditingController get confirmPassword => (super.noSuchMethod( Invocation.getter(#confirmPassword), - returnValue: _FakeTextEditingController_17( + returnValue: _FakeTextEditingController_18( this, Invocation.getter(#confirmPassword), ), - returnValueForMissingStub: _FakeTextEditingController_17( + returnValueForMissingStub: _FakeTextEditingController_18( this, Invocation.getter(#confirmPassword), ), @@ -2243,11 +2307,11 @@ class MockSignupDetailsViewModel extends _i2.Mock @override _i1.TextEditingController get firstName => (super.noSuchMethod( Invocation.getter(#firstName), - returnValue: _FakeTextEditingController_17( + returnValue: _FakeTextEditingController_18( this, Invocation.getter(#firstName), ), - returnValueForMissingStub: _FakeTextEditingController_17( + returnValueForMissingStub: _FakeTextEditingController_18( this, Invocation.getter(#firstName), ), @@ -2265,11 +2329,11 @@ class MockSignupDetailsViewModel extends _i2.Mock @override _i1.TextEditingController get lastName => (super.noSuchMethod( Invocation.getter(#lastName), - returnValue: _FakeTextEditingController_17( + returnValue: _FakeTextEditingController_18( this, Invocation.getter(#lastName), ), - returnValueForMissingStub: _FakeTextEditingController_17( + returnValueForMissingStub: _FakeTextEditingController_18( this, Invocation.getter(#lastName), ), @@ -2287,11 +2351,11 @@ class MockSignupDetailsViewModel extends _i2.Mock @override _i1.TextEditingController get password => (super.noSuchMethod( Invocation.getter(#password), - returnValue: _FakeTextEditingController_17( + returnValue: _FakeTextEditingController_18( this, Invocation.getter(#password), ), - returnValueForMissingStub: _FakeTextEditingController_17( + returnValueForMissingStub: _FakeTextEditingController_18( this, Invocation.getter(#password), ), @@ -2309,11 +2373,11 @@ class MockSignupDetailsViewModel extends _i2.Mock @override _i1.TextEditingController get email => (super.noSuchMethod( Invocation.getter(#email), - returnValue: _FakeTextEditingController_17( + returnValue: _FakeTextEditingController_18( this, Invocation.getter(#email), ), - returnValueForMissingStub: _FakeTextEditingController_17( + returnValueForMissingStub: _FakeTextEditingController_18( this, Invocation.getter(#email), ), @@ -2347,11 +2411,11 @@ class MockSignupDetailsViewModel extends _i2.Mock @override _i1.FocusNode get confirmFocus => (super.noSuchMethod( Invocation.getter(#confirmFocus), - returnValue: _FakeFocusNode_18( + returnValue: _FakeFocusNode_19( this, Invocation.getter(#confirmFocus), ), - returnValueForMissingStub: _FakeFocusNode_18( + returnValueForMissingStub: _FakeFocusNode_19( this, Invocation.getter(#confirmFocus), ), @@ -2383,11 +2447,11 @@ class MockSignupDetailsViewModel extends _i2.Mock ); @override - _i14.ViewState get state => (super.noSuchMethod( + _i15.ViewState get state => (super.noSuchMethod( Invocation.getter(#state), - returnValue: _i14.ViewState.idle, - returnValueForMissingStub: _i14.ViewState.idle, - ) as _i14.ViewState); + returnValue: _i15.ViewState.idle, + returnValueForMissingStub: _i15.ViewState.idle, + ) as _i15.ViewState); @override bool get isBusy => (super.noSuchMethod( @@ -2404,7 +2468,7 @@ class MockSignupDetailsViewModel extends _i2.Mock ) as bool); @override - void initialise(_i6.OrgInfo? org) => super.noSuchMethod( + void initialise(_i5.OrgInfo? org) => super.noSuchMethod( Invocation.method( #initialise, [org], @@ -2413,17 +2477,27 @@ class MockSignupDetailsViewModel extends _i2.Mock ); @override - _i5.Future signUp() => (super.noSuchMethod( + _i6.Future signUp() => (super.noSuchMethod( Invocation.method( #signUp, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future storingCredentialsInSecureStorage() => (super.noSuchMethod( + Invocation.method( + #storingCredentialsInSecureStorage, + [], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - void setState(_i14.ViewState? viewState) => super.noSuchMethod( + void setState(_i15.ViewState? viewState) => super.noSuchMethod( Invocation.method( #setState, [viewState], @@ -2471,15 +2545,15 @@ class MockSignupDetailsViewModel extends _i2.Mock /// A class which mocks [Post]. /// /// See the documentation for Mockito's code generation for more information. -class MockPost extends _i2.Mock implements _i17.Post { +class MockPost extends _i2.Mock implements _i18.Post { @override String get sId => (super.noSuchMethod( Invocation.getter(#sId), - returnValue: _i18.dummyValue( + returnValue: _i19.dummyValue( this, Invocation.getter(#sId), ), - returnValueForMissingStub: _i18.dummyValue( + returnValueForMissingStub: _i19.dummyValue( this, Invocation.getter(#sId), ), @@ -2549,7 +2623,7 @@ class MockPost extends _i2.Mock implements _i17.Post { ); @override - set organization(_i6.OrgInfo? _organization) => super.noSuchMethod( + set organization(_i5.OrgInfo? _organization) => super.noSuchMethod( Invocation.setter( #organization, _organization, @@ -2558,7 +2632,7 @@ class MockPost extends _i2.Mock implements _i17.Post { ); @override - set likedBy(List<_i17.LikedBy>? _likedBy) => super.noSuchMethod( + set likedBy(List<_i18.LikedBy>? _likedBy) => super.noSuchMethod( Invocation.setter( #likedBy, _likedBy, @@ -2567,7 +2641,7 @@ class MockPost extends _i2.Mock implements _i17.Post { ); @override - set comments(List<_i17.Comments>? _comments) => super.noSuchMethod( + set comments(List<_i18.Comments>? _comments) => super.noSuchMethod( Invocation.setter( #comments, _comments, @@ -2581,14 +2655,14 @@ class MockPost extends _i2.Mock implements _i17.Post { #getPostCreatedDuration, [], ), - returnValue: _i18.dummyValue( + returnValue: _i19.dummyValue( this, Invocation.method( #getPostCreatedDuration, [], ), ), - returnValueForMissingStub: _i18.dummyValue( + returnValueForMissingStub: _i19.dummyValue( this, Invocation.method( #getPostCreatedDuration, @@ -2688,7 +2762,7 @@ class MockDataBaseMutationFunctions extends _i2.Mock ); @override - _i5.Future<_i3.QueryResult> gqlAuthQuery( + _i6.Future<_i3.QueryResult> gqlAuthQuery( String? query, { Map? variables, }) => @@ -2698,7 +2772,7 @@ class MockDataBaseMutationFunctions extends _i2.Mock [query], {#variables: variables}, ), - returnValue: _i5.Future<_i3.QueryResult>.value( + returnValue: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -2707,7 +2781,7 @@ class MockDataBaseMutationFunctions extends _i2.Mock {#variables: variables}, ), )), - returnValueForMissingStub: _i5.Future<_i3.QueryResult>.value( + returnValueForMissingStub: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -2716,10 +2790,10 @@ class MockDataBaseMutationFunctions extends _i2.Mock {#variables: variables}, ), )), - ) as _i5.Future<_i3.QueryResult>); + ) as _i6.Future<_i3.QueryResult>); @override - _i5.Future<_i3.QueryResult> gqlAuthMutation( + _i6.Future<_i3.QueryResult> gqlAuthMutation( String? mutation, { Map? variables, }) => @@ -2729,7 +2803,7 @@ class MockDataBaseMutationFunctions extends _i2.Mock [mutation], {#variables: variables}, ), - returnValue: _i5.Future<_i3.QueryResult>.value( + returnValue: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -2738,7 +2812,7 @@ class MockDataBaseMutationFunctions extends _i2.Mock {#variables: variables}, ), )), - returnValueForMissingStub: _i5.Future<_i3.QueryResult>.value( + returnValueForMissingStub: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -2747,10 +2821,10 @@ class MockDataBaseMutationFunctions extends _i2.Mock {#variables: variables}, ), )), - ) as _i5.Future<_i3.QueryResult>); + ) as _i6.Future<_i3.QueryResult>); @override - _i5.Future<_i3.QueryResult> gqlNonAuthMutation( + _i6.Future<_i3.QueryResult> gqlNonAuthMutation( String? mutation, { Map? variables, bool? reCall = true, @@ -2764,7 +2838,7 @@ class MockDataBaseMutationFunctions extends _i2.Mock #reCall: reCall, }, ), - returnValue: _i5.Future<_i3.QueryResult>.value( + returnValue: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -2776,7 +2850,7 @@ class MockDataBaseMutationFunctions extends _i2.Mock }, ), )), - returnValueForMissingStub: _i5.Future<_i3.QueryResult>.value( + returnValueForMissingStub: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -2788,10 +2862,10 @@ class MockDataBaseMutationFunctions extends _i2.Mock }, ), )), - ) as _i5.Future<_i3.QueryResult>); + ) as _i6.Future<_i3.QueryResult>); @override - _i5.Future<_i3.QueryResult> gqlNonAuthQuery( + _i6.Future<_i3.QueryResult> gqlNonAuthQuery( String? query, { Map? variables, }) => @@ -2801,7 +2875,7 @@ class MockDataBaseMutationFunctions extends _i2.Mock [query], {#variables: variables}, ), - returnValue: _i5.Future<_i3.QueryResult>.value( + returnValue: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -2810,7 +2884,7 @@ class MockDataBaseMutationFunctions extends _i2.Mock {#variables: variables}, ), )), - returnValueForMissingStub: _i5.Future<_i3.QueryResult>.value( + returnValueForMissingStub: _i6.Future<_i3.QueryResult>.value( _FakeQueryResult_9( this, Invocation.method( @@ -2819,53 +2893,53 @@ class MockDataBaseMutationFunctions extends _i2.Mock {#variables: variables}, ), )), - ) as _i5.Future<_i3.QueryResult>); + ) as _i6.Future<_i3.QueryResult>); @override - _i5.Future refreshAccessToken(String? refreshToken) => + _i6.Future refreshAccessToken(String? refreshToken) => (super.noSuchMethod( Invocation.method( #refreshAccessToken, [refreshToken], ), - returnValue: _i5.Future.value(false), - returnValueForMissingStub: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i6.Future.value(false), + returnValueForMissingStub: _i6.Future.value(false), + ) as _i6.Future); @override - _i5.Future fetchOrgById(String? id) => (super.noSuchMethod( + _i6.Future fetchOrgById(String? id) => (super.noSuchMethod( Invocation.method( #fetchOrgById, [id], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); } /// A class which mocks [OrganizationService]. /// /// See the documentation for Mockito's code generation for more information. class MockOrganizationService extends _i2.Mock - implements _i29.OrganizationService { + implements _i30.OrganizationService { @override - _i5.Future> getOrgMembersList(String? orgId) => + _i6.Future> getOrgMembersList(String? orgId) => (super.noSuchMethod( Invocation.method( #getOrgMembersList, [orgId], ), - returnValue: _i5.Future>.value(<_i7.User>[]), + returnValue: _i6.Future>.value(<_i7.User>[]), returnValueForMissingStub: - _i5.Future>.value(<_i7.User>[]), - ) as _i5.Future>); + _i6.Future>.value(<_i7.User>[]), + ) as _i6.Future>); } /// A class which mocks [ExploreEventsViewModel]. /// /// See the documentation for Mockito's code generation for more information. class MockExploreEventsViewModel extends _i2.Mock - implements _i30.ExploreEventsViewModel { + implements _i31.ExploreEventsViewModel { @override bool get demoMode => (super.noSuchMethod( Invocation.getter(#demoMode), @@ -2883,40 +2957,40 @@ class MockExploreEventsViewModel extends _i2.Mock ); @override - List<_i21.Event> get events => (super.noSuchMethod( + List<_i22.Event> get events => (super.noSuchMethod( Invocation.getter(#events), - returnValue: <_i21.Event>[], - returnValueForMissingStub: <_i21.Event>[], - ) as List<_i21.Event>); + returnValue: <_i22.Event>[], + returnValueForMissingStub: <_i22.Event>[], + ) as List<_i22.Event>); @override - List<_i21.Event> get userEvents => (super.noSuchMethod( + List<_i22.Event> get userEvents => (super.noSuchMethod( Invocation.getter(#userEvents), - returnValue: <_i21.Event>[], - returnValueForMissingStub: <_i21.Event>[], - ) as List<_i21.Event>); + returnValue: <_i22.Event>[], + returnValueForMissingStub: <_i22.Event>[], + ) as List<_i22.Event>); @override - _i11.EventService get eventService => (super.noSuchMethod( + _i12.EventService get eventService => (super.noSuchMethod( Invocation.getter(#eventService), - returnValue: _FakeEventService_19( + returnValue: _FakeEventService_20( this, Invocation.getter(#eventService), ), - returnValueForMissingStub: _FakeEventService_19( + returnValueForMissingStub: _FakeEventService_20( this, Invocation.getter(#eventService), ), - ) as _i11.EventService); + ) as _i12.EventService); @override String get emptyListMessage => (super.noSuchMethod( Invocation.getter(#emptyListMessage), - returnValue: _i18.dummyValue( + returnValue: _i19.dummyValue( this, Invocation.getter(#emptyListMessage), ), - returnValueForMissingStub: _i18.dummyValue( + returnValueForMissingStub: _i19.dummyValue( this, Invocation.getter(#emptyListMessage), ), @@ -2925,22 +2999,22 @@ class MockExploreEventsViewModel extends _i2.Mock @override String get chosenValue => (super.noSuchMethod( Invocation.getter(#chosenValue), - returnValue: _i18.dummyValue( + returnValue: _i19.dummyValue( this, Invocation.getter(#chosenValue), ), - returnValueForMissingStub: _i18.dummyValue( + returnValueForMissingStub: _i19.dummyValue( this, Invocation.getter(#chosenValue), ), ) as String); @override - _i14.ViewState get state => (super.noSuchMethod( + _i15.ViewState get state => (super.noSuchMethod( Invocation.getter(#state), - returnValue: _i14.ViewState.idle, - returnValueForMissingStub: _i14.ViewState.idle, - ) as _i14.ViewState); + returnValue: _i15.ViewState.idle, + returnValueForMissingStub: _i15.ViewState.idle, + ) as _i15.ViewState); @override bool get isBusy => (super.noSuchMethod( @@ -2957,67 +3031,67 @@ class MockExploreEventsViewModel extends _i2.Mock ) as bool); @override - _i5.Future fetchNewEvents() => (super.noSuchMethod( + _i6.Future fetchNewEvents() => (super.noSuchMethod( Invocation.method( #fetchNewEvents, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future refreshEvents() => (super.noSuchMethod( + _i6.Future refreshEvents() => (super.noSuchMethod( Invocation.method( #refreshEvents, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future initialise() => (super.noSuchMethod( + _i6.Future initialise() => (super.noSuchMethod( Invocation.method( #initialise, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future checkIfExistsAndAddNewEvents(List<_i21.Event>? newEvents) => + _i6.Future checkIfExistsAndAddNewEvents(List<_i22.Event>? newEvents) => (super.noSuchMethod( Invocation.method( #checkIfExistsAndAddNewEvents, [newEvents], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future deleteEvent({required String? eventId}) => + _i6.Future deleteEvent({required String? eventId}) => (super.noSuchMethod( Invocation.method( #deleteEvent, [], {#eventId: eventId}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future choseValueFromDropdown(String? value) => (super.noSuchMethod( + _i6.Future choseValueFromDropdown(String? value) => (super.noSuchMethod( Invocation.method( #choseValueFromDropdown, [value], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override void dispose() => super.noSuchMethod( @@ -3029,7 +3103,7 @@ class MockExploreEventsViewModel extends _i2.Mock ); @override - void setState(_i14.ViewState? viewState) => super.noSuchMethod( + void setState(_i15.ViewState? viewState) => super.noSuchMethod( Invocation.method( #setState, [viewState], @@ -3069,7 +3143,7 @@ class MockExploreEventsViewModel extends _i2.Mock /// /// See the documentation for Mockito's code generation for more information. class MockOrganizationFeedViewModel extends _i2.Mock - implements _i31.OrganizationFeedViewModel { + implements _i32.OrganizationFeedViewModel { @override bool get istest => (super.noSuchMethod( Invocation.getter(#istest), @@ -3087,34 +3161,34 @@ class MockOrganizationFeedViewModel extends _i2.Mock ); @override - List<_i17.Post> get posts => (super.noSuchMethod( + List<_i18.Post> get posts => (super.noSuchMethod( Invocation.getter(#posts), - returnValue: <_i17.Post>[], - returnValueForMissingStub: <_i17.Post>[], - ) as List<_i17.Post>); + returnValue: <_i18.Post>[], + returnValueForMissingStub: <_i18.Post>[], + ) as List<_i18.Post>); @override - List<_i17.Post> get userPosts => (super.noSuchMethod( + List<_i18.Post> get userPosts => (super.noSuchMethod( Invocation.getter(#userPosts), - returnValue: <_i17.Post>[], - returnValueForMissingStub: <_i17.Post>[], - ) as List<_i17.Post>); + returnValue: <_i18.Post>[], + returnValueForMissingStub: <_i18.Post>[], + ) as List<_i18.Post>); @override - List<_i17.Post> get pinnedPosts => (super.noSuchMethod( + List<_i18.Post> get pinnedPosts => (super.noSuchMethod( Invocation.getter(#pinnedPosts), - returnValue: <_i17.Post>[], - returnValueForMissingStub: <_i17.Post>[], - ) as List<_i17.Post>); + returnValue: <_i18.Post>[], + returnValueForMissingStub: <_i18.Post>[], + ) as List<_i18.Post>); @override String get currentOrgName => (super.noSuchMethod( Invocation.getter(#currentOrgName), - returnValue: _i18.dummyValue( + returnValue: _i19.dummyValue( this, Invocation.getter(#currentOrgName), ), - returnValueForMissingStub: _i18.dummyValue( + returnValueForMissingStub: _i19.dummyValue( this, Invocation.getter(#currentOrgName), ), @@ -3128,11 +3202,11 @@ class MockOrganizationFeedViewModel extends _i2.Mock ) as bool); @override - _i14.ViewState get state => (super.noSuchMethod( + _i15.ViewState get state => (super.noSuchMethod( Invocation.getter(#state), - returnValue: _i14.ViewState.idle, - returnValueForMissingStub: _i14.ViewState.idle, - ) as _i14.ViewState); + returnValue: _i15.ViewState.idle, + returnValueForMissingStub: _i15.ViewState.idle, + ) as _i15.ViewState); @override bool get isBusy => (super.noSuchMethod( @@ -3178,7 +3252,7 @@ class MockOrganizationFeedViewModel extends _i2.Mock ); @override - void buildNewPosts(List<_i17.Post>? newPosts) => super.noSuchMethod( + void buildNewPosts(List<_i18.Post>? newPosts) => super.noSuchMethod( Invocation.method( #buildNewPosts, [newPosts], @@ -3187,7 +3261,7 @@ class MockOrganizationFeedViewModel extends _i2.Mock ); @override - void navigateToIndividualPage(_i17.Post? post) => super.noSuchMethod( + void navigateToIndividualPage(_i18.Post? post) => super.noSuchMethod( Invocation.method( #navigateToIndividualPage, [post], @@ -3214,7 +3288,7 @@ class MockOrganizationFeedViewModel extends _i2.Mock ); @override - void addNewPost(_i17.Post? newPost) => super.noSuchMethod( + void addNewPost(_i18.Post? newPost) => super.noSuchMethod( Invocation.method( #addNewPost, [newPost], @@ -3223,7 +3297,7 @@ class MockOrganizationFeedViewModel extends _i2.Mock ); @override - void updatedPost(_i17.Post? post) => super.noSuchMethod( + void updatedPost(_i18.Post? post) => super.noSuchMethod( Invocation.method( #updatedPost, [post], @@ -3232,14 +3306,14 @@ class MockOrganizationFeedViewModel extends _i2.Mock ); @override - _i5.Future removePost(_i17.Post? post) => (super.noSuchMethod( + _i6.Future removePost(_i18.Post? post) => (super.noSuchMethod( Invocation.method( #removePost, [post], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override void nextPage() => super.noSuchMethod( @@ -3260,7 +3334,7 @@ class MockOrganizationFeedViewModel extends _i2.Mock ); @override - void setState(_i14.ViewState? viewState) => super.noSuchMethod( + void setState(_i15.ViewState? viewState) => super.noSuchMethod( Invocation.method( #setState, [viewState], @@ -3299,160 +3373,278 @@ class MockOrganizationFeedViewModel extends _i2.Mock /// A class which mocks [Validator]. /// /// See the documentation for Mockito's code generation for more information. -class MockValidator extends _i2.Mock implements _i32.Validator { +class MockValidator extends _i2.Mock implements _i33.Validator { @override - _i5.Future validateUrlExistence(String? url) => (super.noSuchMethod( + _i6.Future validateUrlExistence(String? url) => (super.noSuchMethod( Invocation.method( #validateUrlExistence, [url], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); } -/// A class which mocks [QRViewController]. +/// A class which mocks [MobileScannerController]. /// /// See the documentation for Mockito's code generation for more information. -class MockQRViewController extends _i2.Mock implements _i33.QRViewController { +class MockMobileScannerController extends _i2.Mock + implements _i34.MobileScannerController { + @override + bool get autoStart => (super.noSuchMethod( + Invocation.getter(#autoStart), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + + @override + _i35.DetectionSpeed get detectionSpeed => (super.noSuchMethod( + Invocation.getter(#detectionSpeed), + returnValue: _i35.DetectionSpeed.noDuplicates, + returnValueForMissingStub: _i35.DetectionSpeed.noDuplicates, + ) as _i35.DetectionSpeed); + + @override + int get detectionTimeoutMs => (super.noSuchMethod( + Invocation.getter(#detectionTimeoutMs), + returnValue: 0, + returnValueForMissingStub: 0, + ) as int); + + @override + _i36.CameraFacing get facing => (super.noSuchMethod( + Invocation.getter(#facing), + returnValue: _i36.CameraFacing.front, + returnValueForMissingStub: _i36.CameraFacing.front, + ) as _i36.CameraFacing); + + @override + List<_i37.BarcodeFormat> get formats => (super.noSuchMethod( + Invocation.getter(#formats), + returnValue: <_i37.BarcodeFormat>[], + returnValueForMissingStub: <_i37.BarcodeFormat>[], + ) as List<_i37.BarcodeFormat>); + + @override + bool get returnImage => (super.noSuchMethod( + Invocation.getter(#returnImage), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + + @override + bool get torchEnabled => (super.noSuchMethod( + Invocation.getter(#torchEnabled), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + + @override + bool get useNewCameraSelector => (super.noSuchMethod( + Invocation.getter(#useNewCameraSelector), + returnValue: false, + returnValueForMissingStub: false, + ) as bool); + + @override + _i6.Stream<_i38.BarcodeCapture> get barcodes => (super.noSuchMethod( + Invocation.getter(#barcodes), + returnValue: _i6.Stream<_i38.BarcodeCapture>.empty(), + returnValueForMissingStub: _i6.Stream<_i38.BarcodeCapture>.empty(), + ) as _i6.Stream<_i38.BarcodeCapture>); + + @override + _i13.MobileScannerState get value => (super.noSuchMethod( + Invocation.getter(#value), + returnValue: _FakeMobileScannerState_21( + this, + Invocation.getter(#value), + ), + returnValueForMissingStub: _FakeMobileScannerState_21( + this, + Invocation.getter(#value), + ), + ) as _i13.MobileScannerState); + @override - _i5.Stream<_i34.Barcode> get scannedDataStream => (super.noSuchMethod( - Invocation.getter(#scannedDataStream), - returnValue: _i5.Stream<_i34.Barcode>.empty(), - returnValueForMissingStub: _i5.Stream<_i34.Barcode>.empty(), - ) as _i5.Stream<_i34.Barcode>); + set value(_i13.MobileScannerState? newValue) => super.noSuchMethod( + Invocation.setter( + #value, + newValue, + ), + returnValueForMissingStub: null, + ); @override - bool get hasPermissions => (super.noSuchMethod( - Invocation.getter(#hasPermissions), + bool get hasListeners => (super.noSuchMethod( + Invocation.getter(#hasListeners), returnValue: false, returnValueForMissingStub: false, ) as bool); @override - _i5.Future<_i35.CameraFacing> getCameraInfo() => (super.noSuchMethod( + _i6.Future<_i38.BarcodeCapture?> analyzeImage( + String? path, { + List<_i37.BarcodeFormat>? formats = const [], + }) => + (super.noSuchMethod( Invocation.method( - #getCameraInfo, - [], + #analyzeImage, + [path], + {#formats: formats}, ), - returnValue: - _i5.Future<_i35.CameraFacing>.value(_i35.CameraFacing.back), - returnValueForMissingStub: - _i5.Future<_i35.CameraFacing>.value(_i35.CameraFacing.back), - ) as _i5.Future<_i35.CameraFacing>); + returnValue: _i6.Future<_i38.BarcodeCapture?>.value(), + returnValueForMissingStub: _i6.Future<_i38.BarcodeCapture?>.value(), + ) as _i6.Future<_i38.BarcodeCapture?>); @override - _i5.Future<_i35.CameraFacing> flipCamera() => (super.noSuchMethod( + _i1.Widget buildCameraView() => (super.noSuchMethod( Invocation.method( - #flipCamera, + #buildCameraView, [], ), - returnValue: - _i5.Future<_i35.CameraFacing>.value(_i35.CameraFacing.back), - returnValueForMissingStub: - _i5.Future<_i35.CameraFacing>.value(_i35.CameraFacing.back), - ) as _i5.Future<_i35.CameraFacing>); + returnValue: _FakeWidget_22( + this, + Invocation.method( + #buildCameraView, + [], + ), + ), + returnValueForMissingStub: _FakeWidget_22( + this, + Invocation.method( + #buildCameraView, + [], + ), + ), + ) as _i1.Widget); @override - _i5.Future getFlashStatus() => (super.noSuchMethod( + _i6.Future resetZoomScale() => (super.noSuchMethod( Invocation.method( - #getFlashStatus, + #resetZoomScale, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future toggleFlash() => (super.noSuchMethod( + _i6.Future setZoomScale(double? zoomScale) => (super.noSuchMethod( + Invocation.method( + #setZoomScale, + [zoomScale], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future start({_i36.CameraFacing? cameraDirection}) => + (super.noSuchMethod( Invocation.method( - #toggleFlash, + #start, [], + {#cameraDirection: cameraDirection}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future pauseCamera() => (super.noSuchMethod( + _i6.Future stop() => (super.noSuchMethod( Invocation.method( - #pauseCamera, + #stop, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future stopCamera() => (super.noSuchMethod( + _i6.Future pause() => (super.noSuchMethod( Invocation.method( - #stopCamera, + #pause, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future resumeCamera() => (super.noSuchMethod( + _i6.Future switchCamera() => (super.noSuchMethod( Invocation.method( - #resumeCamera, + #switchCamera, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future<_i12.SystemFeatures> getSystemFeatures() => (super.noSuchMethod( + _i6.Future toggleTorch() => (super.noSuchMethod( Invocation.method( - #getSystemFeatures, + #toggleTorch, [], ), - returnValue: - _i5.Future<_i12.SystemFeatures>.value(_FakeSystemFeatures_20( - this, - Invocation.method( - #getSystemFeatures, - [], - ), - )), - returnValueForMissingStub: - _i5.Future<_i12.SystemFeatures>.value(_FakeSystemFeatures_20( - this, - Invocation.method( - #getSystemFeatures, - [], - ), - )), - ) as _i5.Future<_i12.SystemFeatures>); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - void dispose() => super.noSuchMethod( + _i6.Future updateScanWindow(_i10.Rect? window) => (super.noSuchMethod( + Invocation.method( + #updateScanWindow, + [window], + ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + _i6.Future dispose() => (super.noSuchMethod( Invocation.method( #dispose, [], ), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); + + @override + void addListener(_i10.VoidCallback? listener) => super.noSuchMethod( + Invocation.method( + #addListener, + [listener], + ), returnValueForMissingStub: null, ); @override - _i5.Future scanInvert(bool? isScanInvert) => (super.noSuchMethod( + void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( - #scanInvert, - [isScanInvert], + #removeListener, + [listener], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValueForMissingStub: null, + ); + + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method( + #notifyListeners, + [], + ), + returnValueForMissingStub: null, + ); } /// A class which mocks [CommentService]. /// /// See the documentation for Mockito's code generation for more information. -class MockCommentService extends _i2.Mock implements _i36.CommentService { +class MockCommentService extends _i2.Mock implements _i39.CommentService { @override - _i5.Future createComments( + _i6.Future createComments( String? postId, String? text, ) => @@ -3464,34 +3656,34 @@ class MockCommentService extends _i2.Mock implements _i36.CommentService { text, ], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future> getCommentsForPost(String? postId) => + _i6.Future> getCommentsForPost(String? postId) => (super.noSuchMethod( Invocation.method( #getCommentsForPost, [postId], ), - returnValue: _i5.Future>.value([]), - returnValueForMissingStub: _i5.Future>.value([]), - ) as _i5.Future>); + returnValue: _i6.Future>.value([]), + returnValueForMissingStub: _i6.Future>.value([]), + ) as _i6.Future>); } /// A class which mocks [AppTheme]. /// /// See the documentation for Mockito's code generation for more information. -class MockAppTheme extends _i2.Mock implements _i37.AppTheme { +class MockAppTheme extends _i2.Mock implements _i40.AppTheme { @override String get key => (super.noSuchMethod( Invocation.getter(#key), - returnValue: _i18.dummyValue( + returnValue: _i19.dummyValue( this, Invocation.getter(#key), ), - returnValueForMissingStub: _i18.dummyValue( + returnValueForMissingStub: _i19.dummyValue( this, Invocation.getter(#key), ), @@ -3507,22 +3699,22 @@ class MockAppTheme extends _i2.Mock implements _i37.AppTheme { @override _i1.ThemeData get theme => (super.noSuchMethod( Invocation.getter(#theme), - returnValue: _FakeThemeData_21( + returnValue: _FakeThemeData_23( this, Invocation.getter(#theme), ), - returnValueForMissingStub: _FakeThemeData_21( + returnValueForMissingStub: _FakeThemeData_23( this, Invocation.getter(#theme), ), ) as _i1.ThemeData); @override - _i14.ViewState get state => (super.noSuchMethod( + _i15.ViewState get state => (super.noSuchMethod( Invocation.getter(#state), - returnValue: _i14.ViewState.idle, - returnValueForMissingStub: _i14.ViewState.idle, - ) as _i14.ViewState); + returnValue: _i15.ViewState.idle, + returnValueForMissingStub: _i15.ViewState.idle, + ) as _i15.ViewState); @override bool get isBusy => (super.noSuchMethod( @@ -3558,7 +3750,7 @@ class MockAppTheme extends _i2.Mock implements _i37.AppTheme { ); @override - void setState(_i14.ViewState? viewState) => super.noSuchMethod( + void setState(_i15.ViewState? viewState) => super.noSuchMethod( Invocation.method( #setState, [viewState], @@ -3607,15 +3799,15 @@ class MockAppTheme extends _i2.Mock implements _i37.AppTheme { /// /// See the documentation for Mockito's code generation for more information. class MockCreateEventViewModel extends _i2.Mock - implements _i38.CreateEventViewModel { + implements _i41.CreateEventViewModel { @override _i1.TextEditingController get eventTitleTextController => (super.noSuchMethod( Invocation.getter(#eventTitleTextController), - returnValue: _FakeTextEditingController_17( + returnValue: _FakeTextEditingController_18( this, Invocation.getter(#eventTitleTextController), ), - returnValueForMissingStub: _FakeTextEditingController_17( + returnValueForMissingStub: _FakeTextEditingController_18( this, Invocation.getter(#eventTitleTextController), ), @@ -3636,11 +3828,11 @@ class MockCreateEventViewModel extends _i2.Mock _i1.TextEditingController get eventLocationTextController => (super.noSuchMethod( Invocation.getter(#eventLocationTextController), - returnValue: _FakeTextEditingController_17( + returnValue: _FakeTextEditingController_18( this, Invocation.getter(#eventLocationTextController), ), - returnValueForMissingStub: _FakeTextEditingController_17( + returnValueForMissingStub: _FakeTextEditingController_18( this, Invocation.getter(#eventLocationTextController), ), @@ -3661,11 +3853,11 @@ class MockCreateEventViewModel extends _i2.Mock _i1.TextEditingController get eventDescriptionTextController => (super.noSuchMethod( Invocation.getter(#eventDescriptionTextController), - returnValue: _FakeTextEditingController_17( + returnValue: _FakeTextEditingController_18( this, Invocation.getter(#eventDescriptionTextController), ), - returnValueForMissingStub: _FakeTextEditingController_17( + returnValueForMissingStub: _FakeTextEditingController_18( this, Invocation.getter(#eventDescriptionTextController), ), @@ -3686,11 +3878,11 @@ class MockCreateEventViewModel extends _i2.Mock _i1.TextEditingController get repeatsEveryCountController => (super.noSuchMethod( Invocation.getter(#repeatsEveryCountController), - returnValue: _FakeTextEditingController_17( + returnValue: _FakeTextEditingController_18( this, Invocation.getter(#repeatsEveryCountController), ), - returnValueForMissingStub: _FakeTextEditingController_17( + returnValueForMissingStub: _FakeTextEditingController_18( this, Invocation.getter(#repeatsEveryCountController), ), @@ -3710,11 +3902,11 @@ class MockCreateEventViewModel extends _i2.Mock @override _i1.TextEditingController get endOccurenceController => (super.noSuchMethod( Invocation.getter(#endOccurenceController), - returnValue: _FakeTextEditingController_17( + returnValue: _FakeTextEditingController_18( this, Invocation.getter(#endOccurenceController), ), - returnValueForMissingStub: _FakeTextEditingController_17( + returnValueForMissingStub: _FakeTextEditingController_18( this, Invocation.getter(#endOccurenceController), ), @@ -3734,11 +3926,11 @@ class MockCreateEventViewModel extends _i2.Mock @override _i1.TimeOfDay get eventStartTime => (super.noSuchMethod( Invocation.getter(#eventStartTime), - returnValue: _FakeTimeOfDay_22( + returnValue: _FakeTimeOfDay_24( this, Invocation.getter(#eventStartTime), ), - returnValueForMissingStub: _FakeTimeOfDay_22( + returnValueForMissingStub: _FakeTimeOfDay_24( this, Invocation.getter(#eventStartTime), ), @@ -3756,11 +3948,11 @@ class MockCreateEventViewModel extends _i2.Mock @override _i1.TimeOfDay get eventEndTime => (super.noSuchMethod( Invocation.getter(#eventEndTime), - returnValue: _FakeTimeOfDay_22( + returnValue: _FakeTimeOfDay_24( this, Invocation.getter(#eventEndTime), ), - returnValueForMissingStub: _FakeTimeOfDay_22( + returnValueForMissingStub: _FakeTimeOfDay_24( this, Invocation.getter(#eventEndTime), ), @@ -3778,11 +3970,11 @@ class MockCreateEventViewModel extends _i2.Mock @override DateTime get eventStartDate => (super.noSuchMethod( Invocation.getter(#eventStartDate), - returnValue: _FakeDateTime_23( + returnValue: _FakeDateTime_25( this, Invocation.getter(#eventStartDate), ), - returnValueForMissingStub: _FakeDateTime_23( + returnValueForMissingStub: _FakeDateTime_25( this, Invocation.getter(#eventStartDate), ), @@ -3800,11 +3992,11 @@ class MockCreateEventViewModel extends _i2.Mock @override DateTime get eventEndDate => (super.noSuchMethod( Invocation.getter(#eventEndDate), - returnValue: _FakeDateTime_23( + returnValue: _FakeDateTime_25( this, Invocation.getter(#eventEndDate), ), - returnValueForMissingStub: _FakeDateTime_23( + returnValueForMissingStub: _FakeDateTime_25( this, Invocation.getter(#eventEndDate), ), @@ -3822,11 +4014,11 @@ class MockCreateEventViewModel extends _i2.Mock @override DateTime get recurrenceStartDate => (super.noSuchMethod( Invocation.getter(#recurrenceStartDate), - returnValue: _FakeDateTime_23( + returnValue: _FakeDateTime_25( this, Invocation.getter(#recurrenceStartDate), ), - returnValueForMissingStub: _FakeDateTime_23( + returnValueForMissingStub: _FakeDateTime_25( this, Invocation.getter(#recurrenceStartDate), ), @@ -3885,11 +4077,11 @@ class MockCreateEventViewModel extends _i2.Mock @override _i1.FocusNode get titleFocus => (super.noSuchMethod( Invocation.getter(#titleFocus), - returnValue: _FakeFocusNode_18( + returnValue: _FakeFocusNode_19( this, Invocation.getter(#titleFocus), ), - returnValueForMissingStub: _FakeFocusNode_18( + returnValueForMissingStub: _FakeFocusNode_19( this, Invocation.getter(#titleFocus), ), @@ -3907,11 +4099,11 @@ class MockCreateEventViewModel extends _i2.Mock @override _i1.FocusNode get locationFocus => (super.noSuchMethod( Invocation.getter(#locationFocus), - returnValue: _FakeFocusNode_18( + returnValue: _FakeFocusNode_19( this, Invocation.getter(#locationFocus), ), - returnValueForMissingStub: _FakeFocusNode_18( + returnValueForMissingStub: _FakeFocusNode_19( this, Invocation.getter(#locationFocus), ), @@ -3929,11 +4121,11 @@ class MockCreateEventViewModel extends _i2.Mock @override _i1.FocusNode get descriptionFocus => (super.noSuchMethod( Invocation.getter(#descriptionFocus), - returnValue: _FakeFocusNode_18( + returnValue: _FakeFocusNode_19( this, Invocation.getter(#descriptionFocus), ), - returnValueForMissingStub: _FakeFocusNode_18( + returnValueForMissingStub: _FakeFocusNode_19( this, Invocation.getter(#descriptionFocus), ), @@ -3983,11 +4175,11 @@ class MockCreateEventViewModel extends _i2.Mock @override String get recurrenceInterval => (super.noSuchMethod( Invocation.getter(#recurrenceInterval), - returnValue: _i18.dummyValue( + returnValue: _i19.dummyValue( this, Invocation.getter(#recurrenceInterval), ), - returnValueForMissingStub: _i18.dummyValue( + returnValueForMissingStub: _i19.dummyValue( this, Invocation.getter(#recurrenceInterval), ), @@ -4005,11 +4197,11 @@ class MockCreateEventViewModel extends _i2.Mock @override String get eventEndType => (super.noSuchMethod( Invocation.getter(#eventEndType), - returnValue: _i18.dummyValue( + returnValue: _i19.dummyValue( this, Invocation.getter(#eventEndType), ), - returnValueForMissingStub: _i18.dummyValue( + returnValueForMissingStub: _i19.dummyValue( this, Invocation.getter(#eventEndType), ), @@ -4027,11 +4219,11 @@ class MockCreateEventViewModel extends _i2.Mock @override String get frequency => (super.noSuchMethod( Invocation.getter(#frequency), - returnValue: _i18.dummyValue( + returnValue: _i19.dummyValue( this, Invocation.getter(#frequency), ), - returnValueForMissingStub: _i18.dummyValue( + returnValueForMissingStub: _i19.dummyValue( this, Invocation.getter(#frequency), ), @@ -4100,11 +4292,11 @@ class MockCreateEventViewModel extends _i2.Mock @override String get recurrenceLabel => (super.noSuchMethod( Invocation.getter(#recurrenceLabel), - returnValue: _i18.dummyValue( + returnValue: _i19.dummyValue( this, Invocation.getter(#recurrenceLabel), ), - returnValueForMissingStub: _i18.dummyValue( + returnValueForMissingStub: _i19.dummyValue( this, Invocation.getter(#recurrenceLabel), ), @@ -4179,11 +4371,11 @@ class MockCreateEventViewModel extends _i2.Mock ) as Map); @override - _i14.ViewState get state => (super.noSuchMethod( + _i15.ViewState get state => (super.noSuchMethod( Invocation.getter(#state), - returnValue: _i14.ViewState.idle, - returnValueForMissingStub: _i14.ViewState.idle, - ) as _i14.ViewState); + returnValue: _i15.ViewState.idle, + returnValueForMissingStub: _i15.ViewState.idle, + ) as _i15.ViewState); @override bool get isBusy => (super.noSuchMethod( @@ -4209,26 +4401,26 @@ class MockCreateEventViewModel extends _i2.Mock ); @override - _i5.Future createEvent() => (super.noSuchMethod( + _i6.Future createEvent() => (super.noSuchMethod( Invocation.method( #createEvent, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future getImageFromGallery({bool? camera = false}) => + _i6.Future getImageFromGallery({bool? camera = false}) => (super.noSuchMethod( Invocation.method( #getImageFromGallery, [], {#camera: camera}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override void removeImage() => super.noSuchMethod( @@ -4240,15 +4432,15 @@ class MockCreateEventViewModel extends _i2.Mock ); @override - _i5.Future> getCurrentOrgUsersList() => (super.noSuchMethod( + _i6.Future> getCurrentOrgUsersList() => (super.noSuchMethod( Invocation.method( #getCurrentOrgUsersList, [], ), - returnValue: _i5.Future>.value(<_i7.User>[]), + returnValue: _i6.Future>.value(<_i7.User>[]), returnValueForMissingStub: - _i5.Future>.value(<_i7.User>[]), - ) as _i5.Future>); + _i6.Future>.value(<_i7.User>[]), + ) as _i6.Future>); @override void buildUserList() => super.noSuchMethod( @@ -4279,18 +4471,18 @@ class MockCreateEventViewModel extends _i2.Mock ); @override - _i5.Future> fetchVenues() => (super.noSuchMethod( + _i6.Future> fetchVenues() => (super.noSuchMethod( Invocation.method( #fetchVenues, [], ), - returnValue: _i5.Future>.value(<_i39.Venue>[]), + returnValue: _i6.Future>.value(<_i42.Venue>[]), returnValueForMissingStub: - _i5.Future>.value(<_i39.Venue>[]), - ) as _i5.Future>); + _i6.Future>.value(<_i42.Venue>[]), + ) as _i6.Future>); @override - void setState(_i14.ViewState? viewState) => super.noSuchMethod( + void setState(_i15.ViewState? viewState) => super.noSuchMethod( Invocation.method( #setState, [viewState], @@ -4339,7 +4531,7 @@ class MockCreateEventViewModel extends _i2.Mock /// /// See the documentation for Mockito's code generation for more information. class MockDirectChatViewModel extends _i2.Mock - implements _i40.DirectChatViewModel { + implements _i43.DirectChatViewModel { @override _i1.GlobalKey<_i1.AnimatedListState> get listKey => (super.noSuchMethod( Invocation.getter(#listKey), @@ -4354,14 +4546,14 @@ class MockDirectChatViewModel extends _i2.Mock ) as _i1.GlobalKey<_i1.AnimatedListState>); @override - _i14.ChatState get chatState => (super.noSuchMethod( + _i15.ChatState get chatState => (super.noSuchMethod( Invocation.getter(#chatState), - returnValue: _i14.ChatState.initial, - returnValueForMissingStub: _i14.ChatState.initial, - ) as _i14.ChatState); + returnValue: _i15.ChatState.initial, + returnValueForMissingStub: _i15.ChatState.initial, + ) as _i15.ChatState); @override - set chatState(_i14.ChatState? _chatState) => super.noSuchMethod( + set chatState(_i15.ChatState? _chatState) => super.noSuchMethod( Invocation.setter( #chatState, _chatState, @@ -4379,26 +4571,26 @@ class MockDirectChatViewModel extends _i2.Mock ); @override - List<_i24.ChatListTileDataModel> get chats => (super.noSuchMethod( + List<_i25.ChatListTileDataModel> get chats => (super.noSuchMethod( Invocation.getter(#chats), - returnValue: <_i24.ChatListTileDataModel>[], - returnValueForMissingStub: <_i24.ChatListTileDataModel>[], - ) as List<_i24.ChatListTileDataModel>); + returnValue: <_i25.ChatListTileDataModel>[], + returnValueForMissingStub: <_i25.ChatListTileDataModel>[], + ) as List<_i25.ChatListTileDataModel>); @override - Map> get chatMessagesByUser => + Map> get chatMessagesByUser => (super.noSuchMethod( Invocation.getter(#chatMessagesByUser), - returnValue: >{}, - returnValueForMissingStub: >{}, - ) as Map>); + returnValue: >{}, + returnValueForMissingStub: >{}, + ) as Map>); @override - _i14.ViewState get state => (super.noSuchMethod( + _i15.ViewState get state => (super.noSuchMethod( Invocation.getter(#state), - returnValue: _i14.ViewState.idle, - returnValueForMissingStub: _i14.ViewState.idle, - ) as _i14.ViewState); + returnValue: _i15.ViewState.idle, + returnValueForMissingStub: _i15.ViewState.idle, + ) as _i15.ViewState); @override bool get isBusy => (super.noSuchMethod( @@ -4424,27 +4616,27 @@ class MockDirectChatViewModel extends _i2.Mock ); @override - _i5.Future initialise() => (super.noSuchMethod( + _i6.Future initialise() => (super.noSuchMethod( Invocation.method( #initialise, [], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future getChatMessages(String? chatId) => (super.noSuchMethod( + _i6.Future getChatMessages(String? chatId) => (super.noSuchMethod( Invocation.method( #getChatMessages, [chatId], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override - _i5.Future sendMessageToDirectChat( + _i6.Future sendMessageToDirectChat( String? chatId, String? messageContent, ) => @@ -4456,9 +4648,9 @@ class MockDirectChatViewModel extends _i2.Mock messageContent, ], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override void dispose() => super.noSuchMethod( @@ -4479,7 +4671,7 @@ class MockDirectChatViewModel extends _i2.Mock ); @override - void setState(_i14.ViewState? viewState) => super.noSuchMethod( + void setState(_i15.ViewState? viewState) => super.noSuchMethod( Invocation.method( #setState, [viewState], @@ -4518,24 +4710,16 @@ class MockDirectChatViewModel extends _i2.Mock /// A class which mocks [ImageCropper]. /// /// See the documentation for Mockito's code generation for more information. -class MockImageCropper extends _i2.Mock implements _i41.ImageCropper { +class MockImageCropper extends _i2.Mock implements _i44.ImageCropper { @override - _i5.Future<_i42.CroppedFile?> cropImage({ + _i6.Future<_i45.CroppedFile?> cropImage({ required String? sourcePath, int? maxWidth, int? maxHeight, - _i42.CropAspectRatio? aspectRatio, - List<_i42.CropAspectRatioPreset>? aspectRatioPresets = const [ - _i42.CropAspectRatioPreset.original, - _i42.CropAspectRatioPreset.square, - _i42.CropAspectRatioPreset.ratio3x2, - _i42.CropAspectRatioPreset.ratio4x3, - _i42.CropAspectRatioPreset.ratio16x9, - ], - _i42.CropStyle? cropStyle = _i42.CropStyle.rectangle, - _i42.ImageCompressFormat? compressFormat = _i42.ImageCompressFormat.jpg, + _i45.CropAspectRatio? aspectRatio, + _i45.ImageCompressFormat? compressFormat = _i45.ImageCompressFormat.jpg, int? compressQuality = 90, - List<_i42.PlatformUiSettings>? uiSettings, + List<_i45.PlatformUiSettings>? uiSettings, }) => (super.noSuchMethod( Invocation.method( @@ -4546,39 +4730,37 @@ class MockImageCropper extends _i2.Mock implements _i41.ImageCropper { #maxWidth: maxWidth, #maxHeight: maxHeight, #aspectRatio: aspectRatio, - #aspectRatioPresets: aspectRatioPresets, - #cropStyle: cropStyle, #compressFormat: compressFormat, #compressQuality: compressQuality, #uiSettings: uiSettings, }, ), - returnValue: _i5.Future<_i42.CroppedFile?>.value(), - returnValueForMissingStub: _i5.Future<_i42.CroppedFile?>.value(), - ) as _i5.Future<_i42.CroppedFile?>); + returnValue: _i6.Future<_i45.CroppedFile?>.value(), + returnValueForMissingStub: _i6.Future<_i45.CroppedFile?>.value(), + ) as _i6.Future<_i45.CroppedFile?>); @override - _i5.Future<_i42.CroppedFile?> recoverImage() => (super.noSuchMethod( + _i6.Future<_i45.CroppedFile?> recoverImage() => (super.noSuchMethod( Invocation.method( #recoverImage, [], ), - returnValue: _i5.Future<_i42.CroppedFile?>.value(), - returnValueForMissingStub: _i5.Future<_i42.CroppedFile?>.value(), - ) as _i5.Future<_i42.CroppedFile?>); + returnValue: _i6.Future<_i45.CroppedFile?>.value(), + returnValueForMissingStub: _i6.Future<_i45.CroppedFile?>.value(), + ) as _i6.Future<_i45.CroppedFile?>); } /// A class which mocks [ImagePicker]. /// /// See the documentation for Mockito's code generation for more information. -class MockImagePicker extends _i2.Mock implements _i13.ImagePicker { +class MockImagePicker extends _i2.Mock implements _i14.ImagePicker { @override - _i5.Future<_i13.XFile?> pickImage({ - required _i13.ImageSource? source, + _i6.Future<_i14.XFile?> pickImage({ + required _i14.ImageSource? source, double? maxWidth, double? maxHeight, int? imageQuality, - _i13.CameraDevice? preferredCameraDevice = _i13.CameraDevice.rear, + _i14.CameraDevice? preferredCameraDevice = _i14.CameraDevice.rear, bool? requestFullMetadata = true, }) => (super.noSuchMethod( @@ -4594,12 +4776,12 @@ class MockImagePicker extends _i2.Mock implements _i13.ImagePicker { #requestFullMetadata: requestFullMetadata, }, ), - returnValue: _i5.Future<_i13.XFile?>.value(), - returnValueForMissingStub: _i5.Future<_i13.XFile?>.value(), - ) as _i5.Future<_i13.XFile?>); + returnValue: _i6.Future<_i14.XFile?>.value(), + returnValueForMissingStub: _i6.Future<_i14.XFile?>.value(), + ) as _i6.Future<_i14.XFile?>); @override - _i5.Future> pickMultiImage({ + _i6.Future> pickMultiImage({ double? maxWidth, double? maxHeight, int? imageQuality, @@ -4618,13 +4800,13 @@ class MockImagePicker extends _i2.Mock implements _i13.ImagePicker { #requestFullMetadata: requestFullMetadata, }, ), - returnValue: _i5.Future>.value(<_i13.XFile>[]), + returnValue: _i6.Future>.value(<_i14.XFile>[]), returnValueForMissingStub: - _i5.Future>.value(<_i13.XFile>[]), - ) as _i5.Future>); + _i6.Future>.value(<_i14.XFile>[]), + ) as _i6.Future>); @override - _i5.Future<_i13.XFile?> pickMedia({ + _i6.Future<_i14.XFile?> pickMedia({ double? maxWidth, double? maxHeight, int? imageQuality, @@ -4641,12 +4823,12 @@ class MockImagePicker extends _i2.Mock implements _i13.ImagePicker { #requestFullMetadata: requestFullMetadata, }, ), - returnValue: _i5.Future<_i13.XFile?>.value(), - returnValueForMissingStub: _i5.Future<_i13.XFile?>.value(), - ) as _i5.Future<_i13.XFile?>); + returnValue: _i6.Future<_i14.XFile?>.value(), + returnValueForMissingStub: _i6.Future<_i14.XFile?>.value(), + ) as _i6.Future<_i14.XFile?>); @override - _i5.Future> pickMultipleMedia({ + _i6.Future> pickMultipleMedia({ double? maxWidth, double? maxHeight, int? imageQuality, @@ -4665,15 +4847,15 @@ class MockImagePicker extends _i2.Mock implements _i13.ImagePicker { #requestFullMetadata: requestFullMetadata, }, ), - returnValue: _i5.Future>.value(<_i13.XFile>[]), + returnValue: _i6.Future>.value(<_i14.XFile>[]), returnValueForMissingStub: - _i5.Future>.value(<_i13.XFile>[]), - ) as _i5.Future>); + _i6.Future>.value(<_i14.XFile>[]), + ) as _i6.Future>); @override - _i5.Future<_i13.XFile?> pickVideo({ - required _i13.ImageSource? source, - _i13.CameraDevice? preferredCameraDevice = _i13.CameraDevice.rear, + _i6.Future<_i14.XFile?> pickVideo({ + required _i14.ImageSource? source, + _i14.CameraDevice? preferredCameraDevice = _i14.CameraDevice.rear, Duration? maxDuration, }) => (super.noSuchMethod( @@ -4686,18 +4868,18 @@ class MockImagePicker extends _i2.Mock implements _i13.ImagePicker { #maxDuration: maxDuration, }, ), - returnValue: _i5.Future<_i13.XFile?>.value(), - returnValueForMissingStub: _i5.Future<_i13.XFile?>.value(), - ) as _i5.Future<_i13.XFile?>); + returnValue: _i6.Future<_i14.XFile?>.value(), + returnValueForMissingStub: _i6.Future<_i14.XFile?>.value(), + ) as _i6.Future<_i14.XFile?>); @override - _i5.Future<_i13.LostDataResponse> retrieveLostData() => (super.noSuchMethod( + _i6.Future<_i14.LostDataResponse> retrieveLostData() => (super.noSuchMethod( Invocation.method( #retrieveLostData, [], ), returnValue: - _i5.Future<_i13.LostDataResponse>.value(_FakeLostDataResponse_24( + _i6.Future<_i14.LostDataResponse>.value(_FakeLostDataResponse_26( this, Invocation.method( #retrieveLostData, @@ -4705,17 +4887,17 @@ class MockImagePicker extends _i2.Mock implements _i13.ImagePicker { ), )), returnValueForMissingStub: - _i5.Future<_i13.LostDataResponse>.value(_FakeLostDataResponse_24( + _i6.Future<_i14.LostDataResponse>.value(_FakeLostDataResponse_26( this, Invocation.method( #retrieveLostData, [], ), )), - ) as _i5.Future<_i13.LostDataResponse>); + ) as _i6.Future<_i14.LostDataResponse>); @override - bool supportsImageSource(_i13.ImageSource? source) => (super.noSuchMethod( + bool supportsImageSource(_i14.ImageSource? source) => (super.noSuchMethod( Invocation.method( #supportsImageSource, [source], diff --git a/test/service_tests/image_service_test.dart b/test/service_tests/image_service_test.dart index 399fbda7b..2abc6365a 100644 --- a/test/service_tests/image_service_test.dart +++ b/test/service_tests/image_service_test.dart @@ -45,10 +45,6 @@ void main() { when( mockImageCropper.cropImage( sourcePath: "test", - aspectRatioPresets: [ - CropAspectRatioPreset.square, - CropAspectRatioPreset.original, - ], uiSettings: anyNamed('uiSettings'), ), ).thenAnswer((realInvocation) async => croppedFile); @@ -65,10 +61,6 @@ void main() { when( mockImageCropper.cropImage( sourcePath: "test", - aspectRatioPresets: [ - CropAspectRatioPreset.square, - CropAspectRatioPreset.original, - ], uiSettings: anyNamed('uiSettings'), ), ).thenThrow(Exception()); diff --git a/test/service_tests/multi_media_pick_service_test.dart b/test/service_tests/multi_media_pick_service_test.dart index 10e93b76e..f7258456a 100644 --- a/test/service_tests/multi_media_pick_service_test.dart +++ b/test/service_tests/multi_media_pick_service_test.dart @@ -41,10 +41,6 @@ void main() { when( mockImageCropper.cropImage( sourcePath: "test", - aspectRatioPresets: [ - CropAspectRatioPreset.square, - CropAspectRatioPreset.original, - ], uiSettings: anyNamed('uiSettings'), ), ).thenAnswer((realInvocation) async => CroppedFile(path)); @@ -65,10 +61,6 @@ void main() { when( mockImageCropper.cropImage( sourcePath: "test", - aspectRatioPresets: [ - CropAspectRatioPreset.square, - CropAspectRatioPreset.original, - ], uiSettings: anyNamed('uiSettings'), ), ).thenAnswer((realInvocation) async => CroppedFile(path)); diff --git a/test/view_model_tests/pre_auth_view_models/set_url_view_model_test.dart b/test/view_model_tests/pre_auth_view_models/set_url_view_model_test.dart index c7640a9fe..14aa84958 100644 --- a/test/view_model_tests/pre_auth_view_models/set_url_view_model_test.dart +++ b/test/view_model_tests/pre_auth_view_models/set_url_view_model_test.dart @@ -3,8 +3,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:hive/hive.dart'; +import 'package:mobile_scanner/mobile_scanner.dart'; import 'package:mockito/mockito.dart'; -import 'package:qr_code_scanner/qr_code_scanner.dart'; import 'package:qr_flutter/qr_flutter.dart'; import 'package:talawa/constants/custom_theme.dart'; import 'package:talawa/enums/enums.dart'; @@ -207,9 +207,9 @@ Future main() async { testWidgets( 'Check if checkURLandShowPopUp() is working fine when urlPresent is false', (tester) async { - //await locator.unregister(); + // await locator.unregister(); final service = MockValidator(); - //locator.registerSingleton(service); + // locator.registerSingleton(service); await tester.pumpWidget(Form(key: model.formKey, child: Container())); @@ -233,7 +233,7 @@ Future main() async { await tester.pump(); expect(find.byType(ClipRRect), findsOneWidget); - expect(find.byType(QRView), findsOneWidget); + expect(find.byType(MobileScanner), findsOneWidget); }); testWidgets('Check if _onQRViewCreated() is working fine', (tester) async { @@ -244,20 +244,31 @@ Future main() async { ), ); - final controller = MockQRViewController(); - when(controller.scannedDataStream).thenAnswer((_) async* { - yield Barcode('qr?orgId=1&scan', BarcodeFormat.qrcode, null); - }); + final controller = MockMobileScannerController(); + + when(controller.barcodes).thenAnswer( + (_) => Stream.fromIterable([ + const BarcodeCapture( + barcodes: [ + Barcode( + displayValue: 'qr?orgId=1&scan', + format: BarcodeFormat.qrCode, + ), + ], + ), + ]), + ); await tester.tap(find.byType(FloatingActionButton)); await tester.pump(); - (tester.widget(find.byType(QRView)) as QRView) - .onQRViewCreated(controller); + (tester.widget(find.byType(MobileScanner)) as MobileScanner) + .controller! + .start(); }); testWidgets( - 'Check if _onQRViewCreated() is working fine when throws CameraException', + 'Check if _onQRViewCreated() is working fine when throws MobileScannerException', (tester) async { await tester.pumpWidget( MaterialApp( @@ -266,20 +277,31 @@ Future main() async { ), ); - final controller = MockQRViewController(); - when(controller.scannedDataStream).thenAnswer((_) async* { - yield Barcode('qr?orgId=1&scan', BarcodeFormat.qrcode, null); - }); - // when(controller.stopCamera()) - // .thenThrow(Exception({"errorType": "error"})); + final controller = MockMobileScannerController(); + when(controller.barcodes).thenAnswer( + (_) => Stream.fromIterable([ + const BarcodeCapture( + barcodes: [ + Barcode( + displayValue: 'qr?orgId=1&scan', + format: BarcodeFormat.qrCode, + ), + ], + ), + ]), + ); - when(controller.stopCamera()) - .thenThrow(CameraException("200", "cameraException")); + when(controller.stop()).thenThrow( + const MobileScannerException( + errorCode: MobileScannerErrorCode.controllerUninitialized, + ), + ); await tester.tap(find.byType(FloatingActionButton)); await tester.pump(); - (tester.widget(find.byType(QRView)) as QRView) - .onQRViewCreated(controller); + (tester.widget(find.byType(MobileScanner)) as MobileScanner) + .controller! + .start(); }); testWidgets( 'Check if _onQRViewCreated() is working fine when throws QrEmbeddedImageException', @@ -291,20 +313,28 @@ Future main() async { ), ); - final controller = MockQRViewController(); - when(controller.scannedDataStream).thenAnswer((_) async* { - yield Barcode('qr?orgId=1&scan', BarcodeFormat.qrcode, null); - }); - // when(controller.stopCamera()) - // .thenThrow(Exception({"errorType": "error"})); + final controller = MockMobileScannerController(); + when(controller.barcodes).thenAnswer( + (_) => Stream.fromIterable([ + const BarcodeCapture( + barcodes: [ + Barcode( + displayValue: 'qr?orgId=1&scan', + format: BarcodeFormat.qrCode, + ), + ], + ), + ]), + ); + + when(controller.stop()).thenThrow(QrEmbeddedImageException("error")); - when(controller.stopCamera()) - .thenThrow(QrEmbeddedImageException("error")); await tester.tap(find.byType(FloatingActionButton)); await tester.pump(); - (tester.widget(find.byType(QRView)) as QRView) - .onQRViewCreated(controller); + (tester.widget(find.byType(MobileScanner)) as MobileScanner) + .controller! + .start(); }); testWidgets( 'Check if _onQRViewCreated() is working fine when throws QrUnsupportedVersionException', @@ -316,19 +346,28 @@ Future main() async { ), ); - final controller = MockQRViewController(); - when(controller.scannedDataStream).thenAnswer((_) async* { - yield Barcode('qr?orgId=1&scan', BarcodeFormat.qrcode, null); - }); - // when(controller.stopCamera()) - // .thenThrow(Exception({"errorType": "error"})); + final controller = MockMobileScannerController(); + when(controller.barcodes).thenAnswer( + (_) => Stream.fromIterable([ + const BarcodeCapture( + barcodes: [ + Barcode( + displayValue: 'qr?orgId=1&scan', + format: BarcodeFormat.qrCode, + ), + ], + ), + ]), + ); + + when(controller.stop()).thenThrow(QrUnsupportedVersionException(0)); - when(controller.stopCamera()).thenThrow(QrUnsupportedVersionException(0)); await tester.tap(find.byType(FloatingActionButton)); await tester.pump(); - (tester.widget(find.byType(QRView)) as QRView) - .onQRViewCreated(controller); + (tester.widget(find.byType(MobileScanner)) as MobileScanner) + .controller! + .start(); }); testWidgets( 'Check if _onQRViewCreated() is working fine when throws Exception', @@ -340,19 +379,27 @@ Future main() async { ), ); - final controller = MockQRViewController(); - when(controller.scannedDataStream).thenAnswer((_) async* { - yield Barcode('qr?orgId=1&scan', BarcodeFormat.qrcode, null); - }); - // when(controller.stopCamera()) - // .thenThrow(Exception({"errorType": "error"})); + final controller = MockMobileScannerController(); + when(controller.barcodes).thenAnswer( + (_) => Stream.fromIterable([ + const BarcodeCapture( + barcodes: [ + Barcode( + displayValue: 'qr?orgId=1&scan', + format: BarcodeFormat.qrCode, + ), + ], + ), + ]), + ); - when(controller.stopCamera()).thenThrow(Exception(0)); + when(controller.stop()).thenThrow(Exception(0)); await tester.tap(find.byType(FloatingActionButton)); await tester.pump(); - (tester.widget(find.byType(QRView)) as QRView) - .onQRViewCreated(controller); + (tester.widget(find.byType(MobileScanner)) as MobileScanner) + .controller! + .start(); }); }); } diff --git a/test/views/after_auth_screens/join_org_after_auth_test/join_organisation_after_auth_test.dart b/test/views/after_auth_screens/join_org_after_auth_test/join_organisation_after_auth_test.dart index c2ac42036..2a224b79d 100644 --- a/test/views/after_auth_screens/join_org_after_auth_test/join_organisation_after_auth_test.dart +++ b/test/views/after_auth_screens/join_org_after_auth_test/join_organisation_after_auth_test.dart @@ -4,8 +4,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; +// import 'package:qr_code_scanner/qr_code_scanner.dart'; +import 'package:mobile_scanner/mobile_scanner.dart'; import 'package:mockito/mockito.dart'; -import 'package:qr_code_scanner/qr_code_scanner.dart'; import 'package:talawa/enums/enums.dart'; import 'package:talawa/models/organization/org_info.dart'; import 'package:talawa/models/user/user_info.dart'; @@ -59,16 +60,22 @@ void main() { group("Tests for JoinOrganizationAfterAuth - widgets", () { testWidgets('QR Scan Test', (WidgetTester tester) async { - final controller = MockQRViewController(); - when(controller.scannedDataStream).thenAnswer((_) async* { - yield Barcode( - ' ' + '?orgid=6737904485008f171cf29924', - BarcodeFormat.qrcode, - null, - ); - }); - when(controller.stopCamera()) - .thenAnswer((realInvocation) => Future.value()); + final controller = MockMobileScannerController(); + + when(controller.barcodes).thenAnswer( + (_) => Stream.fromIterable([ + const BarcodeCapture( + barcodes: [ + Barcode( + displayValue: ' ' + '?orgid=6737904485008f171cf29924', + format: BarcodeFormat.qrCode, + ), + ], + ), + ]), + ); + + when(controller.stop()).thenAnswer((realInvocation) => Future.value()); await tester.pumpWidget( createJoinOrgAfterAuth(), @@ -88,21 +95,27 @@ void main() { ), findsOneWidget, ); - (tester.widget(find.byType(QRView)) as QRView) - .onQRViewCreated(controller); + (tester.widget(find.byType(MobileScanner)) as MobileScanner) + .controller! + .start(); }); testWidgets('QR Scan Test when url != GraphqlConfig.orgURI', (WidgetTester tester) async { - final controller = MockQRViewController(); - when(controller.scannedDataStream).thenAnswer((_) async* { - yield Barcode( - '1' + '?orgid=6737904485008f171cf29924', - BarcodeFormat.qrcode, - null, - ); - }); - when(controller.stopCamera()) - .thenAnswer((realInvocation) => Future.value()); + final controller = MockMobileScannerController(); + when(controller.barcodes).thenAnswer( + (_) => Stream.fromIterable([ + const BarcodeCapture( + barcodes: [ + Barcode( + displayValue: '1' + '?orgid=6737904485008f171cf29924', + format: BarcodeFormat.qrCode, + ), + ], + ), + ]), + ); + + when(controller.stop()).thenAnswer((realInvocation) => Future.value()); await tester.pumpWidget( createJoinOrgAfterAuth(), @@ -122,34 +135,41 @@ void main() { ), findsOneWidget, ); - (tester.widget(find.byType(QRView)) as QRView) - .onQRViewCreated(controller); + (tester.widget(find.byType(MobileScanner)) as MobileScanner) + .controller! + .start(); }); testWidgets('Test _onQRViewCreated when throwing exception', (WidgetTester tester) async { - final controller = MockQRViewController(); - when(controller.scannedDataStream).thenAnswer((_) async* { - yield Barcode( - ' ' + '?orgid=6737904485008f171cf29924', - BarcodeFormat.qrcode, - null, - ); - }); - when(controller.stopCamera()) - .thenAnswer((realInvocation) => Future.value()); + final controller = MockMobileScannerController(); + when(controller.barcodes).thenAnswer( + (_) => Stream.fromIterable([ + const BarcodeCapture( + barcodes: [ + Barcode( + displayValue: ' ' + '?orgid=6737904485008f171cf29924', + format: BarcodeFormat.qrCode, + ), + ], + ), + ]), + ); + + when(controller.stop()).thenAnswer((realInvocation) => Future.value()); await tester.pumpWidget( createJoinOrgAfterAuth(), ); - when(controller.stopCamera()).thenThrow(Exception("exception")); + when(controller.stop()).thenThrow(Exception("exception")); await tester.pumpAndSettle(const Duration(seconds: 6)); await tester.tap(find.byIcon(Icons.qr_code_scanner)); await tester.pumpAndSettle(); - (tester.widget(find.byType(QRView)) as QRView) - .onQRViewCreated(controller); + (tester.widget(find.byType(MobileScanner)) as MobileScanner) + .controller! + .start(); }); testWidgets( "Check if JoinOrganizationsAfterAuth shows up", diff --git a/test/widget_tests/pre_auth_screens/set_url_page_test.dart b/test/widget_tests/pre_auth_screens/set_url_page_test.dart index 8633a7dd2..5f9d4a9db 100644 --- a/test/widget_tests/pre_auth_screens/set_url_page_test.dart +++ b/test/widget_tests/pre_auth_screens/set_url_page_test.dart @@ -3,7 +3,8 @@ import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; -import 'package:qr_code_scanner/qr_code_scanner.dart'; +// import 'package:qr_code_scanner/qr_code_scanner.dart'; +import 'package:mobile_scanner/mobile_scanner.dart'; import 'package:talawa/constants/custom_theme.dart'; import 'package:talawa/locator.dart'; import 'package:talawa/router.dart' as router; @@ -522,7 +523,7 @@ Future main() async { await tester.pumpAndSettle(); expect(find.byType(ClipRRect), findsOneWidget); - expect(find.byType(QRView), findsOneWidget); + expect(find.byType(MobileScanner), findsOneWidget); }); testWidgets("Testing if app logo shows up", (tester) async { //pushing setUrlScreen From 996322852f0f7fbd6f0ec4527a45205154de5976 Mon Sep 17 00:00:00 2001 From: MukalDadhwal Date: Sat, 25 Jan 2025 03:21:13 +0530 Subject: [PATCH 3/5] fixed file formating --- lib/services/graphql_config.dart | 2 - .../set_url_view_model.dart | 1 - .../pre_auth_screens/splash_screen_test.dart | 110 +++++++++--------- 3 files changed, 55 insertions(+), 58 deletions(-) diff --git a/lib/services/graphql_config.dart b/lib/services/graphql_config.dart index 5d77768ba..374485d08 100644 --- a/lib/services/graphql_config.dart +++ b/lib/services/graphql_config.dart @@ -17,8 +17,6 @@ class GraphqlConfig { late HttpLink httpLink; late WebSocketLink webSocketLink; - - //prefix route for showing images String? displayImgRoute; diff --git a/lib/view_model/pre_auth_view_models/set_url_view_model.dart b/lib/view_model/pre_auth_view_models/set_url_view_model.dart index 387393b36..6719a67a0 100644 --- a/lib/view_model/pre_auth_view_models/set_url_view_model.dart +++ b/lib/view_model/pre_auth_view_models/set_url_view_model.dart @@ -278,7 +278,6 @@ class SetUrlViewModel extends BaseModel { onDetect: _onQRViewCreated, ), ), - SizedBox( height: SizeConfig.safeBlockVertical! * 4, ), diff --git a/test/widget_tests/pre_auth_screens/splash_screen_test.dart b/test/widget_tests/pre_auth_screens/splash_screen_test.dart index f4899e078..c3d4801ff 100644 --- a/test/widget_tests/pre_auth_screens/splash_screen_test.dart +++ b/test/widget_tests/pre_auth_screens/splash_screen_test.dart @@ -289,99 +289,99 @@ void main() { (tester.firstWidget(findProviderNameWidget) as Text).style!.fontFamily, TalawaTheme.darkTheme.textTheme.titleSmall!.fontFamily, ); - }); + }); }); group("URI Link Handling Tests", () { testWidgets("should handle initial URI successfully", (tester) async { - // Arrange - final uri = Uri.parse('talawa://example.com'); - when(mockAppLinks.getInitialLink()).thenAnswer((_) async => uri); - when(mockAppLinks.uriLinkStream).thenAnswer((_) => Stream.value(uri)); - - // Act: Pump the widget - await tester.pumpWidget(createSplashScreenLight()); - await tester.pumpAndSettle(); - - // Assert - verify(mockAppLinks.getInitialLink()).called(1); - expect(find.byKey(const Key('SplashScreenScaffold')), findsOneWidget); + // Arrange + final uri = Uri.parse('talawa://example.com'); + when(mockAppLinks.getInitialLink()).thenAnswer((_) async => uri); + when(mockAppLinks.uriLinkStream).thenAnswer((_) => Stream.value(uri)); + + // Act: Pump the widget + await tester.pumpWidget(createSplashScreenLight()); + await tester.pumpAndSettle(); + + // Assert + verify(mockAppLinks.getInitialLink()).called(1); + expect(find.byKey(const Key('SplashScreenScaffold')), findsOneWidget); }); testWidgets('should handle URI stream updates', (tester) async { // await tester.runAsync(() async { - // Arrange - final uri = Uri.parse('talawa://example.com'); - when(mockAppLinks.uriLinkStream).thenAnswer((_) => Stream.value(uri)); - when(mockUserConfig.loggedIn).thenReturn(true); + // Arrange + final uri = Uri.parse('talawa://example.com'); + when(mockAppLinks.uriLinkStream).thenAnswer((_) => Stream.value(uri)); + when(mockUserConfig.loggedIn).thenReturn(true); - // Act - await tester.pumpWidget(createSplashScreenLight()); - await tester.pumpAndSettle(); + // Act + await tester.pumpWidget(createSplashScreenLight()); + await tester.pumpAndSettle(); - // Assert - verify(mockAppLinks.uriLinkStream).called(1); + // Assert + verify(mockAppLinks.uriLinkStream).called(1); // }); }); testWidgets("should handle PlatformException when getting initial URI", (tester) async { // await tester.runAsync(() async { - // Arrange - when(mockAppLinks.getInitialLink()) - .thenThrow(PlatformException(code: 'TEST_ERROR')); + // Arrange + when(mockAppLinks.getInitialLink()) + .thenThrow(PlatformException(code: 'TEST_ERROR')); when(mockAppLinks.uriLinkStream).thenAnswer((_) => const Stream.empty()); - // Act - await tester.pumpWidget(createSplashScreenLight()); - await tester.pumpAndSettle(); + // Act + await tester.pumpWidget(createSplashScreenLight()); + await tester.pumpAndSettle(); - // Assert - verify(mockAppLinks.getInitialLink()).called(1); + // Assert + verify(mockAppLinks.getInitialLink()).called(1); // }); }); testWidgets("should handle FormatException when getting initial URI", (tester) async { // await tester.runAsync(() async { - // Arrange - when(mockAppLinks.getInitialLink()) - .thenThrow(const FormatException('Invalid URI format')); + // Arrange + when(mockAppLinks.getInitialLink()) + .thenThrow(const FormatException('Invalid URI format')); when(mockAppLinks.uriLinkStream).thenAnswer((_) => const Stream.empty()); - // Act - await tester.pumpWidget(createSplashScreenLight()); - await tester.pumpAndSettle(); + // Act + await tester.pumpWidget(createSplashScreenLight()); + await tester.pumpAndSettle(); - // Assert - verify(mockAppLinks.getInitialLink()).called(1); + // Assert + verify(mockAppLinks.getInitialLink()).called(1); // }); }); testWidgets('should handle URI stream errors', (tester) async { // await tester.runAsync(() async { - // Arrange - when(mockAppLinks.uriLinkStream) - .thenAnswer((_) => Stream.error('Test error')); - when(mockUserConfig.loggedIn).thenReturn(true); + // Arrange + when(mockAppLinks.uriLinkStream) + .thenAnswer((_) => Stream.error('Test error')); + when(mockUserConfig.loggedIn).thenReturn(true); - // Act - await tester.pumpWidget(createSplashScreenLight()); - await tester.pumpAndSettle(); + // Act + await tester.pumpWidget(createSplashScreenLight()); + await tester.pumpAndSettle(); - // Assert - verify(mockAppLinks.uriLinkStream).called(1); + // Assert + verify(mockAppLinks.uriLinkStream).called(1); // }); }); testWidgets('should cleanup stream subscription on dispose', (tester) async { // await tester.runAsync(() async { - // Arrange - when(mockUserConfig.loggedIn).thenReturn(true); - when(mockAppLinks.uriLinkStream) - .thenAnswer((_) => Stream.value(Uri.parse('talawa://example.com'))); + // Arrange + when(mockUserConfig.loggedIn).thenReturn(true); + when(mockAppLinks.uriLinkStream) + .thenAnswer((_) => Stream.value(Uri.parse('talawa://example.com'))); - // Act - await tester.pumpWidget(createSplashScreenLight()); - await tester.pumpWidget(Container()); // Force dispose + // Act + await tester.pumpWidget(createSplashScreenLight()); + await tester.pumpWidget(Container()); // Force dispose - // No explicit assert needed - test will fail if subscription isn't properly canceled + // No explicit assert needed - test will fail if subscription isn't properly canceled // }); }); }); From 0f8c436255ff652b67892606aaa9e867698ee8d6 Mon Sep 17 00:00:00 2001 From: MukalDadhwal Date: Sat, 25 Jan 2025 12:18:48 +0530 Subject: [PATCH 4/5] fixed linting issues --- .../chats/chat_list_tile_data_model.g.dart | 6 +- pubspec.lock | 364 +++++++++--------- .../pre_auth_screens/set_url_page_test.dart | 3 +- 3 files changed, 183 insertions(+), 190 deletions(-) diff --git a/lib/models/chats/chat_list_tile_data_model.g.dart b/lib/models/chats/chat_list_tile_data_model.g.dart index b50e3025e..200e51549 100644 --- a/lib/models/chats/chat_list_tile_data_model.g.dart +++ b/lib/models/chats/chat_list_tile_data_model.g.dart @@ -7,7 +7,8 @@ part of 'chat_list_tile_data_model.dart'; // ************************************************************************** ChatListTileDataModel _$ChatListTileDataModelFromJson( - Map json) => + Map json, +) => ChatListTileDataModel( (json['users'] as List?) ?.map((e) => ChatUser.fromJson(e as Map)) @@ -16,7 +17,8 @@ ChatListTileDataModel _$ChatListTileDataModelFromJson( ); Map _$ChatListTileDataModelToJson( - ChatListTileDataModel instance) => + ChatListTileDataModel instance, +) => { 'users': instance.users, 'id': instance.id, diff --git a/pubspec.lock b/pubspec.lock index d4ddad7f4..76358dfcb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 url: "https://pub.dev" source: hosted - version: "67.0.0" + version: "64.0.0" analyzer: dependency: transitive description: name: analyzer - sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" url: "https://pub.dev" source: hosted - version: "6.4.1" + version: "6.2.0" analyzer_plugin: dependency: transitive description: @@ -61,10 +61,10 @@ packages: dependency: transitive description: name: args - sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 url: "https://pub.dev" source: hosted - version: "2.6.0" + version: "2.4.2" async: dependency: transitive description: @@ -109,10 +109,10 @@ packages: dependency: transitive description: name: build_daemon - sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" + sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "4.0.1" build_resolvers: dependency: transitive description: @@ -133,10 +133,10 @@ packages: dependency: transitive description: name: build_runner_core - sha256: e3c79f69a64bdfcd8a776a3c28db4eb6e3fb5356d013ae5eb2e52007706d5dbe + sha256: c9e32d21dd6626b5c163d48b037ce906bbe428bc23ab77bcd77bb21e593b6185 url: "https://pub.dev" source: hosted - version: "7.3.1" + version: "7.2.11" built_collection: dependency: transitive description: @@ -149,10 +149,10 @@ packages: dependency: transitive description: name: built_value - sha256: "28a712df2576b63c6c005c465989a348604960c0958d28be5303ba9baa841ac2" + sha256: c9aabae0718ec394e5bc3c7272e6bb0dc0b32201a08fe185ec1d8401d3e39309 url: "https://pub.dev" source: hosted - version: "8.9.3" + version: "8.8.1" cached_network_image: dependency: "direct main" description: @@ -205,10 +205,10 @@ packages: dependency: transitive description: name: cli_util - sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 url: "https://pub.dev" source: hosted - version: "0.4.2" + version: "0.4.1" clock: dependency: "direct main" description: @@ -237,10 +237,10 @@ packages: dependency: "direct main" description: name: connectivity_plus - sha256: "8a68739d3ee113e51ad35583fdf9ab82c55d09d693d3c39da1aebab87c938412" + sha256: e0817759ec6d2d8e57eb234e6e57d2173931367a865850c7acea40d4b4f9c27d url: "https://pub.dev" source: hosted - version: "6.1.2" + version: "6.1.1" connectivity_plus_platform_interface: dependency: transitive description: @@ -269,10 +269,10 @@ packages: dependency: transitive description: name: convert - sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.1" cross_file: dependency: transitive description: @@ -285,18 +285,18 @@ packages: dependency: "direct main" description: name: crypto - sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 url: "https://pub.dev" source: hosted - version: "3.0.6" + version: "3.0.5" csslib: dependency: transitive description: name: csslib - sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" + sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.0.0" cupertino_icons: dependency: "direct main" description: @@ -325,34 +325,34 @@ packages: dependency: transitive description: name: custom_lint_builder - sha256: badc07d7737b71e9a9f960f53463f06e09cc6ccdaa1779623015eaf9f9ee8410 + sha256: "8df6634b38a36a6c6cb74a9c0eb02e9ba0b0ab89b29e38e6daa86e8ed2c6288d" url: "https://pub.dev" source: hosted - version: "0.5.10" + version: "0.5.8" custom_lint_core: dependency: transitive description: name: custom_lint_core - sha256: bfcc6b518c54d386ad0647ad7a4f415b4db3ea270d09fd9b7f4a1a2df07c3d84 + sha256: "2b235be098d157e244f18ea905a15a18c16a205e30553888fac6544bbf52f03f" url: "https://pub.dev" source: hosted - version: "0.5.10" + version: "0.5.8" dart_style: dependency: transitive description: name: dart_style - sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" + sha256: "40ae61a5d43feea6d24bd22c0537a6629db858963b99b4bc1c3db80676f32368" url: "https://pub.dev" source: hosted - version: "2.3.6" + version: "2.3.4" dbus: dependency: transitive description: name: dbus - sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" url: "https://pub.dev" source: hosted - version: "0.7.11" + version: "0.7.10" delightful_toast: dependency: "direct main" description: @@ -365,18 +365,18 @@ packages: dependency: transitive description: name: device_info_plus - sha256: b37d37c2f912ad4e8ec694187de87d05de2a3cb82b465ff1f65f65a2d05de544 + sha256: "093b02a284b4969bb641a6236bbb8e626e4035c6ec9e30c20b65d505c24b3080" url: "https://pub.dev" source: hosted - version: "11.2.1" + version: "10.0.0" device_info_plus_platform_interface: dependency: transitive description: name: device_info_plus_platform_interface - sha256: "0b04e02b30791224b31969eb1b50d723498f402971bff3630bca2ba839bd1ed2" + sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64 url: "https://pub.dev" source: hosted - version: "7.0.2" + version: "7.0.0" fake_async: dependency: "direct dev" description: @@ -405,18 +405,18 @@ packages: dependency: transitive description: name: file_selector_linux - sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33" + sha256: "045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492" url: "https://pub.dev" source: hosted - version: "0.9.3+2" + version: "0.9.2+1" file_selector_macos: dependency: transitive description: name: file_selector_macos - sha256: "271ab9986df0c135d45c3cdb6bd0faa5db6f4976d3e4b437cf7d0f258d941bfc" + sha256: b15c3da8bd4908b9918111fa486903f5808e388b8d1c559949f584725a6594d6 url: "https://pub.dev" source: hosted - version: "0.9.4+2" + version: "0.9.3+3" file_selector_platform_interface: dependency: transitive description: @@ -429,18 +429,18 @@ packages: dependency: transitive description: name: file_selector_windows - sha256: "8f5d2f6590d51ecd9179ba39c64f722edc15226cc93dcc8698466ad36a4a85a4" + sha256: d3547240c20cabf205c7c7f01a50ecdbc413755814d6677f3cb366f04abcead0 url: "https://pub.dev" source: hosted - version: "0.9.3+3" + version: "0.9.3+1" fixnum: dependency: transitive description: name: fixnum - sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -450,10 +450,10 @@ packages: dependency: transitive description: name: flutter_animate - sha256: "7befe2d3252728afb77aecaaea1dec88a89d35b9b1d2eea6d04479e8af9117b5" + sha256: "7c8a6594a9252dad30cc2ef16e33270b6248c4dedc3b3d06c86c4f3f4dc05ae5" url: "https://pub.dev" source: hosted - version: "4.5.2" + version: "4.5.0" flutter_braintree: dependency: "direct main" description: @@ -474,10 +474,10 @@ packages: dependency: transitive description: name: flutter_hooks - sha256: cde36b12f7188c85286fba9b38cc5a902e7279f36dd676967106c041dc9dde70 + sha256: "09f64db63fee3b2ab8b9038a1346be7d8986977fae3fec601275bf32455ccfc0" url: "https://pub.dev" source: hosted - version: "0.20.5" + version: "0.20.4" flutter_local_notifications: dependency: "direct main" description: @@ -511,10 +511,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "9ee02950848f61c4129af3d6ec84a1cfc0e47931abc746b03e7a3bc3e8ff6eda" + sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da url: "https://pub.dev" source: hosted - version: "2.0.22" + version: "2.0.17" flutter_reaction_button: dependency: "direct main" description: @@ -575,10 +575,10 @@ packages: dependency: transitive description: name: flutter_shaders - sha256: "34794acadd8275d971e02df03afee3dee0f98dbfb8c4837082ad0034f612a3e2" + sha256: "02750b545c01ff4d8e9bbe8f27a7731aa3778402506c67daa1de7f5fc3f4befe" url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "0.1.2" flutter_speed_dial: dependency: "direct main" description: @@ -591,10 +591,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: c200fd79c918a40c5cd50ea0877fa13f81bdaf6f0a5d3dbcc2a13e3285d6aa1b + sha256: "54900a1a1243f3c4a5506d853a2b5c2dbc38d5f27e52a52618a8054401431123" url: "https://pub.dev" source: hosted - version: "2.0.17" + version: "2.0.16" flutter_test: dependency: "direct dev" description: flutter @@ -617,18 +617,18 @@ packages: dependency: transitive description: name: freezed_annotation - sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 + sha256: c3fd9336eb55a38cc1bbd79ab17573113a8deccd0ecbbf926cca3c62803b5c2d url: "https://pub.dev" source: hosted - version: "2.4.4" + version: "2.4.1" frontend_server_client: dependency: transitive description: name: frontend_server_client - sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "3.2.0" get_it: dependency: "direct main" description: @@ -641,26 +641,26 @@ packages: dependency: transitive description: name: glob - sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.2" gql: dependency: transitive description: name: gql - sha256: "650e79ed60c21579ca3bd17ebae8a8c8d22cde267b03a19bf3b35996baaa843a" + sha256: "0bdd22c3a9464970ae590559e4f0568769b219dda9e94cb10c4cf999a3e263f7" url: "https://pub.dev" source: hosted - version: "1.0.1-alpha+1730759315362" + version: "1.0.1-alpha+1705114622973" gql_dedupe_link: dependency: transitive description: name: gql_dedupe_link - sha256: "10bee0564d67c24e0c8bd08bd56e0682b64a135e58afabbeed30d85d5e9fea96" + sha256: e5359dd0c7a38f95e2b12f6ab305989a4e30028e4032825c8e9f610150999c69 url: "https://pub.dev" source: hosted - version: "2.0.4-alpha+1715521079596" + version: "2.0.4-alpha+1705114623057" gql_error_link: dependency: transitive description: @@ -681,18 +681,18 @@ packages: dependency: transitive description: name: gql_http_link - sha256: ef6ad24d31beb5a30113e9b919eec20876903cc4b0ee0d31550047aaaba7d5dd + sha256: "1f922eed1b7078fdbfd602187663026f9f659fe9a9499e2207b5d5e01617f658" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.0.1+1" gql_link: dependency: transitive description: name: gql_link - sha256: c2b0adb2f6a60c2599b9128fb095316db5feb99ce444c86fb141a6964acedfa4 + sha256: "63941513a688d856546f0c3218e7ad94d47fc6e04662dcdb06de92a4cde2d7db" url: "https://pub.dev" source: hosted - version: "1.0.1-alpha+1730759315378" + version: "1.0.1-alpha+1705114622987" gql_transform_link: dependency: transitive description: @@ -705,10 +705,10 @@ packages: dependency: transitive description: name: graphql - sha256: c715080993c8481087ce77b7929224222551823769fb150f5816f9bbbee9e589 + sha256: b90f3faa525fed0d8b57f528af913cf1363e1d77f287004d3a15ce699fa866ee url: "https://pub.dev" source: hosted - version: "5.2.0-beta.10" + version: "5.2.0-beta.9" graphql_flutter: dependency: "direct main" description: @@ -721,10 +721,10 @@ packages: dependency: transitive description: name: graphs - sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.1" gtk: dependency: transitive description: @@ -753,34 +753,34 @@ packages: dependency: transitive description: name: hotreloader - sha256: bc167a1163807b03bada490bfe2df25b0d744df359227880220a5cbd04e5734b + sha256: ed56fdc1f3a8ac924e717257621d09e9ec20e308ab6352a73a50a1d7a4d9158e url: "https://pub.dev" source: hosted - version: "4.3.0" + version: "4.2.0" html: dependency: transitive description: name: html - sha256: "1fc58edeaec4307368c60d59b7e15b9d658b57d7f3125098b6294153c75337ec" + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" url: "https://pub.dev" source: hosted - version: "0.15.5" + version: "0.15.4" http: dependency: "direct main" description: name: http - sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f + sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.2.2" http_multi_server: dependency: transitive description: name: http_multi_server - sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" url: "https://pub.dev" source: hosted - version: "3.2.2" + version: "3.2.1" http_parser: dependency: transitive description: @@ -825,26 +825,26 @@ packages: dependency: transitive description: name: image_picker_android - sha256: "8c5abf0dcc24fe6e8e0b4a5c0b51a5cf30cefdf6407a3213dae61edc75a70f56" + sha256: "39f2bfe497e495450c81abcd44b62f56c2a36a37a175da7d137b4454977b51b1" url: "https://pub.dev" source: hosted - version: "0.8.12+12" + version: "0.8.9+3" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - sha256: "717eb042ab08c40767684327be06a5d8dbb341fe791d514e4b92c7bbe1b7bb83" + sha256: e2423c53a68b579a7c37a1eda967b8ae536c3d98518e5db95ca1fe5719a730a3 url: "https://pub.dev" source: hosted - version: "3.0.6" + version: "3.0.2" image_picker_ios: dependency: transitive description: name: image_picker_ios - sha256: "05da758e67bc7839e886b3959848aa6b44ff123ab4b28f67891008afe8ef9100" + sha256: fadafce49e8569257a0cad56d24438a6fa1f0cbd7ee0af9b631f7492818a4ca3 url: "https://pub.dev" source: hosted - version: "0.8.12+2" + version: "0.8.9+1" image_picker_linux: dependency: transitive description: @@ -857,18 +857,18 @@ packages: dependency: transitive description: name: image_picker_macos - sha256: "1b90ebbd9dcf98fb6c1d01427e49a55bd96b5d67b8c67cf955d60a5de74207c1" + sha256: "3f5ad1e8112a9a6111c46d0b57a7be2286a9a07fc6e1976fdf5be2bd31d4ff62" url: "https://pub.dev" source: hosted - version: "0.2.1+2" + version: "0.2.1+1" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - sha256: "886d57f0be73c4b140004e78b9f28a8914a09e50c2d816bdd0520051a71236a0" + sha256: "9ec26d410ff46f483c5519c29c02ef0e02e13a543f882b152d4bfd2f06802f80" url: "https://pub.dev" source: hosted - version: "2.10.1" + version: "2.10.0" image_picker_windows: dependency: transitive description: @@ -889,10 +889,10 @@ packages: dependency: transitive description: name: io - sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.0.4" js: dependency: transitive description: @@ -953,10 +953,10 @@ packages: dependency: transitive description: name: logging - sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.2.0" matcher: dependency: transitive description: @@ -985,10 +985,10 @@ packages: dependency: transitive description: name: mime - sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a" + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "1.0.4" mobile_scanner: dependency: "direct main" description: @@ -1009,10 +1009,10 @@ packages: dependency: transitive description: name: mocktail - sha256: "890df3f9688106f25755f26b1c60589a92b3ab91a22b8b224947ad041bf172d8" + sha256: f603ebd85a576e5914870b02e5839fc5d0243b867bf710651cf239a28ebb365e url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.2" mocktail_image_network: dependency: "direct dev" description: @@ -1049,10 +1049,10 @@ packages: dependency: transitive description: name: normalize - sha256: f78bf0552b9640c76369253f0b8fdabad4f3fbfc06bdae9359e71bee9a5b071b + sha256: "8a60e37de5b608eeaf9b839273370c71ebba445e9f73b08eee7725e0d92dbc43" url: "https://pub.dev" source: hosted - version: "0.9.1" + version: "0.8.2+1" octo_image: dependency: transitive description: @@ -1065,10 +1065,10 @@ packages: dependency: transitive description: name: package_config - sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67" + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.0" path: dependency: transitive description: @@ -1081,10 +1081,10 @@ packages: dependency: transitive description: name: path_parsing - sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca" + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.0.1" path_provider: dependency: "direct main" description: @@ -1105,10 +1105,10 @@ packages: dependency: transitive description: name: path_provider_foundation - sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" + sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.3.2" path_provider_linux: dependency: transitive description: @@ -1129,10 +1129,10 @@ packages: dependency: transitive description: name: path_provider_windows - sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.2.1" permission_handler: dependency: "direct main" description: @@ -1145,34 +1145,34 @@ packages: dependency: transitive description: name: permission_handler_android - sha256: "71bbecfee799e65aff7c744761a57e817e73b738fedf62ab7afd5593da21f9f1" + sha256: "758284a0976772f9c744d6384fc5dc4834aa61e3f7aa40492927f244767374eb" url: "https://pub.dev" source: hosted - version: "12.0.13" + version: "12.0.3" permission_handler_apple: dependency: transitive description: name: permission_handler_apple - sha256: e6f6d73b12438ef13e648c4ae56bd106ec60d17e90a59c4545db6781229082a0 + sha256: e9ad66020b89ff1b63908f247c2c6f931c6e62699b756ef8b3c4569350cd8662 url: "https://pub.dev" source: hosted - version: "9.4.5" + version: "9.4.4" permission_handler_html: dependency: transitive description: name: permission_handler_html - sha256: "38f000e83355abb3392140f6bc3030660cfaef189e1f87824facb76300b4ff24" + sha256: "54bf176b90f6eddd4ece307e2c06cf977fb3973719c35a93b85cc7093eb6070d" url: "https://pub.dev" source: hosted - version: "0.1.3+5" + version: "0.1.1" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - sha256: e9c8eadee926c4532d0305dff94b85bf961f16759c3af791486613152af4b4f9 + sha256: "23dfba8447c076ab5be3dee9ceb66aad345c4a648f0cac292c77b1eb0e800b78" url: "https://pub.dev" source: hosted - version: "4.2.3" + version: "4.2.0" permission_handler_windows: dependency: transitive description: @@ -1193,10 +1193,10 @@ packages: dependency: transitive description: name: platform - sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" url: "https://pub.dev" source: hosted - version: "3.1.6" + version: "3.1.4" plugin_platform_interface: dependency: "direct main" description: @@ -1233,26 +1233,26 @@ packages: dependency: transitive description: name: pub_semver - sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd" + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" url: "https://pub.dev" source: hosted - version: "2.1.5" + version: "2.1.4" pubspec_parse: dependency: transitive description: name: pubspec_parse - sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0" + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.2.3" qr: dependency: transitive description: name: qr - sha256: "5a1d2586170e172b8a8c8470bbbffd5eb0cd38a66c0d77155ea138d3af3a4445" + sha256: "64957a3930367bf97cc211a5af99551d630f2f4625e38af10edd6b19131b64b3" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.1" qr_flutter: dependency: "direct main" description: @@ -1265,34 +1265,34 @@ packages: dependency: "direct main" description: name: quick_actions - sha256: "7e35dd6a21f5bbd21acf6899039eaf85001a5ac26d52cbd6a8a2814505b90798" + sha256: "2c1d9a91f3218b4e987a7e1e95ba0415b7f48a2cb3ffacc027a1e3d3c117223f" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.0.8" quick_actions_android: dependency: transitive description: name: quick_actions_android - sha256: abe0c80d4bd9d457f5b7df20501abf3101631457d88432b357140d65da8f6c46 + sha256: adb42f20a46b22fee4caef421c00ff9eb209f9d441010bc5d6e9afa824288cf6 url: "https://pub.dev" source: hosted - version: "1.0.17" + version: "1.0.10" quick_actions_ios: dependency: transitive description: name: quick_actions_ios - sha256: "837b7e6b5973784d3da56b8c959b446b215914f20405d88cd7d22a2fb94e4e4c" + sha256: dd355101d0e9fef6176fa2ae2bf738bcafa8df09a1e17057fcb56475719793de url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.0.10" quick_actions_platform_interface: dependency: transitive description: name: quick_actions_platform_interface - sha256: "1fec7068db5122cd019e9340d3d7be5d36eab099695ef3402c7059ee058329a4" + sha256: "81a1e40c519bb3cacfec38b3008b13cef665a75bd270da94f40091b57f0f9236" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.0.6" rxdart: dependency: transitive description: @@ -1321,10 +1321,10 @@ packages: dependency: transitive description: name: shared_preferences_foundation - sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" + sha256: c4b35f6cb8f63c147312c054ce7c2254c8066745125264f0c88739c417fc9d9f url: "https://pub.dev" source: hosted - version: "2.5.4" + version: "2.5.2" shared_preferences_linux: dependency: transitive description: @@ -1369,10 +1369,10 @@ packages: dependency: transitive description: name: shelf_web_socket - sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "1.0.4" shimmer: dependency: "direct main" description: @@ -1406,10 +1406,10 @@ packages: dependency: transitive description: name: source_helper - sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c" + sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" url: "https://pub.dev" source: hosted - version: "1.3.5" + version: "1.3.4" source_span: dependency: transitive description: @@ -1438,10 +1438,10 @@ packages: dependency: transitive description: name: sqflite_common - sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4" + sha256: bb4738f15b23352822f4c42a531677e5c6f522e079461fd240ead29d8d8a54a6 url: "https://pub.dev" source: hosted - version: "2.5.4" + version: "2.5.0+2" stack_trace: dependency: "direct main" description: @@ -1462,10 +1462,10 @@ packages: dependency: transitive description: name: stream_transform - sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.0" string_scanner: dependency: transitive description: @@ -1549,10 +1549,10 @@ packages: dependency: transitive description: name: timing - sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.0.1" tutorial_coach_mark: dependency: "direct main" description: @@ -1597,18 +1597,18 @@ packages: dependency: transitive description: name: url_launcher_linux - sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" + sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 url: "https://pub.dev" source: hosted - version: "3.2.1" + version: "3.1.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2" + sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 url: "https://pub.dev" source: hosted - version: "3.2.2" + version: "3.1.0" url_launcher_platform_interface: dependency: "direct dev" description: @@ -1629,42 +1629,42 @@ packages: dependency: transitive description: name: url_launcher_windows - sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" + sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 url: "https://pub.dev" source: hosted - version: "3.1.4" + version: "3.1.1" uuid: dependency: transitive description: name: uuid - sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff + sha256: f33d6bb662f0e4f79dcd7ada2e6170f3b3a2530c28fc41f49a411ddedd576a77 url: "https://pub.dev" source: hosted - version: "4.5.1" + version: "4.5.0" vector_graphics: dependency: transitive description: name: vector_graphics - sha256: "27d5fefe86fb9aace4a9f8375b56b3c292b64d8c04510df230f849850d912cb7" + sha256: "773c9522d66d523e1c7b25dfb95cc91c26a1e17b107039cfe147285e92de7878" url: "https://pub.dev" source: hosted - version: "1.1.15" + version: "1.1.14" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146" + sha256: c86987475f162fadff579e7320c7ddda04cd2fdeffbe1129227a85d9ac9e03da url: "https://pub.dev" source: hosted - version: "1.1.13" + version: "1.1.11+1" vector_graphics_compiler: dependency: transitive description: name: vector_graphics_compiler - sha256: "1b4b9e706a10294258727674a340ae0d6e64a7231980f9f9a3d12e4b42407aad" + sha256: ab9ff38fc771e9ee1139320adbe3d18a60327370c218c60752068ebee4b49ab1 url: "https://pub.dev" source: hosted - version: "1.1.16" + version: "1.1.15" vector_math: dependency: transitive description: @@ -1677,18 +1677,18 @@ packages: dependency: "direct main" description: name: vibration - sha256: "3b08a0579c2f9c18d5d78cb5c74f1005f731e02eeca6d72561a2e8059bf98ec3" + sha256: f0af02af2d63132135ae0332a3e54d5de718e214ee94c4f082176ef6ce624a4b url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.0.1" vibration_platform_interface: dependency: transitive description: name: vibration_platform_interface - sha256: "6ffeee63547562a6fef53c05a41d4fdcae2c0595b83ef59a4813b0612cd2bc36" + sha256: f66b39aab2447038978c16f3d6f77228e49ef5717556e3da02313e044e4a7600 url: "https://pub.dev" source: hosted - version: "0.0.3" + version: "0.0.2" video_player: dependency: "direct main" description: @@ -1709,26 +1709,26 @@ packages: dependency: transitive description: name: video_player_avfoundation - sha256: "8a4e73a3faf2b13512978a43cf1cdda66feeeb900a0527f1fbfd7b19cf3458d3" + sha256: "309e3962795e761be010869bae65c0b0e45b5230c5cee1bec72197ca7db040ed" url: "https://pub.dev" source: hosted - version: "2.6.7" + version: "2.5.6" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface - sha256: "229d7642ccd9f3dc4aba169609dd6b5f3f443bb4cc15b82f7785fcada5af9bbb" + sha256: "236454725fafcacf98f0f39af0d7c7ab2ce84762e3b63f2cbb3ef9a7e0550bc6" url: "https://pub.dev" source: hosted - version: "6.2.3" + version: "6.2.2" video_player_web: dependency: transitive description: name: video_player_web - sha256: "881b375a934d8ebf868c7fb1423b2bfaa393a0a265fa3f733079a86536064a10" + sha256: "34beb3a07d4331a24f7e7b2f75b8e2b103289038e07e65529699a671b6a6e2cb" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.1.3" visibility_detector: dependency: "direct main" description: @@ -1749,34 +1749,26 @@ packages: dependency: transitive description: name: watcher - sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.0" web: dependency: transitive description: name: web - sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb + sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 url: "https://pub.dev" source: hosted - version: "1.1.0" - web_socket: - dependency: transitive - description: - name: web_socket - sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" - url: "https://pub.dev" - source: hosted - version: "0.1.6" + version: "1.0.0" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: "0b8e2457400d8a859b7b2030786835a28a8e80836ef64402abef392ff4f1d0e5" + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "2.4.0" win32: dependency: transitive description: @@ -1789,18 +1781,18 @@ packages: dependency: transitive description: name: win32_registry - sha256: "21ec76dfc731550fd3e2ce7a33a9ea90b828fdf19a5c3bcf556fa992cfa99852" + sha256: "41fd8a189940d8696b1b810efb9abcf60827b6cbfab90b0c43e8439e3a39d85a" url: "https://pub.dev" source: hosted - version: "1.1.5" + version: "1.1.2" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.0.4" xml: dependency: transitive description: @@ -1813,10 +1805,10 @@ packages: dependency: transitive description: name: yaml - sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "3.1.2" sdks: dart: ">=3.4.0 <=3.4.4" flutter: ">=3.22.0" diff --git a/test/widget_tests/pre_auth_screens/set_url_page_test.dart b/test/widget_tests/pre_auth_screens/set_url_page_test.dart index 5f9d4a9db..768a82c8d 100644 --- a/test/widget_tests/pre_auth_screens/set_url_page_test.dart +++ b/test/widget_tests/pre_auth_screens/set_url_page_test.dart @@ -1,10 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:mobile_scanner/mobile_scanner.dart'; import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; -// import 'package:qr_code_scanner/qr_code_scanner.dart'; -import 'package:mobile_scanner/mobile_scanner.dart'; import 'package:talawa/constants/custom_theme.dart'; import 'package:talawa/locator.dart'; import 'package:talawa/router.dart' as router; From a7ece4d86c669baac3726ef456ab419b0a4b34a5 Mon Sep 17 00:00:00 2001 From: MukalDadhwal Date: Fri, 31 Jan 2025 15:21:19 +0530 Subject: [PATCH 5/5] more tests written for mobile_scanner to improve test coverage --- android/app/proguard-rules.pro | 4 + .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/settings.gradle | 2 +- .../set_url_view_model.dart | 96 ++- .../join_organisation_after_auth.dart | 17 +- pubspec.lock | 8 - pubspec.yaml | 3 +- .../set_url_view_model_test.dart | 737 +++++++++++++++++- 8 files changed, 806 insertions(+), 63 deletions(-) create mode 100644 android/app/proguard-rules.pro diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro new file mode 100644 index 000000000..9bc66d450 --- /dev/null +++ b/android/app/proguard-rules.pro @@ -0,0 +1,4 @@ +# Please add these rules to your existing keep rules in order to suppress warnings. +# This is generated automatically by the Android Gradle plugin. +-dontwarn org.bouncycastle.jce.provider.BouncyCastleProvider +-dontwarn org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider \ No newline at end of file diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index cfe88f690..ea0d35b4c 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip diff --git a/android/settings.gradle b/android/settings.gradle index 7e3053f1c..243a792d6 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -19,7 +19,7 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.2" - id "com.android.application" version '7.3.0' apply false + id "com.android.application" version '8.1.1' apply false id "org.jetbrains.kotlin.android" version "1.8.10" apply false id("com.google.gms.google-services") version "4.4.1" apply false diff --git a/lib/view_model/pre_auth_view_models/set_url_view_model.dart b/lib/view_model/pre_auth_view_models/set_url_view_model.dart index 6719a67a0..c4180b84a 100644 --- a/lib/view_model/pre_auth_view_models/set_url_view_model.dart +++ b/lib/view_model/pre_auth_view_models/set_url_view_model.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:hive/hive.dart'; import 'package:mobile_scanner/mobile_scanner.dart'; +import 'package:qr_flutter/qr_flutter.dart'; import 'package:talawa/constants/app_strings.dart'; import 'package:talawa/enums/enums.dart'; import 'package:talawa/locator.dart'; @@ -210,11 +211,13 @@ class SetUrlViewModel extends BaseModel { /// /// **params**: /// * `context`: BuildContext + /// * `mockController`: MobileScannerController /// /// **returns**: /// None - void scanQR(BuildContext context) { + void scanQR(BuildContext context, {MobileScannerController? mockController}) { + debugPrint('Scan QR called'); showModalBottomSheet( context: context, barrierColor: Colors.transparent, @@ -245,22 +248,8 @@ class SetUrlViewModel extends BaseModel { fit: BoxFit.contain, controller: controller, errorBuilder: (ctx, error, _) { - String errorMessage = ''; - switch (error.errorCode) { - case MobileScannerErrorCode.controllerUninitialized: - errorMessage = 'camera is not ready'; - break; - case MobileScannerErrorCode.permissionDenied: - errorMessage = - 'Please provide camera permission to scan QR code'; - break; - case MobileScannerErrorCode.unsupported: - errorMessage = - 'This device does not support scanning.'; - break; - default: - errorMessage = 'An unkonwn error occurred'; - } + final String errorMessage = onDetectError(error); + debugPrint(errorMessage); WidgetsBinding.instance.addPostFrameCallback((_) { navigationService.showTalawaErrorSnackBar( @@ -275,7 +264,10 @@ class SetUrlViewModel extends BaseModel { ), ); }, - onDetect: _onQRViewCreated, + onDetect: (capture) { + debugPrint('onDetect called with capture: $capture'); + onQRViewCreated(capture, controller); + }, ), ), SizedBox( @@ -297,34 +289,92 @@ class SetUrlViewModel extends BaseModel { /// /// **params**: /// * `scanData`: BarcodeCapture + /// * `controller`: MobileScannerController /// /// **returns**: /// None - void _onQRViewCreated(BarcodeCapture scanData) { - if (scanData.raw != null && scanData.barcodes.isNotEmpty) { - final String code = scanData.barcodes.first.displayValue!; + void onQRViewCreated( + BarcodeCapture scanData, + MobileScannerController? controller, + ) { + if (scanData.barcodes.isNotEmpty) { + debugPrint("Barcode: ${scanData.barcodes.first.displayValue}"); try { + final String code = scanData.barcodes.first.displayValue!; + final List data = code.split('?'); url.text = data[0]; final List queries = data[1].split('&'); orgId = queries[0].split('=')[1]; Vibration.vibrate(duration: 100); - controller.stop(); + controller!.stop(); controller.dispose(); + final box = Hive.box('url'); box.put(urlKey, url.text); box.put(imageUrlKey, "${url.text}/talawa/"); graphqlConfig.getOrgUrl(); Navigator.pop(navigationService.navigatorKey.currentContext!); navigationService.pushScreen('/selectOrg', arguments: orgId); + } on QrEmbeddedImageException catch (e) { + debugPrint(e.toString()); + navigationService.showTalawaErrorDialog( + "The QR is not Working", + MessageType.error, + ); + } on QrUnsupportedVersionException catch (e) { + debugPrint(e.toString()); + navigationService.showTalawaErrorDialog( + "This QR version is not Supported.", + MessageType.error, + ); } on Exception catch (e) { debugPrint(e.toString()); navigationService.showTalawaErrorSnackBar( - "The Camera is not working", + "This QR is not for the App", MessageType.error, ); } } } + + /// This function is used to handle the error. + /// + /// **params**: + /// * `error`: Object + /// + /// **returns**: + /// * `String`: The error message generated. + + String onDetectError(Object error) { + String errorMsg = 'An unknown error occurred'; + + if (error is MobileScannerException) { + debugPrint(error.errorCode.toString()); + switch (error.errorCode) { + case MobileScannerErrorCode.controllerDisposed: + errorMsg = 'Camera is disposed'; + break; + case MobileScannerErrorCode.controllerAlreadyInitialized: + errorMsg = 'Camera is already in use'; + break; + case MobileScannerErrorCode.controllerUninitialized: + errorMsg = 'Camera is not ready'; + break; + case MobileScannerErrorCode.permissionDenied: + errorMsg = 'Please provide camera permission to scan QR code'; + break; + case MobileScannerErrorCode.unsupported: + errorMsg = 'This device does not support scanning'; + break; + case MobileScannerErrorCode.genericError: + errorMsg = 'Something went wrong while detecting the QR'; + break; + default: + errorMsg = 'An unknown error occurred'; + } + } + return errorMsg; + } } diff --git a/lib/views/after_auth_screens/join_org_after_auth/join_organisation_after_auth.dart b/lib/views/after_auth_screens/join_org_after_auth/join_organisation_after_auth.dart index 97be010c5..8831866ab 100644 --- a/lib/views/after_auth_screens/join_org_after_auth/join_organisation_after_auth.dart +++ b/lib/views/after_auth_screens/join_org_after_auth/join_organisation_after_auth.dart @@ -126,22 +126,7 @@ class _JoinOrganisationAfterAuthState extends State { fit: BoxFit.contain, controller: controller, errorBuilder: (ctx, error, _) { - String errorMessage = ''; - switch (error.errorCode) { - case MobileScannerErrorCode.controllerUninitialized: - errorMessage = 'camera is not ready'; - break; - case MobileScannerErrorCode.permissionDenied: - errorMessage = - 'Please provide camera permission to scan QR code'; - break; - case MobileScannerErrorCode.unsupported: - errorMessage = - 'This device does not support scanning.'; - break; - default: - errorMessage = 'An unkonwn error occurred'; - } + final String errorMessage = error.toString(); WidgetsBinding.instance.addPostFrameCallback((_) { navigationService.showTalawaErrorSnackBar( diff --git a/pubspec.lock b/pubspec.lock index 76358dfcb..377a0d229 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1386,14 +1386,6 @@ packages: description: flutter source: sdk version: "0.0.99" - social_share: - dependency: "direct main" - description: - name: social_share - sha256: eb19a0f6f5a29c7bb71e5bb1991145eb52472184363b6e2da70695befd8be041 - url: "https://pub.dev" - source: hosted - version: "2.3.1" source_gen: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 429e2ced6..fb43dba1e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: # analyzer_plugin: ################################ - app_links: ^6.3.3 + app_links: app_links_platform_interface: ^2.0.2 auto_size_text: ^3.0.0 cached_network_image: ^3.4.1 @@ -69,7 +69,6 @@ dependencies: quick_actions: ^1.0.8 shared_preferences: ^2.3.3 shimmer: ^3.0.0 - social_share: ^2.2.1 stack_trace: ^1.11.1 syncfusion_flutter_calendar: ^27.2.5 syncfusion_flutter_datepicker: ^27.2.5 diff --git a/test/view_model_tests/pre_auth_view_models/set_url_view_model_test.dart b/test/view_model_tests/pre_auth_view_models/set_url_view_model_test.dart index 14aa84958..2723dd835 100644 --- a/test/view_model_tests/pre_auth_view_models/set_url_view_model_test.dart +++ b/test/view_model_tests/pre_auth_view_models/set_url_view_model_test.dart @@ -1,4 +1,5 @@ // ignore_for_file: talawa_api_doc + import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -25,15 +26,18 @@ import '../../helpers/test_helpers.mocks.dart'; /// This is a TestWidget class. class TestWidget extends StatelessWidget { - const TestWidget(this.model, {super.key}); + const TestWidget(this.model, this.controller, {super.key}); /// State. final SetUrlViewModel model; + + final MobileScannerController controller; + @override Widget build(BuildContext context) { return Scaffold( body: FloatingActionButton( - onPressed: () => model.scanQR(context), + onPressed: () => model.scanQR(context, mockController: controller), ), ); } @@ -90,10 +94,51 @@ Widget forTest({ThemeMode themeMode = ThemeMode.dark}) => BaseView( }, ); +Widget testMobileScannerForError(MobileScannerController controller) { + return MaterialApp( + home: Scaffold( + body: SizedBox( + height: 250, + width: 250, + child: MobileScanner( + controller: controller, + errorBuilder: (ctx, error, _) { + String errorMsg = ''; + switch (error.errorCode) { + case MobileScannerErrorCode.controllerDisposed: + errorMsg = 'Camera is disposed'; + break; + case MobileScannerErrorCode.controllerAlreadyInitialized: + errorMsg = 'Camera is already in use'; + break; + case MobileScannerErrorCode.controllerUninitialized: + errorMsg = 'Camera is not ready'; + break; + case MobileScannerErrorCode.permissionDenied: + errorMsg = 'Please provide camera permission to scan QR code'; + break; + case MobileScannerErrorCode.unsupported: + errorMsg = 'This device does not support scanning'; + break; + case MobileScannerErrorCode.genericError: + errorMsg = 'Something went wrong while detecting the QR'; + break; + default: + errorMsg = 'An unknown error occurred'; + } + return Center(child: Text(errorMsg)); + }, + ), + ), + ), + ); +} + Future main() async { SizeConfig().test(); late SetUrlViewModel model; + late MockMobileScannerController controller; locator.registerSingleton(ActionHandlerService()); @@ -101,11 +146,359 @@ Future main() async { registerServices(); registerViewModels(); model = SetUrlViewModel(); + controller = MockMobileScannerController(); }); tearDown(() async { unregisterViewModels(); }); + group('Testing the qr functionality', () { + testWidgets('MobileScanner widget renders correctly', + (WidgetTester tester) async { + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: MobileScanner( + controller: MobileScannerController(), + onDetect: (barcode) {}, + ), + ), + ), + ); + + // Verify that the MobileScanner widget is rendered + expect(find.byType(MobileScanner), findsOneWidget); + }); + + testWidgets('onDetect callback is triggered when a barcode is detected', + (WidgetTester tester) async { + bool isDetected = false; + + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: MobileScanner( + controller: MobileScannerController(), + onDetect: (barcode) { + isDetected = true; // Set flag to true when barcode is detected + }, + ), + ), + ), + ); + + // Simulate a barcode detection event + const barcode = BarcodeCapture( + barcodes: [Barcode(displayValue: 'test', format: BarcodeFormat.qrCode)], + ); + (find.byType(MobileScanner).evaluate().single.widget as MobileScanner) + .onDetect + ?.call(barcode); + + // Verify that the callback was triggered + expect(isDetected, true); + }); + + testWidgets('UI updates when a barcode is detected', + (WidgetTester tester) async { + // String? detectedBarcode; + + await tester.pumpWidget( + MaterialApp( + home: BarcodeScannerTestWidget(), + ), + ); + + const barcode = BarcodeCapture( + barcodes: [ + Barcode(displayValue: '123456', format: BarcodeFormat.code128), + ], + ); + (find.byType(MobileScanner).evaluate().single.widget as MobileScanner) + .onDetect + ?.call(barcode); + + // Rebuild the widget to reflect the updated state + await tester.pump(); + + // Verify that the UI updates with the detected barcode + expect(find.text('Detected: 123456'), findsOneWidget); + }); + + testWidgets('UI updates for multiple barcode detections', + (WidgetTester tester) async { + await tester.pumpWidget( + MaterialApp( + home: BarcodeScannerTestWidget(), + ), + ); + + // Simulate the first barcode detection event + const firstBarcode = BarcodeCapture( + barcodes: [ + Barcode(displayValue: '123456', format: BarcodeFormat.code128), + ], + ); + (find.byType(MobileScanner).evaluate().single.widget as MobileScanner) + .onDetect + ?.call(firstBarcode); + + // Rebuild the widget to reflect the updated state + await tester.pump(); + + // Verify that the UI updates with the first detected barcode + expect(find.text('Detected: 123456'), findsOneWidget); + + // Simulate the second barcode detection event + const secondBarcode = BarcodeCapture( + barcodes: [ + Barcode(displayValue: '789012', format: BarcodeFormat.code128), + ], + ); + (find.byType(MobileScanner).evaluate().single.widget as MobileScanner) + .onDetect + ?.call(secondBarcode); + + // Rebuild the widget to reflect the updated state + await tester.pump(); + + // Verify that the UI updates with the second detected barcode + expect(find.text('Detected: 789012'), findsOneWidget); + }); + + testWidgets('errorBuilder displays correct message for controllerDisposed', + (WidgetTester tester) async { + final controller = MockMobileScannerController(); + + when(controller.value).thenReturn( + const MobileScannerState( + isInitialized: true, + // hasCameraPermission: true, + size: Size(250, 250), + availableCameras: 0, + cameraDirection: CameraFacing.back, + isRunning: true, + torchState: TorchState.off, + zoomScale: 0.0, + error: MobileScannerException( + errorCode: MobileScannerErrorCode.controllerDisposed, + ), + ), + ); + + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: MobileScanner( + controller: controller, + onDetect: (barcode) {}, + errorBuilder: (context, error, child) { + final errorMsg = model.onDetectError(error); + return Text('Error: $errorMsg'); + }, + ), + ), + ), + ); + + // await controller.start(); + + // Wait for the widget to fully initialize and handle the error + await tester.pumpAndSettle(); + + // Verify that the correct error message is displayed + expect(find.text('Error: Camera is disposed'), findsOneWidget); + }); + + testWidgets('errorBuilder displays correct message for permissionDenied', + (WidgetTester tester) async { + final controller = MockMobileScannerController(); + + when(controller.value).thenReturn( + const MobileScannerState( + isInitialized: true, + // hasCameraPermission: true, + size: Size(250, 250), + availableCameras: 0, + cameraDirection: CameraFacing.back, + isRunning: true, + torchState: TorchState.off, + zoomScale: 0.0, + error: MobileScannerException( + errorCode: MobileScannerErrorCode.permissionDenied, + ), + ), + ); + + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: MobileScanner( + controller: controller, + onDetect: (barcode) {}, + errorBuilder: (context, error, child) { + final errorMsg = model.onDetectError(error); + return Text('Error: $errorMsg'); + }, + ), + ), + ), + ); + + // await controller.start(); + + // Wait for the widget to fully initialize and handle the error + await tester.pumpAndSettle(); + + // Verify that the correct error message is displayed + expect( + find.text('Error: Please provide camera permission to scan QR code'), + findsOneWidget, + ); + }); + + testWidgets('errorBuilder displays correct message for unsupported', + (WidgetTester tester) async { + final controller = MockMobileScannerController(); + + when(controller.value).thenReturn( + const MobileScannerState( + isInitialized: true, + // hasCameraPermission: true, + size: Size(250, 250), + availableCameras: 0, + cameraDirection: CameraFacing.back, + isRunning: true, + torchState: TorchState.off, + zoomScale: 0.0, + error: MobileScannerException( + errorCode: MobileScannerErrorCode.unsupported, + ), + ), + ); + + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: MobileScanner( + controller: controller, + onDetect: (barcode) {}, + errorBuilder: (context, error, child) { + final errorMsg = model.onDetectError(error); + return Text('Error: $errorMsg'); + }, + ), + ), + ), + ); + + // await controller.start(); + + // Wait for the widget to fully initialize and handle the error + await tester.pumpAndSettle(); + + // Verify that the correct error message is displayed + expect( + find.text('Error: This device does not support scanning'), + findsOneWidget, + ); + }); + + testWidgets('errorBuilder displays correct message for generic error', + (WidgetTester tester) async { + final controller = MockMobileScannerController(); + + when(controller.value).thenReturn( + const MobileScannerState( + isInitialized: true, + // hasCameraPermission: true, + size: Size(250, 250), + availableCameras: 0, + cameraDirection: CameraFacing.back, + isRunning: true, + torchState: TorchState.off, + zoomScale: 0.0, + error: MobileScannerException( + errorCode: MobileScannerErrorCode.genericError, + ), + ), + ); + + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: MobileScanner( + controller: controller, + onDetect: (barcode) {}, + errorBuilder: (context, error, child) { + final errorMsg = model.onDetectError(error); + return Text('Error: $errorMsg'); + }, + ), + ), + ), + ); + + // await controller.start(); + + // Wait for the widget to fully initialize and handle the error + await tester.pumpAndSettle(); + + // Verify that the correct error message is displayed + expect( + find.text('Error: Something went wrong while detecting the QR'), + findsOneWidget, + ); + }); + + testWidgets('errorBuilder displays correct message for camera already use', + (WidgetTester tester) async { + final controller = MockMobileScannerController(); + + when(controller.value).thenReturn( + const MobileScannerState( + isInitialized: true, + // hasCameraPermission: true, + size: Size(250, 250), + availableCameras: 0, + cameraDirection: CameraFacing.back, + isRunning: true, + torchState: TorchState.off, + zoomScale: 0.0, + error: MobileScannerException( + errorCode: MobileScannerErrorCode.controllerAlreadyInitialized, + ), + ), + ); + + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: MobileScanner( + controller: controller, + onDetect: (barcode) {}, + errorBuilder: (context, error, child) { + final errorMsg = model.onDetectError(error); + return Text('Error: $errorMsg'); + }, + ), + ), + ), + ); + + // await controller.start(); + + // Wait for the widget to fully initialize and handle the error + await tester.pumpAndSettle(); + + // Verify that the correct error message is displayed + expect( + find.text('Error: Camera is already in use'), + findsOneWidget, + ); + }); + }); + group('SetUrlViewModel Test -', () { testWidgets( 'Check if checkURLandNavigate() is working fine when urlPresent is true', @@ -227,7 +620,7 @@ Future main() async { }); testWidgets('Check if scanQR() is working fine', (tester) async { - await tester.pumpWidget(MaterialApp(home: TestWidget(model))); + await tester.pumpWidget(MaterialApp(home: TestWidget(model, controller))); await tester.tap(find.byType(FloatingActionButton)); await tester.pump(); @@ -237,14 +630,51 @@ Future main() async { }); testWidgets('Check if _onQRViewCreated() is working fine', (tester) async { + final controller = MockMobileScannerController(); await tester.pumpWidget( MaterialApp( - home: TestWidget(model), + home: TestWidget(model, controller), navigatorKey: navigationService.navigatorKey, ), ); + when(controller.barcodes).thenAnswer( + (_) => Stream.fromIterable([ + const BarcodeCapture( + barcodes: [ + Barcode( + displayValue: 'qr?orgId=1&scan', + format: BarcodeFormat.qrCode, + ), + ], + ), + ]), + ); + + await tester.tap(find.byType(FloatingActionButton)); + await tester.pump(); + + expect(find.byType(MobileScanner), findsOneWidget); + expect(find.byType(Text), findsOneWidget); + + (tester.widget(find.byType(MobileScanner)) as MobileScanner) + .controller! + .start(); + + // Add verification for expected UI changes after QR code detection + expect(find.text('Scan QR'), findsOneWidget); + }); + + testWidgets( + 'Check if _onQRViewCreated() is working fine when throws MobileScannerException', + (tester) async { final controller = MockMobileScannerController(); + await tester.pumpWidget( + MaterialApp( + home: TestWidget(model, controller), + navigatorKey: navigationService.navigatorKey, + ), + ); when(controller.barcodes).thenAnswer( (_) => Stream.fromIterable([ @@ -259,25 +689,119 @@ Future main() async { ]), ); + when(controller.stop()).thenThrow( + const MobileScannerException( + errorCode: MobileScannerErrorCode.controllerAlreadyInitialized, + errorDetails: MobileScannerErrorDetails( + message: 'The camera is already in use', + ), + ), + ); await tester.tap(find.byType(FloatingActionButton)); await tester.pump(); + expect(find.byType(MobileScanner), findsOneWidget); + expect(find.byType(Text), findsOneWidget); + (tester.widget(find.byType(MobileScanner)) as MobileScanner) .controller! .start(); }); + testWidgets( + 'Check if _onQRViewCreated() is working fine when throws MobileScannerException', + (tester) async { + final controller = MockMobileScannerController(); + await tester.pumpWidget( + MaterialApp( + home: TestWidget(model, controller), + navigatorKey: navigationService.navigatorKey, + ), + ); + + when(controller.barcodes).thenAnswer( + (_) => Stream.fromIterable([ + const BarcodeCapture( + barcodes: [ + Barcode( + displayValue: 'qr?orgId=1&scan', + format: BarcodeFormat.qrCode, + ), + ], + ), + ]), + ); + when(controller.stop()).thenThrow( + const MobileScannerException( + errorCode: MobileScannerErrorCode.permissionDenied, + errorDetails: MobileScannerErrorDetails( + message: 'Please provide camera permission to scan QR code', + ), + ), + ); + await tester.tap(find.byType(FloatingActionButton)); + await tester.pump(); + + expect(find.byType(MobileScanner), findsOneWidget); + expect(find.byType(Text), findsOneWidget); + + (tester.widget(find.byType(MobileScanner)) as MobileScanner) + .controller! + .start(); + }); testWidgets( 'Check if _onQRViewCreated() is working fine when throws MobileScannerException', (tester) async { + final controller = MockMobileScannerController(); await tester.pumpWidget( MaterialApp( - home: TestWidget(model), + home: TestWidget(model, controller), navigatorKey: navigationService.navigatorKey, ), ); + when(controller.barcodes).thenAnswer( + (_) => Stream.fromIterable([ + const BarcodeCapture( + barcodes: [ + Barcode( + displayValue: 'qr?orgId=1&scan', + format: BarcodeFormat.qrCode, + ), + ], + ), + ]), + ); + + when(controller.stop()).thenThrow( + const MobileScannerException( + errorCode: MobileScannerErrorCode.controllerDisposed, + errorDetails: MobileScannerErrorDetails( + message: 'Camera is disposed', + ), + ), + ); + await tester.tap(find.byType(FloatingActionButton)); + await tester.pump(); + + expect(find.byType(MobileScanner), findsOneWidget); + expect(find.byType(Text), findsOneWidget); + + (tester.widget(find.byType(MobileScanner)) as MobileScanner) + .controller! + .start(); + }); + testWidgets( + 'Check if _onQRViewCreated() is working fine when throws MobileScannerException', + (tester) async { final controller = MockMobileScannerController(); + await tester.pumpWidget( + MaterialApp( + home: TestWidget(model, controller), + navigatorKey: navigationService.navigatorKey, + ), + ); + when(controller.barcodes).thenAnswer( (_) => Stream.fromIterable([ const BarcodeCapture( @@ -293,27 +817,117 @@ Future main() async { when(controller.stop()).thenThrow( const MobileScannerException( - errorCode: MobileScannerErrorCode.controllerUninitialized, + errorCode: MobileScannerErrorCode.controllerAlreadyInitialized, + errorDetails: MobileScannerErrorDetails( + message: 'Camera is already in use', + ), ), ); await tester.tap(find.byType(FloatingActionButton)); await tester.pump(); + expect(find.byType(MobileScanner), findsOneWidget); + expect(find.byType(Text), findsOneWidget); + (tester.widget(find.byType(MobileScanner)) as MobileScanner) .controller! .start(); }); testWidgets( - 'Check if _onQRViewCreated() is working fine when throws QrEmbeddedImageException', + 'Check if _onQRViewCreated() is working fine when throws MobileScannerException', + (tester) async { + final controller = MockMobileScannerController(); + await tester.pumpWidget( + MaterialApp( + home: TestWidget(model, controller), + navigatorKey: navigationService.navigatorKey, + ), + ); + + when(controller.barcodes).thenAnswer( + (_) => Stream.fromIterable([ + const BarcodeCapture( + barcodes: [ + Barcode( + displayValue: 'qr?orgId=1&scan', + format: BarcodeFormat.qrCode, + ), + ], + ), + ]), + ); + + when(controller.stop()).thenThrow( + const MobileScannerException( + errorCode: MobileScannerErrorCode.unsupported, + errorDetails: MobileScannerErrorDetails( + message: 'This device does not support scanning', + ), + ), + ); + await tester.tap(find.byType(FloatingActionButton)); + await tester.pump(); + + expect(find.byType(MobileScanner), findsOneWidget); + expect(find.byType(Text), findsOneWidget); + + (tester.widget(find.byType(MobileScanner)) as MobileScanner) + .controller! + .start(); + }); + testWidgets( + 'Check if _onQRViewCreated() is working fine when throws MobileScannerException', (tester) async { + final controller = MockMobileScannerController(); await tester.pumpWidget( MaterialApp( - home: TestWidget(model), + home: TestWidget(model, controller), navigatorKey: navigationService.navigatorKey, ), ); + when(controller.barcodes).thenAnswer( + (_) => Stream.fromIterable([ + const BarcodeCapture( + barcodes: [ + Barcode( + displayValue: 'qr?orgId=1&scan', + format: BarcodeFormat.qrCode, + ), + ], + ), + ]), + ); + + when(controller.stop()).thenThrow( + const MobileScannerException( + errorCode: MobileScannerErrorCode.genericError, + errorDetails: MobileScannerErrorDetails( + message: "Something went wrong while detecting the QR", + ), + ), + ); + await tester.tap(find.byType(FloatingActionButton)); + await tester.pump(); + + expect(find.byType(MobileScanner), findsOneWidget); + expect(find.byType(Text), findsOneWidget); + + (tester.widget(find.byType(MobileScanner)) as MobileScanner) + .controller! + .start(); + }); + testWidgets( + 'Check if _onQRViewCreated() is working fine when throws QrEmbeddedImageException', + (tester) async { final controller = MockMobileScannerController(); + await tester.pumpWidget( + MaterialApp( + home: TestWidget(model, controller), + navigatorKey: navigationService.navigatorKey, + ), + ); + when(controller.barcodes).thenAnswer( (_) => Stream.fromIterable([ const BarcodeCapture( @@ -332,6 +946,9 @@ Future main() async { await tester.tap(find.byType(FloatingActionButton)); await tester.pump(); + expect(find.byType(MobileScanner), findsOneWidget); + expect(find.byType(Text), findsOneWidget); + (tester.widget(find.byType(MobileScanner)) as MobileScanner) .controller! .start(); @@ -339,14 +956,14 @@ Future main() async { testWidgets( 'Check if _onQRViewCreated() is working fine when throws QrUnsupportedVersionException', (tester) async { + final controller = MockMobileScannerController(); await tester.pumpWidget( MaterialApp( - home: TestWidget(model), + home: TestWidget(model, controller), navigatorKey: navigationService.navigatorKey, ), ); - final controller = MockMobileScannerController(); when(controller.barcodes).thenAnswer( (_) => Stream.fromIterable([ const BarcodeCapture( @@ -365,6 +982,9 @@ Future main() async { await tester.tap(find.byType(FloatingActionButton)); await tester.pump(); + expect(find.byType(MobileScanner), findsOneWidget); + expect(find.byType(Text), findsOneWidget); + (tester.widget(find.byType(MobileScanner)) as MobileScanner) .controller! .start(); @@ -372,14 +992,14 @@ Future main() async { testWidgets( 'Check if _onQRViewCreated() is working fine when throws Exception', (tester) async { + final controller = MockMobileScannerController(); await tester.pumpWidget( MaterialApp( - home: TestWidget(model), + home: TestWidget(model, controller), navigatorKey: navigationService.navigatorKey, ), ); - final controller = MockMobileScannerController(); when(controller.barcodes).thenAnswer( (_) => Stream.fromIterable([ const BarcodeCapture( @@ -397,9 +1017,102 @@ Future main() async { await tester.tap(find.byType(FloatingActionButton)); await tester.pump(); + expect(find.byType(MobileScanner), findsOneWidget); + expect(find.byType(Text), findsOneWidget); + (tester.widget(find.byType(MobileScanner)) as MobileScanner) .controller! .start(); }); }); } + +class BarcodeScannerTestWidget extends StatefulWidget { + @override + _BarcodeScannerTestWidgetState createState() => + _BarcodeScannerTestWidgetState(); +} + +class _BarcodeScannerTestWidgetState extends State { + String? detectedBarcode; + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Column( + children: [ + MobileScanner( + controller: MobileScannerController(), + onDetect: (barcode) { + setState(() { + detectedBarcode = barcode + .barcodes.first.displayValue; // Update the detected barcode + }); + }, + ), + if (detectedBarcode != null) Text('Detected: $detectedBarcode'), + ], + ), + ); + } +} + +class BarcodeScannerErrorTestWidget extends StatefulWidget { + @override + _BarcodeScannerErrorTestWidgetState createState() => + _BarcodeScannerErrorTestWidgetState(); +} + +class _BarcodeScannerErrorTestWidgetState + extends State { + String? errorMessage; + + String _onDetectError(Object error) { + String errorMsg = 'An unknown error occurred'; + + if (error is MobileScannerException) { + debugPrint(error.errorCode.toString()); + switch (error.errorCode) { + case MobileScannerErrorCode.controllerDisposed: + errorMsg = 'Camera is disposed'; + break; + case MobileScannerErrorCode.controllerAlreadyInitialized: + errorMsg = 'Camera is already in use'; + break; + case MobileScannerErrorCode.controllerUninitialized: + errorMsg = 'Camera is not ready'; + break; + case MobileScannerErrorCode.permissionDenied: + errorMsg = 'Please provide camera permission to scan QR code'; + break; + case MobileScannerErrorCode.unsupported: + errorMsg = 'This device does not support scanning'; + break; + case MobileScannerErrorCode.genericError: + errorMsg = 'Something went wrong while detecting the QR'; + break; + default: + errorMsg = 'An unknown error occurred'; + } + } + return errorMsg; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Column( + children: [ + MobileScanner( + controller: MobileScannerController(), + onDetect: (barcode) {}, + errorBuilder: (context, error, child) { + final errorMsg = _onDetectError(error); + return Text('Error: $errorMsg'); + }, + ), + ], + ), + ); + } +}