diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 951e1b92e..dae9a8fa0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,6 @@ jobs: - uses: subosito/flutter-action@v2 name: Set up Flutter SDK with: - flutter-version: 3.7.7 channel: 'stable' cache: true diff --git a/.metadata b/.metadata index ba52fa387..78a65c5a1 100644 --- a/.metadata +++ b/.metadata @@ -1,11 +1,11 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled. +# This file should be version controlled and should not be manually edited. version: - revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf - channel: stable + revision: "9e1c857886f07d342cf106f2cd588bcd5e031bb2" + channel: "stable" project_type: app @@ -13,11 +13,26 @@ project_type: app migration: platforms: - platform: root - create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf - base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2 + base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2 + - platform: android + create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2 + base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2 + - platform: ios + create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2 + base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2 + - platform: linux + create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2 + base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2 + - platform: macos + create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2 + base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2 - platform: web - create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf - base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2 + base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2 + - platform: windows + create_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2 + base_revision: 9e1c857886f07d342cf106f2cd588bcd5e031bb2 # User provided section diff --git a/analysis_options.yaml b/analysis_options.yaml index 61b6c4de1..aaa5c3b59 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -9,6 +9,11 @@ # packages, and plugins designed to encourage good coding practices. include: package:flutter_lints/flutter.yaml +analyzer: + errors: + override_on_non_overriding_member: ignore + + linter: # The lint rules applied to this project can be customized in the # section below to disable rules from the `package:flutter_lints/flutter.yaml` @@ -22,8 +27,10 @@ linter: # `// ignore_for_file: name_of_lint` syntax on the line or in the file # producing the lint. rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + + + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule # Additional information about this file can be found at # https://dart.dev/guides/language/analysis-options diff --git a/android/app/src/main/kotlin/com/canopas/canopas_unity/MainActivity.kt b/android/app/src/main/kotlin/com/canopas/canopas_unity/MainActivity.kt new file mode 100644 index 000000000..cb4764a27 --- /dev/null +++ b/android/app/src/main/kotlin/com/canopas/canopas_unity/MainActivity.kt @@ -0,0 +1,6 @@ +package com.canopas.canopas_unity + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/android/build.gradle b/android/build.gradle index 208459ec6..c041af9e2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -28,6 +28,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/devtools_options.yaml b/devtools_options.yaml new file mode 100644 index 000000000..7e7e7f67d --- /dev/null +++ b/devtools_options.yaml @@ -0,0 +1 @@ +extensions: diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 0e810cffb..1c9624175 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -150,6 +150,7 @@ 3B06AD1E1E4923F5004D2608 /* Thin Binary */, EEE757421E9F11EC92E34695 /* [CP] Embed Pods Frameworks */, 58AF4A6981196F2916DFE346 /* [firebase_crashlytics] Crashlytics Upload Symbols */, + FA0101254B1595E95A925111 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -166,7 +167,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -300,6 +301,23 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + FA0101254B1595E95A925111 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 547e4f7f9..08c383969 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ (_updateEmployee); on(_clearData); @@ -30,7 +30,7 @@ class UserStateControllerBloc log("Init user status", name: "User Status"); _spaceChangeNotifier.addListener(() async { - if(_subscription != null){ + if (_subscription != null) { await _subscription?.cancel(); log("Stream canceled", name: "User Status"); } @@ -39,7 +39,8 @@ class UserStateControllerBloc } }); if (_userStateNotifier.currentSpaceId != null) { - _spaceChangeNotifier.setSpaceId(spaceId: _userStateNotifier.currentSpaceId!); + _spaceChangeNotifier.setSpaceId( + spaceId: _userStateNotifier.currentSpaceId!); } } @@ -67,7 +68,9 @@ class UserStateControllerBloc Future _updateData( UpdateUserData event, Emitter emit) async { - if (event.employee != null && event.space != null && event.employee?.status == EmployeeStatus.active) { + if (event.employee != null && + event.space != null && + event.employee?.status == EmployeeStatus.active) { if (event.employee != _userStateNotifier.employee) { await _userStateNotifier.setEmployee(member: event.employee!); log("Employee updated", name: "User Status"); @@ -98,7 +101,7 @@ class UserStateControllerBloc @override Future close() async { _spaceChangeNotifier.removeSpaceId(); - _spaceChangeNotifier.removeListener(() { }); + _spaceChangeNotifier.removeListener(() {}); await _subscription?.cancel(); return super.close(); } diff --git a/lib/data/core/extensions/map_extension.dart b/lib/data/core/extensions/map_extension.dart index c04628ae4..aced1ffef 100644 --- a/lib/data/core/extensions/map_extension.dart +++ b/lib/data/core/extensions/map_extension.dart @@ -1,4 +1,3 @@ - import '../../model/leave/leave.dart'; import 'date_time.dart'; @@ -14,9 +13,7 @@ extension MapExtensions on Map { ..add(endDate); } for (var date in dates) { - putIfAbsent( - date.dateOnly, - () => date.getLeaveDayDuration()); + putIfAbsent(date.dateOnly, () => date.getLeaveDayDuration()); } removeWhere((key, value) => !dates.contains(key)); return this; diff --git a/lib/data/core/functions/shared_function.dart b/lib/data/core/functions/shared_function.dart index 737217b42..91a43d348 100644 --- a/lib/data/core/functions/shared_function.dart +++ b/lib/data/core/functions/shared_function.dart @@ -23,7 +23,7 @@ class AppFunctions { String getNotificationDuration( {required double total, - required LeaveDayDuration firstLeaveDayDuration}) { + required LeaveDayDuration firstLeaveDayDuration}) { if (total <= 1) { if (firstLeaveDayDuration == LeaveDayDuration.firstHalfLeave) { return "First Half"; diff --git a/lib/data/core/utils/const/app_const.dart b/lib/data/core/utils/const/app_const.dart index 3b1e38641..66cd56b77 100644 --- a/lib/data/core/utils/const/app_const.dart +++ b/lib/data/core/utils/const/app_const.dart @@ -1,3 +1,3 @@ class AppConsts { - static const String appTitle = "Unity"; -} \ No newline at end of file + static const String appTitle = "Unity"; +} diff --git a/lib/data/core/utils/const/image_constant.dart b/lib/data/core/utils/const/image_constant.dart index d68ec127d..a1bae264e 100644 --- a/lib/data/core/utils/const/image_constant.dart +++ b/lib/data/core/utils/const/image_constant.dart @@ -1,8 +1,5 @@ -class ImageConst{ - static const String loginPageVectorImage = 'assets/images/office_growth.png'; - static const String googleLogoImage = 'assets/images/google_logo.png'; - static const String emptyLeaveStateImage = 'assets/images/empty_state.png'; +class ImageConst { + static const String loginPageVectorImage = 'assets/images/office_growth.png'; + static const String googleLogoImage = 'assets/images/google_logo.png'; + static const String emptyLeaveStateImage = 'assets/images/empty_state.png'; } - - - diff --git a/lib/data/core/utils/date_formatter.dart b/lib/data/core/utils/date_formatter.dart index 6f9be99f2..7a9f9d75d 100644 --- a/lib/data/core/utils/date_formatter.dart +++ b/lib/data/core/utils/date_formatter.dart @@ -23,12 +23,16 @@ class DateFormatter { return _localization.date_format_yMMMd(dt); } - String getLeaveDurationPresentation({required double totalLeaves,required LeaveDayDuration firstDayDuration}) { - if (totalLeaves < 1 && firstDayDuration == LeaveDayDuration.firstHalfLeave) { + String getLeaveDurationPresentation( + {required double totalLeaves, + required LeaveDayDuration firstDayDuration}) { + if (totalLeaves < 1 && + firstDayDuration == LeaveDayDuration.firstHalfLeave) { return _localization.dateFormatter_first_half_day; - } else if (totalLeaves < 1 && firstDayDuration == LeaveDayDuration.secondHalfLeave) { + } else if (totalLeaves < 1 && + firstDayDuration == LeaveDayDuration.secondHalfLeave) { return _localization.dateFormatter_second_half_day; - }else if (totalLeaves == 1) { + } else if (totalLeaves == 1) { return _localization.dateFormatter_full_day; } return _localization.dateFormatter_placeholder_other_days(totalLeaves); diff --git a/lib/data/model/account/account.dart b/lib/data/model/account/account.dart index e20b9235b..59f46f126 100644 --- a/lib/data/model/account/account.dart +++ b/lib/data/model/account/account.dart @@ -26,5 +26,5 @@ class Account extends Equatable { Account.fromJson(snapshot.data()!); @override - List get props => [uid, email, spaces,name]; + List get props => [uid, email, spaces, name]; } diff --git a/lib/data/model/leave_application.dart b/lib/data/model/leave_application.dart index 5f1c1aefe..3b3903ab3 100644 --- a/lib/data/model/leave_application.dart +++ b/lib/data/model/leave_application.dart @@ -6,8 +6,7 @@ class LeaveApplication extends Equatable { final Employee employee; final Leave leave; - const LeaveApplication( - {required this.employee, required this.leave }); + const LeaveApplication({required this.employee, required this.leave}); @override List get props => [employee, leave]; diff --git a/lib/data/model/leave_count.dart b/lib/data/model/leave_count.dart index 9fb3154ae..1be7f9b64 100644 --- a/lib/data/model/leave_count.dart +++ b/lib/data/model/leave_count.dart @@ -5,8 +5,7 @@ class LeaveCounts extends Equatable { final double urgentLeaves; final double casualLeaves; - const LeaveCounts( - {this.casualLeaves = 0.0, this.urgentLeaves = 0.0}) + const LeaveCounts({this.casualLeaves = 0.0, this.urgentLeaves = 0.0}) : totalUsedLeave = urgentLeaves + casualLeaves; @override diff --git a/lib/data/model/org_forms/org_form_field/org_form_field.dart b/lib/data/model/org_forms/org_form_field/org_form_field.dart index 5488432b6..29f102da5 100644 --- a/lib/data/model/org_forms/org_form_field/org_form_field.dart +++ b/lib/data/model/org_forms/org_form_field/org_form_field.dart @@ -35,7 +35,7 @@ class OrgFormField extends Equatable { @override List get props => - [question, answerType, options, isRequired, type, index,id]; + [question, answerType, options, isRequired, type, index, id]; } @JsonEnum(valueField: 'value') diff --git a/lib/data/model/org_forms/org_form_response/org_form_field_response/org_form_field_response.dart b/lib/data/model/org_forms/org_form_response/org_form_field_response/org_form_field_response.dart index 81b972f52..4154255a6 100644 --- a/lib/data/model/org_forms/org_form_response/org_form_field_response/org_form_field_response.dart +++ b/lib/data/model/org_forms/org_form_response/org_form_field_response/org_form_field_response.dart @@ -1,4 +1,3 @@ - import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; @@ -18,10 +17,10 @@ class OrgFormFieldResponse extends Equatable { Map toJson() => _$OrgFormFieldResponseToJson(this); factory OrgFormFieldResponse.fromFireStore( - DocumentSnapshot> snapshot, - SnapshotOptions? options) => + DocumentSnapshot> snapshot, + SnapshotOptions? options) => OrgFormFieldResponse.fromJson(snapshot.data()!); @override List get props => [fieldId, answer]; -} \ No newline at end of file +} diff --git a/lib/data/repo/employee_repo.dart b/lib/data/repo/employee_repo.dart index b5bb6c436..9b7f2d56b 100644 --- a/lib/data/repo/employee_repo.dart +++ b/lib/data/repo/employee_repo.dart @@ -15,7 +15,8 @@ class EmployeeRepo { late BehaviorSubject> _employeeController; StreamSubscription>? _employeeStreamSubscription; - EmployeeRepo(this._employeeService, this._userStateNotifier, this._crashlytics) { + EmployeeRepo( + this._employeeService, this._userStateNotifier, this._crashlytics) { _employeeController = BehaviorSubject>(); _employeeStreamSubscription = _employeeService .employees(_userStateNotifier.currentSpaceId!) @@ -33,8 +34,7 @@ class EmployeeRepo { Stream> get employees => _employeeController.stream.asBroadcastStream(); - List get allEmployees => - _employeeController.value; + List get allEmployees => _employeeController.value; Stream> get activeEmployees => _employeeController.stream.asyncMap((employees) => employees diff --git a/lib/data/services/auth_service.dart b/lib/data/services/auth_service.dart index 24b8cb85f..d51092cd2 100644 --- a/lib/data/services/auth_service.dart +++ b/lib/data/services/auth_service.dart @@ -16,11 +16,23 @@ class AuthService { AuthService(this._desktopAuthManager, this.fireStore, this.firebaseAuth); Future signInWithGoogle() async { + final GoogleSignIn googleSignIn = GoogleSignIn(); + firebase_auth.User? user; - if (kIsWeb || - defaultTargetPlatform == TargetPlatform.android || + if (kIsWeb) { + try { + firebase_auth.GoogleAuthProvider googleAuthProvider = + firebase_auth.GoogleAuthProvider(); + firebaseAuth.setPersistence(firebase_auth.Persistence.LOCAL); + firebase_auth.UserCredential credential = + await firebaseAuth.signInWithPopup(googleAuthProvider); + user = credential.user; + return user; + } catch(e) { + rethrow; + } + } else if (defaultTargetPlatform == TargetPlatform.android || defaultTargetPlatform == TargetPlatform.iOS) { - final GoogleSignIn googleSignIn = GoogleSignIn(); try { final GoogleSignInAccount? googleSignInAccount = await googleSignIn.signIn(); @@ -37,7 +49,7 @@ class AuthService { user = await _signInWithCredentials(credential); await googleSignIn.signOut(); } - } on Exception { + } catch (e) { rethrow; } } else if (defaultTargetPlatform == TargetPlatform.macOS || diff --git a/lib/data/services/employee_service.dart b/lib/data/services/employee_service.dart index ea24bc503..224c8180b 100644 --- a/lib/data/services/employee_service.dart +++ b/lib/data/services/employee_service.dart @@ -61,7 +61,7 @@ class EmployeeService { .where(FireStoreConst.email, isEqualTo: email) .count() .get(); - return data.count > 0; + return data.count != null ? data.count! > 0 : false; } Future updateEmployeeDetails({required Employee employee}) async { diff --git a/lib/data/services/form_service.dart b/lib/data/services/form_service.dart index 82d886c84..e18c690b8 100644 --- a/lib/data/services/form_service.dart +++ b/lib/data/services/form_service.dart @@ -59,10 +59,10 @@ class FormService { } Future> getForms({required String spaceId}) async { - final formsSnapshot = await _formsDB(spaceId: spaceId) - .orderBy(FireStoreConst.createdAt, descending: true) - .get(); - return formsSnapshot.docs.map((formDoc) => formDoc.data()).toList(); + final formsSnapshot = await _formsDB(spaceId: spaceId) + .orderBy(FireStoreConst.createdAt, descending: true) + .get(); + return formsSnapshot.docs.map((formDoc) => formDoc.data()).toList(); } Future getFormInfo( diff --git a/lib/data/services/invitation_services.dart b/lib/data/services/invitation_services.dart index 79320b6cd..ab3c8b90c 100644 --- a/lib/data/services/invitation_services.dart +++ b/lib/data/services/invitation_services.dart @@ -27,8 +27,10 @@ class InvitationService { {required String spaceId, required String email}) async { final data = await _invitationDb .where(FireStoreConst.receiverEmail, isEqualTo: email) - .where(FireStoreConst.spaceId, isEqualTo: spaceId).count().get(); - return data.count > 0; + .where(FireStoreConst.spaceId, isEqualTo: spaceId) + .count() + .get(); + return data.count != null ? data.count! > 0 : false; } Future> fetchSpaceInvitations( diff --git a/lib/data/services/mail_notification_service.dart b/lib/data/services/mail_notification_service.dart index 1ec4fd440..32ac5bedb 100644 --- a/lib/data/services/mail_notification_service.dart +++ b/lib/data/services/mail_notification_service.dart @@ -45,7 +45,7 @@ class NotificationService { name: 'Notification'); } } on Exception catch (e) { - await _crashlytics.log(e.toString()); + await _crashlytics.log(e.toString()); } } @@ -97,7 +97,7 @@ class NotificationService { log('Invite notification mail send successfully', name: 'Notification'); } } on Exception catch (e) { - await _crashlytics.log(e.toString()); + await _crashlytics.log(e.toString()); } } diff --git a/lib/data/state_manager/auth/desktop/desktop_auth_manager.dart b/lib/data/state_manager/auth/desktop/desktop_auth_manager.dart index 20e3ef7b2..8a5c48917 100644 --- a/lib/data/state_manager/auth/desktop/desktop_auth_manager.dart +++ b/lib/data/state_manager/auth/desktop/desktop_auth_manager.dart @@ -9,14 +9,12 @@ import 'desktop_manager.dart'; @Injectable() class DesktopAuthManager extends DesktopLoginManager { - - Future login() async { await redirectServer?.close(); redirectServer = await HttpServer.bind('localhost', 0); final redirectURL = redirectUrl + redirectServer!.port.toString(); oauth2.Client authenticatedHttpClient = - await _getOauthClient(Uri.parse(redirectURL)); + await _getOauthClient(Uri.parse(redirectURL)); return authenticatedHttpClient.credentials; } @@ -34,17 +32,16 @@ class DesktopAuthManager extends DesktopLoginManager { } Future signOutFromGoogle(String accessToken) async { - final Uri uri = Uri.parse(revokeTokenUrl).replace(queryParameters: { - token: accessToken}); - final http.Response response = await http.post(uri); - if (response.statusCode == 200) { - return true; + final Uri uri = Uri.parse(revokeTokenUrl) + .replace(queryParameters: {token: accessToken}); + final http.Response response = await http.post(uri); + if (response.statusCode == 200) { + return true; } else { return false; } } - - } +} class _JsonAcceptingHttpClient extends http.BaseClient { final _httpClient = http.Client(); @@ -54,11 +51,4 @@ class _JsonAcceptingHttpClient extends http.BaseClient { request.headers[headerTitle] = headerData; return _httpClient.send(request); } - } - - - - - - diff --git a/lib/data/state_manager/auth/desktop/desktop_manager.dart b/lib/data/state_manager/auth/desktop/desktop_manager.dart index 3ce00d478..acb600a44 100644 --- a/lib/data/state_manager/auth/desktop/desktop_manager.dart +++ b/lib/data/state_manager/auth/desktop/desktop_manager.dart @@ -1,34 +1,31 @@ import 'dart:io'; -import 'package:oauth2/oauth2.dart'as oauth2; +import 'package:oauth2/oauth2.dart' as oauth2; import 'package:projectunity/data/configs/api.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:window_to_front/window_to_front.dart'; -class DesktopLoginManager{ +class DesktopLoginManager { HttpServer? redirectServer; oauth2.Client? client; - Future redirect(Uri authorizationUri)async{ - if(await canLaunchUrl(authorizationUri)){ + Future redirect(Uri authorizationUri) async { + if (await canLaunchUrl(authorizationUri)) { await launchUrl(authorizationUri); - }else{ + } else { throw Exception('Can not launch $authorizationUri'); } } - Future> listen()async{ - var request= await redirectServer!.first; - var params= request.uri.queryParameters; + Future> listen() async { + var request = await redirectServer!.first; + var params = request.uri.queryParameters; await WindowToFront.activate(); - request.response.statusCode=200; + request.response.statusCode = 200; request.response.headers.set('content-type', 'text/plain'); request.response.writeln(authenticatedResponse); await request.response.close(); await redirectServer!.close(); - redirectServer= null; + redirectServer = null; return params; } - - - -} \ No newline at end of file +} diff --git a/lib/main.dart b/lib/main.dart index 1b036139d..c9ad28256 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -57,9 +57,7 @@ class MyApp extends StatelessWidget { BlocProvider( create: (context) => _networkConnectionBloc..add(NetworkConnectionObserveEvent())), - BlocProvider( - create: (context) => - getIt()), + BlocProvider(create: (context) => getIt()), ], child: GestureDetector( onTap: () { diff --git a/lib/ui/admin/drawer_options/edit_space/bloc/edit_space_bloc.dart b/lib/ui/admin/drawer_options/edit_space/bloc/edit_space_bloc.dart index 5ab9d8720..b2372b481 100644 --- a/lib/ui/admin/drawer_options/edit_space/bloc/edit_space_bloc.dart +++ b/lib/ui/admin/drawer_options/edit_space/bloc/edit_space_bloc.dart @@ -62,8 +62,12 @@ class EditSpaceBloc extends Bloc DeleteSpaceEvent event, Emitter emit) async { emit(state.copyWith(deleteWorkSpaceStatus: Status.loading)); try { - await _spaceService.deleteSpace(spaceId: _userStateNotifier.currentSpace!.id, owners: _userStateNotifier.currentSpace!.ownerIds,uid: _userStateNotifier.employeeId); - await _storageService.deleteStorageFolder("images/${_userStateNotifier.currentSpaceId}"); + await _spaceService.deleteSpace( + spaceId: _userStateNotifier.currentSpace!.id, + owners: _userStateNotifier.currentSpace!.ownerIds, + uid: _userStateNotifier.employeeId); + await _storageService + .deleteStorageFolder("images/${_userStateNotifier.currentSpaceId}"); await _userStateNotifier.removeEmployeeWithSpace(); emit(state.copyWith(deleteWorkSpaceStatus: Status.success)); } on Exception { @@ -74,7 +78,8 @@ class EditSpaceBloc extends Bloc Future _pickImage( PickImageEvent event, Emitter emit) async { - final XFile? image = await _imagePicker.pickImage(source: event.imageSource); + final XFile? image = + await _imagePicker.pickImage(source: event.imageSource); if (image != null) { emit(state.copyWith(logo: image.path, isLogoPickedDone: true)); } @@ -89,7 +94,8 @@ class EditSpaceBloc extends Bloc String? logoURL = space.logo; if (state.logo.isNotNullOrEmpty) { - final String storagePath = ImageStoragePath.spaceLogoPath(spaceId: _userStateNotifier.currentSpaceId!); + final String storagePath = ImageStoragePath.spaceLogoPath( + spaceId: _userStateNotifier.currentSpaceId!); logoURL = await _storageService.uploadProfilePic( path: storagePath, imagePath: state.logo!); } diff --git a/lib/ui/admin/drawer_options/edit_space/bloc/edit_space_state.dart b/lib/ui/admin/drawer_options/edit_space/bloc/edit_space_state.dart index eb5b12948..5eb7f44a6 100644 --- a/lib/ui/admin/drawer_options/edit_space/bloc/edit_space_state.dart +++ b/lib/ui/admin/drawer_options/edit_space/bloc/edit_space_state.dart @@ -43,7 +43,8 @@ class EditSpaceState extends Equatable { yearlyPaidTimeOffIsValid: yearlyPaidTimeOffIsValid ?? this.yearlyPaidTimeOffIsValid); - bool get isDataValid => nameIsValid && yearlyPaidTimeOffIsValid && notificationEmailIsValid; + bool get isDataValid => + nameIsValid && yearlyPaidTimeOffIsValid && notificationEmailIsValid; bool get isFailure => (updateSpaceStatus != Status.error || diff --git a/lib/ui/admin/drawer_options/edit_space/edit_space_screen.dart b/lib/ui/admin/drawer_options/edit_space/edit_space_screen.dart index 36705628b..58b48d1b7 100644 --- a/lib/ui/admin/drawer_options/edit_space/edit_space_screen.dart +++ b/lib/ui/admin/drawer_options/edit_space/edit_space_screen.dart @@ -175,7 +175,8 @@ class _EditSpaceScreenState extends State { .read() .add(NotificationEmailChangeEvent(notificationEmail)), controller: _notificationEmailController, - hintText: AppLocalizations.of(context).leave_notification_email_tag, + hintText: + AppLocalizations.of(context).leave_notification_email_tag, ), const DeleteSpaceButton(), ], diff --git a/lib/ui/admin/forms/create_form/bloc/create_form_bloc.dart b/lib/ui/admin/forms/create_form/bloc/create_form_bloc.dart index 499dd9ca4..906ab5a47 100644 --- a/lib/ui/admin/forms/create_form/bloc/create_form_bloc.dart +++ b/lib/ui/admin/forms/create_form/bloc/create_form_bloc.dart @@ -242,7 +242,8 @@ class CreateFormBloc extends Bloc { id: state.formId, title: state.title, createdAt: DateTime.now(), - description: state.description.isEmpty ? null : state.description, + description: + state.description.isEmpty ? null : state.description, oneTimeResponse: state.limitToOneResponse, headerImage: headerImageUrl), fields: fields)); diff --git a/lib/ui/admin/forms/create_form/bloc/org_form_field_update_data_model.dart b/lib/ui/admin/forms/create_form/bloc/org_form_field_update_data_model.dart index 2296b72a8..1f996e8f7 100644 --- a/lib/ui/admin/forms/create_form/bloc/org_form_field_update_data_model.dart +++ b/lib/ui/admin/forms/create_form/bloc/org_form_field_update_data_model.dart @@ -51,5 +51,5 @@ class OrgFormFieldCreateFormState extends Equatable { @override List get props => - [question, inputType, options, isRequired, type, index, image,id]; + [question, inputType, options, isRequired, type, index, image, id]; } diff --git a/lib/ui/admin/forms/create_form/widget/org_create_form_info_view.dart b/lib/ui/admin/forms/create_form/widget/org_create_form_info_view.dart index 069d182c6..7fad44e90 100644 --- a/lib/ui/admin/forms/create_form/widget/org_create_form_info_view.dart +++ b/lib/ui/admin/forms/create_form/widget/org_create_form_info_view.dart @@ -83,7 +83,8 @@ class HeaderImageView extends StatelessWidget { ? DecorationImage( fit: BoxFit.scaleDown, image: kIsWeb - ? NetworkImage(state.formHeaderImage!) as ImageProvider + ? NetworkImage(state.formHeaderImage!) + as ImageProvider : FileImage(File(state.formHeaderImage!))) : null), child: Column( diff --git a/lib/ui/admin/forms/create_form/widget/org_field_question_view.dart b/lib/ui/admin/forms/create_form/widget/org_field_question_view.dart index 29ba23d9e..a10a10043 100644 --- a/lib/ui/admin/forms/create_form/widget/org_field_question_view.dart +++ b/lib/ui/admin/forms/create_form/widget/org_field_question_view.dart @@ -50,11 +50,12 @@ class FormFieldView extends StatelessWidget { OrgFormDropDownButton( value: orgFormField.inputType, items: FormFieldAnswerType.values - .map((fieldInputType) => DropdownMenuItem( - alignment: Alignment.center, - value: fieldInputType, - child: Text(locale.org_form_answer_type( - fieldInputType.value.toString())))) + .map((fieldInputType) => + DropdownMenuItem( + alignment: Alignment.center, + value: fieldInputType, + child: Text(locale.org_form_answer_type( + fieldInputType.value.toString())))) .toList(), onChanged: (type) { if (type != null) { diff --git a/lib/ui/admin/forms/create_form/widget/org_form_dropdown.dart b/lib/ui/admin/forms/create_form/widget/org_form_dropdown.dart index b0253a33c..fb7f17838 100644 --- a/lib/ui/admin/forms/create_form/widget/org_form_dropdown.dart +++ b/lib/ui/admin/forms/create_form/widget/org_form_dropdown.dart @@ -33,4 +33,4 @@ class OrgFormDropDownButton extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/ui/admin/forms/form_list/widget/form_card.dart b/lib/ui/admin/forms/form_list/widget/form_card.dart index 3cb00ca23..906f2a5b0 100644 --- a/lib/ui/admin/forms/form_list/widget/form_card.dart +++ b/lib/ui/admin/forms/form_list/widget/form_card.dart @@ -36,8 +36,9 @@ class AdminListFormCard extends StatelessWidget { }, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text(AppLocalizations.of(context).responses_tag, style: AppFontStyle.bodyLarge), + children: [ + Text(AppLocalizations.of(context).responses_tag, + style: AppFontStyle.bodyLarge), const Icon(Icons.arrow_forward, size: 20) ], ), diff --git a/lib/ui/admin/home/home_screen/admin_home_screen.dart b/lib/ui/admin/home/home_screen/admin_home_screen.dart index 6bb20d9f1..ecbaba2d7 100644 --- a/lib/ui/admin/home/home_screen/admin_home_screen.dart +++ b/lib/ui/admin/home/home_screen/admin_home_screen.dart @@ -25,13 +25,15 @@ class AdminHomeScreenPage extends StatelessWidget { return MultiBlocProvider( providers: [ BlocProvider( - create: (context) => getIt.get()..add(AdminHomeInitialLoadEvent()), + create: (context) => + getIt.get()..add(AdminHomeInitialLoadEvent()), ), - BlocProvider(create: (context) => getIt()..add(FetchWhoIsOutCardLeaves())), + BlocProvider( + create: (context) => + getIt()..add(FetchWhoIsOutCardLeaves())), ], child: const AdminHomeScreen(), ); - } } @@ -57,15 +59,13 @@ class _AdminHomeScreenState extends State { child: WhoIsOutCard(), ), BlocConsumer( - listenWhen: (previous, current) => - current.status == Status.error, + listenWhen: (previous, current) => current.status == Status.error, listener: (context, state) { if (state.status == Status.error) { showSnackBar(context: context, error: state.error); } }, - buildWhen: (previous, current) => - current.status != Status.error, + buildWhen: (previous, current) => current.status != Status.error, builder: (context, state) { if (state.status == Status.success && state.leaveAppMap.isNotEmpty) { @@ -74,16 +74,13 @@ class _AdminHomeScreenState extends State { return ConstrainedBox( constraints: const BoxConstraints(minHeight: 300), child: SizedBox( - height: MediaQuery - .of(context) - .size - .height - 500, + height: MediaQuery.of(context).size.height - 500, child: state.status == Status.loading ? const AppCircularProgressIndicator() : EmptyScreen( - message: locale.empty_request_message, - title: locale.empty_request_title, - ), + message: locale.empty_request_message, + title: locale.empty_request_title, + ), ), ); }), diff --git a/lib/ui/admin/home/home_screen/bloc/admin_home_bloc.dart b/lib/ui/admin/home/home_screen/bloc/admin_home_bloc.dart index 16d320026..644d684ed 100644 --- a/lib/ui/admin/home/home_screen/bloc/admin_home_bloc.dart +++ b/lib/ui/admin/home/home_screen/bloc/admin_home_bloc.dart @@ -44,7 +44,8 @@ class AdminHomeBloc extends Bloc { Map> convertListToMap( List leaveApplications) { - leaveApplications.sort((a, b) => b.leave.appliedOn.compareTo(a.leave.appliedOn)); + leaveApplications + .sort((a, b) => b.leave.appliedOn.compareTo(a.leave.appliedOn)); return leaveApplications.groupBy( (leaveApplication) => leaveApplication.leave.appliedOn.dateOnly); } diff --git a/lib/ui/admin/home/invite_member/bloc/invite_member_event.dart b/lib/ui/admin/home/invite_member/bloc/invite_member_event.dart index b4c5ebea7..bf3ab3e3d 100644 --- a/lib/ui/admin/home/invite_member/bloc/invite_member_event.dart +++ b/lib/ui/admin/home/invite_member/bloc/invite_member_event.dart @@ -1,6 +1,5 @@ import 'package:equatable/equatable.dart'; - abstract class InvitationEvent extends Equatable {} class AddEmailEvent extends InvitationEvent { diff --git a/lib/ui/admin/leaves/leave_screen/admin_leaves_screen.dart b/lib/ui/admin/leaves/leave_screen/admin_leaves_screen.dart index 4cc479bf5..6c6b18157 100644 --- a/lib/ui/admin/leaves/leave_screen/admin_leaves_screen.dart +++ b/lib/ui/admin/leaves/leave_screen/admin_leaves_screen.dart @@ -148,5 +148,3 @@ class _AdminLeavesScreenState extends State { ); } } - - diff --git a/lib/ui/admin/leaves/leave_screen/bloc /admin_leave_event.dart b/lib/ui/admin/leaves/leave_screen/bloc /admin_leave_event.dart index 8f089af9f..702137c9d 100644 --- a/lib/ui/admin/leaves/leave_screen/bloc /admin_leave_event.dart +++ b/lib/ui/admin/leaves/leave_screen/bloc /admin_leave_event.dart @@ -38,4 +38,4 @@ class UpdateLeaveApplication extends AdminLeavesEvents { @override List get props => [leaveId]; -} \ No newline at end of file +} diff --git a/lib/ui/admin/leaves/leave_screen/widget/month_leave_list.dart b/lib/ui/admin/leaves/leave_screen/widget/month_leave_list.dart index 8b58f03f4..db97fcdc6 100644 --- a/lib/ui/admin/leaves/leave_screen/widget/month_leave_list.dart +++ b/lib/ui/admin/leaves/leave_screen/widget/month_leave_list.dart @@ -12,10 +12,10 @@ class MonthLeaveList extends StatelessWidget { const MonthLeaveList( {super.key, - required this.leaveApplications, - required this.isPaginationLoading, - required this.showLeaveApplicationCard, - required this.onCardTap}); + required this.leaveApplications, + required this.isPaginationLoading, + required this.showLeaveApplicationCard, + required this.onCardTap}); @override Widget build(BuildContext context) { @@ -45,4 +45,4 @@ class MonthLeaveList extends StatelessWidget { separatorBuilder: (context, index) => const SizedBox(height: 16), ); } -} \ No newline at end of file +} diff --git a/lib/ui/admin/members/detail/employee_detail_screen.dart b/lib/ui/admin/members/detail/employee_detail_screen.dart index 0ef8b1799..52c20ce52 100644 --- a/lib/ui/admin/members/detail/employee_detail_screen.dart +++ b/lib/ui/admin/members/detail/employee_detail_screen.dart @@ -51,61 +51,60 @@ class _EmployeeDetailScreenState extends State { ), actions: [ BlocBuilder( - builder: (context, state){ - if(state is EmployeeDetailLoadedState){ - return PopupMenuButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), + builder: (context, state) { + if (state is EmployeeDetailLoadedState) { + return PopupMenuButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + elevation: 6, + itemBuilder: (context) => [ + PopupMenuItem( + child: Text(AppLocalizations.of(context).edit_tag), + onTap: () { + context.goNamed(Routes.adminEditEmployee, + extra: state.employee, + pathParameters: { + RoutesParamsConst.employeeId: state.employee.uid + }); + }, ), - elevation: 6, - itemBuilder: (context) => [ - PopupMenuItem( - child: Text(AppLocalizations.of(context).edit_tag), - onTap: () { - context.goNamed(Routes.adminEditEmployee, - extra: state.employee, - params: { - RoutesParamsConst.employeeId: - state.employee.uid - }); - }, - ), - PopupMenuItem( - child: Text( - state.employee.status == EmployeeStatus.active? - AppLocalizations.of(context).deactivate_tag - :AppLocalizations.of(context).activate_tag, - ), - onTap: () { - if (state.employee.status == - EmployeeStatus.inactive) { - context.read().add( - EmployeeStatusChangeEvent( - status: EmployeeStatus.active, - employeeId: widget.employeeId)); - } else { - showAlertDialog( - context: context, - title: - AppLocalizations.of(context).deactivate_tag, - description: AppLocalizations.of(context) - .deactivate_user_account_alert( - state.employee.name), - onActionButtonPressed: () { - context.read().add( - EmployeeStatusChangeEvent( - status: EmployeeStatus.inactive, - employeeId: widget.employeeId)); - context.pop(); - }, - actionButtonTitle: - AppLocalizations.of(context).deactivate_tag, - ); - } - }, + PopupMenuItem( + child: Text( + state.employee.status == EmployeeStatus.active + ? AppLocalizations.of(context).deactivate_tag + : AppLocalizations.of(context).activate_tag, ), - ], - ); + onTap: () { + if (state.employee.status == + EmployeeStatus.inactive) { + context.read().add( + EmployeeStatusChangeEvent( + status: EmployeeStatus.active, + employeeId: widget.employeeId)); + } else { + showAlertDialog( + context: context, + title: + AppLocalizations.of(context).deactivate_tag, + description: AppLocalizations.of(context) + .deactivate_user_account_alert( + state.employee.name), + onActionButtonPressed: () { + context.read().add( + EmployeeStatusChangeEvent( + status: EmployeeStatus.inactive, + employeeId: widget.employeeId)); + context.pop(); + }, + actionButtonTitle: + AppLocalizations.of(context).deactivate_tag, + ); + } + }, + ), + ], + ); } return const SizedBox(); }, diff --git a/lib/ui/admin/members/detail/widget/profile_detail.dart b/lib/ui/admin/members/detail/widget/profile_detail.dart index 38705a307..60971feef 100644 --- a/lib/ui/admin/members/detail/widget/profile_detail.dart +++ b/lib/ui/admin/members/detail/widget/profile_detail.dart @@ -43,4 +43,3 @@ class ProfileDetail extends StatelessWidget { ); } } - diff --git a/lib/ui/admin/members/detail/widget/time_off_card.dart b/lib/ui/admin/members/detail/widget/time_off_card.dart index 97b0b4c46..fc31ff52a 100644 --- a/lib/ui/admin/members/detail/widget/time_off_card.dart +++ b/lib/ui/admin/members/detail/widget/time_off_card.dart @@ -37,8 +37,8 @@ class TimeOffCard extends StatelessWidget { borderRadius: AppTheme.commonBorderRadius, child: InkWell( borderRadius: AppTheme.commonBorderRadius, - onTap: () => - context.goNamed(Routes.adminEmployeeDetailsLeaves, params: { + onTap: () => context + .goNamed(Routes.adminEmployeeDetailsLeaves, pathParameters: { RoutesParamsConst.employeeId: employee.uid, RoutesParamsConst.employeeName: employee.name, }), diff --git a/lib/ui/admin/members/details_leaves/widget/leave_list.dart b/lib/ui/admin/members/details_leaves/widget/leave_list.dart index b6fa2b8f5..4aac1ea8a 100644 --- a/lib/ui/admin/members/details_leaves/widget/leave_list.dart +++ b/lib/ui/admin/members/details_leaves/widget/leave_list.dart @@ -52,7 +52,7 @@ class _EmployeeLeaveListState extends State { navigateToLeaveDetail(Leave leave) async { final bloc = context.read(); final String? leaveId = await context - .pushNamed(Routes.adminEmployeeDetailsLeavesDetails, params: { + .pushNamed(Routes.adminEmployeeDetailsLeavesDetails, pathParameters: { RoutesParamsConst.employeeId: leave.uid, RoutesParamsConst.leaveId: leave.leaveId, RoutesParamsConst.employeeName: widget.employeeName, diff --git a/lib/ui/admin/members/edit_employee/bloc/admin_edit_employee_bloc.dart b/lib/ui/admin/members/edit_employee/bloc/admin_edit_employee_bloc.dart index bf2c87874..45763be3d 100644 --- a/lib/ui/admin/members/edit_employee/bloc/admin_edit_employee_bloc.dart +++ b/lib/ui/admin/members/edit_employee/bloc/admin_edit_employee_bloc.dart @@ -104,7 +104,9 @@ class AdminEditEmployeeDetailsBloc if (state.pickedImage != null) { imageUrl = await _storageService.uploadProfilePic( - path: ImageStoragePath.membersProfilePath(spaceId: _userStateNotifier.currentSpaceId!, uid: event.previousEmployeeData.uid), + path: ImageStoragePath.membersProfilePath( + spaceId: _userStateNotifier.currentSpaceId!, + uid: event.previousEmployeeData.uid), imagePath: state.pickedImage!); } diff --git a/lib/ui/admin/members/list/bloc/member_list_bloc.dart b/lib/ui/admin/members/list/bloc/member_list_bloc.dart index 8141ca931..74e3fbd20 100644 --- a/lib/ui/admin/members/list/bloc/member_list_bloc.dart +++ b/lib/ui/admin/members/list/bloc/member_list_bloc.dart @@ -16,8 +16,8 @@ class AdminMembersBloc extends Bloc { final UserStateNotifier _userStateNotifier; final InvitationService _invitationService; - AdminMembersBloc(this._employeeRepo, this._invitationService, - this._userStateNotifier) + AdminMembersBloc( + this._employeeRepo, this._invitationService, this._userStateNotifier) : super(const AdminMembersState()) { on(_onPageLoad); on(_cancelInvitation); @@ -31,8 +31,7 @@ class AdminMembersBloc extends Bloc { try { _invitationService .fetchSpaceInvitations(spaceId: _userStateNotifier.currentSpaceId!) - .then((invitation) => - emit(state.copyWith( + .then((invitation) => emit(state.copyWith( invitation: invitation, invitationFetchStatus: Status.success))); } on Exception { emit(state.copyWith( @@ -40,27 +39,24 @@ class AdminMembersBloc extends Bloc { } try { return emit.forEach(_employeeRepo.employees, - onData: (List members) => - state.copyWith( - activeMembers: members - .where((emp) => emp.status == EmployeeStatus.active) - .toList(), - inactiveMembers: members - .where((emp) => emp.status == EmployeeStatus.inactive) - .toList(), - memberFetchStatus: Status.success), - onError: (error, stackTrace) => - state.copyWith( - error: firestoreFetchDataError, - memberFetchStatus: Status.error)); + onData: (List members) => state.copyWith( + activeMembers: members + .where((emp) => emp.status == EmployeeStatus.active) + .toList(), + inactiveMembers: members + .where((emp) => emp.status == EmployeeStatus.inactive) + .toList(), + memberFetchStatus: Status.success), + onError: (error, stackTrace) => state.copyWith( + error: firestoreFetchDataError, memberFetchStatus: Status.error)); } on Exception { emit(state.copyWith( error: firestoreFetchDataError, memberFetchStatus: Status.error)); } } - Future _cancelInvitation(CancelUserInvitation event, - Emitter emit) async { + Future _cancelInvitation( + CancelUserInvitation event, Emitter emit) async { emit(state.copyWith(invitationFetchStatus: Status.loading)); try { await _invitationService.deleteInvitation(id: event.id); diff --git a/lib/ui/admin/members/list/bloc/member_list_event.dart b/lib/ui/admin/members/list/bloc/member_list_event.dart index d9210263b..43b3c923d 100644 --- a/lib/ui/admin/members/list/bloc/member_list_event.dart +++ b/lib/ui/admin/members/list/bloc/member_list_event.dart @@ -1,5 +1,7 @@ -abstract class AdminMembersEvents {} +abstract class AdminMembersEvents {} + class AdminMembersInitialLoadEvent extends AdminMembersEvents {} + class CancelUserInvitation extends AdminMembersEvents { final String id; CancelUserInvitation(this.id); diff --git a/lib/ui/admin/members/list/bloc/member_list_state.dart b/lib/ui/admin/members/list/bloc/member_list_state.dart index aa02e4008..65d7ff385 100644 --- a/lib/ui/admin/members/list/bloc/member_list_state.dart +++ b/lib/ui/admin/members/list/bloc/member_list_state.dart @@ -13,7 +13,7 @@ class AdminMembersState extends Equatable { const AdminMembersState( {this.activeMembers = const [], - this.inactiveMembers = const [], + this.inactiveMembers = const [], this.invitation = const [], this.memberFetchStatus = Status.initial, this.invitationFetchStatus = Status.initial, @@ -30,7 +30,8 @@ class AdminMembersState extends Equatable { activeMembers: activeMembers ?? this.activeMembers, inactiveMembers: inactiveMembers ?? this.inactiveMembers, memberFetchStatus: memberFetchStatus ?? this.memberFetchStatus, - invitationFetchStatus: invitationFetchStatus ?? this.invitationFetchStatus, + invitationFetchStatus: + invitationFetchStatus ?? this.invitationFetchStatus, invitation: invitation ?? this.invitation, error: error, ); diff --git a/lib/ui/admin/members/list/member_list_screen.dart b/lib/ui/admin/members/list/member_list_screen.dart index 8bcd981d8..df717004a 100644 --- a/lib/ui/admin/members/list/member_list_screen.dart +++ b/lib/ui/admin/members/list/member_list_screen.dart @@ -79,7 +79,7 @@ class _MemberListScreenState extends State { employee: state.activeMembers[index], onTap: () => context.goNamed( Routes.adminMemberDetails, - params: { + queryParameters: { RoutesParamsConst.employeeId: state.activeMembers[index].uid }), @@ -117,7 +117,7 @@ class _MemberListScreenState extends State { employee: state.inactiveMembers[index], onTap: () => context.goNamed( Routes.adminMemberDetails, - params: { + pathParameters: { RoutesParamsConst.employeeId: state.inactiveMembers[index].uid }), diff --git a/lib/ui/navigation/app_router.dart b/lib/ui/navigation/app_router.dart index e89e53782..881b12407 100644 --- a/lib/ui/navigation/app_router.dart +++ b/lib/ui/navigation/app_router.dart @@ -192,8 +192,8 @@ class AppRouter { path: Routes.adminMemberDetails, pageBuilder: (context, state) => CupertinoPage( child: EmployeeDetailPage( - id: state - .params[RoutesParamsConst.employeeId]!)), + id: state.pathParameters[ + RoutesParamsConst.employeeId]!)), routes: [ GoRoute( parentNavigatorKey: _adminShellNavigatorKey, @@ -208,17 +208,17 @@ class AppRouter { pageBuilder: (context, state) => CupertinoPage( child: UserLeaveDetailPage( - leaveId: state.params[ + leaveId: state.pathParameters[ RoutesParamsConst .leaveId]!)), ), ], pageBuilder: (context, state) => CupertinoPage( child: AdminEmployeeDetailsLeavesPage( - employeeName: state.params[ + employeeName: state.pathParameters[ RoutesParamsConst.employeeName] ?? "", - employeeId: state.params[ + employeeId: state.pathParameters[ RoutesParamsConst.employeeId]!, ))), GoRoute( @@ -276,16 +276,16 @@ class AppRouter { pageBuilder: (context, state) { return CupertinoPage( child: UserLeaveDetailPage( - leaveId: state - .params[RoutesParamsConst.leaveId]!)); + leaveId: state.pathParameters[ + RoutesParamsConst.leaveId]!)); }), GoRoute( name: Routes.userAbsenceDetails, path: Routes.userAbsenceDetails, pageBuilder: (context, state) => CupertinoPage( child: UserLeaveDetailPage( - leaveId: - state.params[RoutesParamsConst.leaveId]!)), + leaveId: state.pathParameters[ + RoutesParamsConst.leaveId]!)), ), ]), GoRoute( @@ -308,8 +308,8 @@ class AppRouter { path: Routes.userLeaveDetail, pageBuilder: (context, state) => CupertinoPage( child: UserLeaveDetailPage( - leaveId: - state.params[RoutesParamsConst.leaveId]!)), + leaveId: state.pathParameters[ + RoutesParamsConst.leaveId]!)), ), ]), GoRoute( @@ -331,18 +331,19 @@ class AppRouter { ]), ]) ], - redirect: (context, state) { - final loggingIn = state.subloc == Routes.login; + redirect: (context, GoRouterState state) { + final location = state.matchedLocation; + final loggingIn = location == Routes.login; if (userManager.state == UserState.unauthenticated) { return loggingIn ? null : Routes.login; } if (userManager.state == UserState.authenticated && - !state.subloc.contains(Routes.joinSpace)) { + !location.contains(Routes.joinSpace)) { return Routes.joinSpace; } if (userManager.state == UserState.update || (userManager.state == UserState.spaceJoined && - state.subloc.contains(Routes.joinSpace))) { + location.contains(Routes.joinSpace))) { return userManager.isAdmin || userManager.isHR ? Routes.adminHome : Routes.userHome; @@ -352,6 +353,17 @@ class AppRouter { } } +extension GoRouterExtension on GoRouter { + String location() { + final RouteMatch lastMatch = routerDelegate.currentConfiguration.last; + final RouteMatchList matchList = lastMatch is ImperativeRouteMatch + ? lastMatch.matches + : routerDelegate.currentConfiguration; + final String location = matchList.uri.toString(); + return location; + } +} + abstract class RoutesParamsConst { static const employeeId = "employeeId"; static const employeeName = "employeeName"; diff --git a/lib/ui/shared/appbar_drawer/drawer/widget/drawer_space_card.dart b/lib/ui/shared/appbar_drawer/drawer/widget/drawer_space_card.dart index 2eddc9c1d..e416a50d0 100644 --- a/lib/ui/shared/appbar_drawer/drawer/widget/drawer_space_card.dart +++ b/lib/ui/shared/appbar_drawer/drawer/widget/drawer_space_card.dart @@ -11,18 +11,23 @@ class DrawerSpaceCard extends StatelessWidget { final String? logo; final Function()? onTap; - const DrawerSpaceCard({Key? key, required this.name, this.logo, this.onTap, required this.isSelected}) + const DrawerSpaceCard( + {Key? key, + required this.name, + this.logo, + this.onTap, + required this.isSelected}) : super(key: key); @override Widget build(BuildContext context) { return InkWell( - onTap: isSelected?null:onTap, + onTap: isSelected ? null : onTap, borderRadius: AppTheme.commonBorderRadius, child: DecoratedBox( decoration: BoxDecoration( borderRadius: AppTheme.commonBorderRadius, - color: isSelected?AppColors.lightGreyColor:null, + color: isSelected ? AppColors.lightGreyColor : null, ), child: Padding( padding: const EdgeInsets.all(5), diff --git a/lib/ui/shared/dashboard/dashboard.dart b/lib/ui/shared/dashboard/dashboard.dart index 82b4ebdaa..22e4f367a 100644 --- a/lib/ui/shared/dashboard/dashboard.dart +++ b/lib/ui/shared/dashboard/dashboard.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:go_router/go_router.dart'; +import 'package:projectunity/ui/navigation/app_router.dart'; import 'package:projectunity/ui/shared/dashboard/navigation_item.dart'; import 'package:projectunity/ui/shared/appbar_drawer/drawer/app_drawer.dart'; import '../../../data/bloc/user_state/user_controller_state.dart'; @@ -22,7 +23,7 @@ class DashBoardScreen extends StatefulWidget { } class _DashBoardScreenState extends State { - int get _currentIndex => locationToTabIndex(GoRouter.of(context).location); + int get _currentIndex => locationToTabIndex(GoRouter.of(context).location()); @override Widget build(BuildContext context) { diff --git a/lib/ui/shared/profile/edit_profile/bloc/employee_edit_profile_bloc.dart b/lib/ui/shared/profile/edit_profile/bloc/employee_edit_profile_bloc.dart index fcdefbb9e..7862c75c3 100644 --- a/lib/ui/shared/profile/edit_profile/bloc/employee_edit_profile_bloc.dart +++ b/lib/ui/shared/profile/edit_profile/bloc/employee_edit_profile_bloc.dart @@ -34,8 +34,7 @@ class EmployeeEditProfileBloc void _init(EditProfileInitialLoadEvent event, Emitter emit) { - emit(state.copyWith( - gender: event.gender, dateOfBirth: event.dateOfBirth)); + emit(state.copyWith(gender: event.gender, dateOfBirth: event.dateOfBirth)); } Future _changeImage( @@ -98,7 +97,8 @@ class EmployeeEditProfileBloc } Future _saveImage() async { - final String storagePath = ImageStoragePath.membersProfilePath(spaceId: _userManager.currentSpaceId!, uid: _userManager.userUID!); + final String storagePath = ImageStoragePath.membersProfilePath( + spaceId: _userManager.currentSpaceId!, uid: _userManager.userUID!); if (state.imageURL != null) { try { diff --git a/lib/ui/shared/profile/edit_profile/bloc/employee_edit_profile_state.dart b/lib/ui/shared/profile/edit_profile/bloc/employee_edit_profile_state.dart index 982e37984..f5d904efe 100644 --- a/lib/ui/shared/profile/edit_profile/bloc/employee_edit_profile_state.dart +++ b/lib/ui/shared/profile/edit_profile/bloc/employee_edit_profile_state.dart @@ -62,5 +62,6 @@ class EmployeeEditProfileState extends Equatable { } @override - List get props => [gender, dateOfBirth, status, nameError, error, imageURL]; + List get props => + [gender, dateOfBirth, status, nameError, error, imageURL]; } diff --git a/lib/ui/shared/profile/edit_profile/edit_profile_screen.dart b/lib/ui/shared/profile/edit_profile/edit_profile_screen.dart index b5f7566d7..5a9f80b1e 100644 --- a/lib/ui/shared/profile/edit_profile/edit_profile_screen.dart +++ b/lib/ui/shared/profile/edit_profile/edit_profile_screen.dart @@ -77,9 +77,10 @@ class _EmployeeEditProfileScreenState extends State { title: Text(AppLocalizations.of(context).edit_tag), actions: [ BlocBuilder( - buildWhen: (previous, current) => previous.status != current.status || previous.isDataValid != current.isDataValid, - builder: (context, state) => state.status == - Status.loading + buildWhen: (previous, current) => + previous.status != current.status || + previous.isDataValid != current.isDataValid, + builder: (context, state) => state.status == Status.loading ? const Padding( padding: EdgeInsets.only(right: 30), child: AppCircularProgressIndicator(size: 20), @@ -87,17 +88,19 @@ class _EmployeeEditProfileScreenState extends State { : Padding( padding: const EdgeInsets.only(right: 10), child: TextButton( - onPressed: state.isDataValid?() { - context - .read() - .add(EditProfileUpdateProfileEvent( - address: addressController.text, - level: levelController.text, - name: nameController.text, - designation: designationController.text, - phoneNumber: phoneNumberController.text, - )); - }:null, + onPressed: state.isDataValid + ? () { + context + .read() + .add(EditProfileUpdateProfileEvent( + address: addressController.text, + level: levelController.text, + name: nameController.text, + designation: designationController.text, + phoneNumber: phoneNumberController.text, + )); + } + : null, child: Text(AppLocalizations.of(context).save_tag)), ), ) diff --git a/lib/ui/shared/profile/edit_profile/widget/profile_form.dart b/lib/ui/shared/profile/edit_profile/widget/profile_form.dart index 31f6fd821..67b4e4099 100644 --- a/lib/ui/shared/profile/edit_profile/widget/profile_form.dart +++ b/lib/ui/shared/profile/edit_profile/widget/profile_form.dart @@ -38,7 +38,8 @@ class ProfileForm extends StatelessWidget { return ListView( padding: const EdgeInsets.all(primaryHorizontalSpacing).copyWith(top: 30), children: [ - ProfileImagePicker(imageURl: profileImageURL, + ProfileImagePicker( + imageURl: profileImageURL, onPickImageChange: (String image) => context .read() .add(ChangeImageEvent(image)), @@ -110,8 +111,7 @@ class GenderSelection extends StatelessWidget { borderRadius: AppTheme.commonBorderRadius, )), onPressed: () { - bloc.add(EditProfileChangeGenderEvent( - gender: Gender.male)); + bloc.add(EditProfileChangeGenderEvent(gender: Gender.male)); }, child: Text( localization.gender_male_tag, @@ -124,8 +124,7 @@ class GenderSelection extends StatelessWidget { Expanded( child: ElevatedButton( onPressed: () { - bloc.add(EditProfileChangeGenderEvent( - gender: Gender.female)); + bloc.add(EditProfileChangeGenderEvent(gender: Gender.female)); }, style: ElevatedButton.styleFrom( foregroundColor: state.gender == Gender.female diff --git a/lib/ui/shared/profile/view_profile/view_profle_screen.dart b/lib/ui/shared/profile/view_profile/view_profle_screen.dart index 30461cd56..111bb5900 100644 --- a/lib/ui/shared/profile/view_profile/view_profle_screen.dart +++ b/lib/ui/shared/profile/view_profile/view_profle_screen.dart @@ -84,7 +84,8 @@ class ViewProfileScreen extends StatelessWidget { title: AppLocalizations.of(context).employee_gender_tag, subtitle: employee.gender == null ? null - : localization.user_details_gender(employee.gender!.value)), + : localization + .user_details_gender(employee.gender!.value)), EmployeeDetailsField( title: AppLocalizations.of(context).employee_address_tag, subtitle: employee.address), diff --git a/lib/ui/shared/who_is_out_card/bloc/who_is_out_card_event.dart b/lib/ui/shared/who_is_out_card/bloc/who_is_out_card_event.dart index 505b8493f..0d0620816 100644 --- a/lib/ui/shared/who_is_out_card/bloc/who_is_out_card_event.dart +++ b/lib/ui/shared/who_is_out_card/bloc/who_is_out_card_event.dart @@ -17,7 +17,7 @@ class FetchWhoIsOutCardLeaves extends WhoIsOutEvent { class ShowCalendarData extends WhoIsOutEvent { final List allAbsence; - ShowCalendarData( this.allAbsence); + ShowCalendarData(this.allAbsence); @override List get props => [allAbsence]; diff --git a/lib/ui/shared/who_is_out_card/widget/absence_employee_view.dart b/lib/ui/shared/who_is_out_card/widget/absence_employee_view.dart index 7385a65d3..2293af9bb 100644 --- a/lib/ui/shared/who_is_out_card/widget/absence_employee_view.dart +++ b/lib/ui/shared/who_is_out_card/widget/absence_employee_view.dart @@ -44,8 +44,7 @@ class AbsenceEmployeesListWhoIsOutCardView extends StatelessWidget { class AbsenceEmployeeWrapLayout extends StatelessWidget { final List absence; - const AbsenceEmployeeWrapLayout( - {Key? key, required this.absence}) + const AbsenceEmployeeWrapLayout({Key? key, required this.absence}) : super(key: key); @override @@ -67,10 +66,11 @@ class AbsenceEmployeeWrapLayout extends StatelessWidget { userStateNotifier.isAdmin || userStateNotifier.isHR ? context.pushNamed(Routes.adminAbsenceDetails, extra: absence) - : context - .pushNamed(Routes.userAbsenceDetails, params: { - RoutesParamsConst.leaveId: absence.leave.leaveId - }); + : context.pushNamed(Routes.userAbsenceDetails, + pathParameters: { + RoutesParamsConst.leaveId: + absence.leave.leaveId + }); }, child: Padding( padding: const EdgeInsets.all(8.0), diff --git a/lib/ui/sign_in/sign_in_screen.dart b/lib/ui/sign_in/sign_in_screen.dart index ed9cd37a1..d40751614 100644 --- a/lib/ui/sign_in/sign_in_screen.dart +++ b/lib/ui/sign_in/sign_in_screen.dart @@ -56,7 +56,8 @@ class SignInScreenState extends State { children: [ const SizedBox(height: 20), Flexible( - child: Image.asset(ImageConst.loginPageVectorImage, width: MediaQuery.of(context).size.width * 0.8), + child: Image.asset(ImageConst.loginPageVectorImage, + width: MediaQuery.of(context).size.width * 0.8), ), Column( mainAxisSize: MainAxisSize.min, @@ -73,10 +74,13 @@ class SignInScreenState extends State { ), Flexible( child: Padding( - padding: const EdgeInsets.only(left: 20.0, right: 20, top: 20, bottom: 40), + padding: const EdgeInsets.only( + left: 20.0, right: 20, top: 20, bottom: 40), child: Text( - AppLocalizations.of(context).sign_in_description_text, - style: AppFontStyle.bodyMedium.copyWith(fontWeight: FontWeight.w500), + AppLocalizations.of(context) + .sign_in_description_text, + style: AppFontStyle.bodyMedium + .copyWith(fontWeight: FontWeight.w500), overflow: TextOverflow.fade, textAlign: TextAlign.center, ), @@ -96,9 +100,12 @@ class SignInScreenState extends State { : Center( child: SignInButton( onPressed: () { - context.read().add(SignInEvent()); + context + .read() + .add(SignInEvent()); }, - title: AppLocalizations.of(context).login_button_text, + title: AppLocalizations.of(context) + .login_button_text, image: ImageConst.googleLogoImage), ), ), diff --git a/lib/ui/space/create_space/bloc/create_workspace_bloc.dart b/lib/ui/space/create_space/bloc/create_workspace_bloc.dart index 9485add9e..47509cdc6 100644 --- a/lib/ui/space/create_space/bloc/create_workspace_bloc.dart +++ b/lib/ui/space/create_space/bloc/create_workspace_bloc.dart @@ -115,7 +115,7 @@ class CreateSpaceBLoc extends Bloc PickImageEvent event, Emitter emit) async { final XFile? image = await imagePicker.pickImage(source: event.imageSource); if (image != null) { - emit(state.copyWith(logo: image.path,isLogoPickedDone: true)); + emit(state.copyWith(logo: image.path, isLogoPickedDone: true)); } } @@ -141,7 +141,8 @@ class CreateSpaceBLoc extends Bloc int timeOff = int.parse(state.paidTimeOff); if (state.logo != null) { - final String storagePath = ImageStoragePath.spaceLogoPath(spaceId: newSpaceId); + final String storagePath = + ImageStoragePath.spaceLogoPath(spaceId: newSpaceId); logoURL = await storageService.uploadProfilePic( path: storagePath, imagePath: state.logo!); } diff --git a/lib/ui/space/create_space/bloc/create_workspace_state.dart b/lib/ui/space/create_space/bloc/create_workspace_state.dart index a2b96925b..9f4753e8c 100644 --- a/lib/ui/space/create_space/bloc/create_workspace_state.dart +++ b/lib/ui/space/create_space/bloc/create_workspace_state.dart @@ -19,8 +19,8 @@ class CreateSpaceState extends Equatable { final String? ownerName; final bool ownerNameError; - const CreateSpaceState({ - this.isLogoPickedDone = false, + const CreateSpaceState( + {this.isLogoPickedDone = false, this.logo, this.page = 0, this.companyName = '', @@ -69,19 +69,19 @@ class CreateSpaceState extends Equatable { @override List get props => [ - logo, - isLogoPickedDone, - page, - companyName, - domain, - companyNameError, - domainError, - paidTimeOff, - paidTimeOffError, - buttonState, - ownerNameError, - error, - createSpaceStatus, - ownerName, - ]; + logo, + isLogoPickedDone, + page, + companyName, + domain, + companyNameError, + domainError, + paidTimeOff, + paidTimeOffError, + buttonState, + ownerNameError, + error, + createSpaceStatus, + ownerName, + ]; } diff --git a/lib/ui/space/create_space/widget/tab_1.dart b/lib/ui/space/create_space/widget/tab_1.dart index 95d0d08da..0d58dc3b0 100644 --- a/lib/ui/space/create_space/widget/tab_1.dart +++ b/lib/ui/space/create_space/widget/tab_1.dart @@ -45,7 +45,7 @@ class _SpaceBasicDetailsState extends State BlocConsumer( listenWhen: (previous, current) => current.isLogoPickedDone, listener: (context, state) { - if(state.isLogoPickedDone){ + if (state.isLogoPickedDone) { context.pop(); } }, diff --git a/lib/ui/space/create_space/widget/tab_2.dart b/lib/ui/space/create_space/widget/tab_2.dart index f8ed4131a..0dd2ba8d9 100644 --- a/lib/ui/space/create_space/widget/tab_2.dart +++ b/lib/ui/space/create_space/widget/tab_2.dart @@ -39,12 +39,12 @@ class _SetUpSpaceDetailsState extends State height: 30, ), BlocBuilder( - buildWhen: (previous,current)=>previous.paidTimeOff!= current.paidTimeOff, - + buildWhen: (previous, current) => + previous.paidTimeOff != current.paidTimeOff, builder: (context, state) { return FieldEntry( hintText: - AppLocalizations.of(context).yearly_paid_time_off_tag, + AppLocalizations.of(context).yearly_paid_time_off_tag, keyboardType: TextInputType.number, maxLength: 2, inputFormatters: [ diff --git a/lib/ui/space/join_space/join_space_screen.dart b/lib/ui/space/join_space/join_space_screen.dart index cc3dfcf8b..e8aaa5946 100644 --- a/lib/ui/space/join_space/join_space_screen.dart +++ b/lib/ui/space/join_space/join_space_screen.dart @@ -95,7 +95,9 @@ class _JoinSpaceScreenState extends State { style: AppFontStyle.bodyLarge), const SizedBox(height: 10), BlocBuilder( - buildWhen: (previous, current) => current.fetchSpaceStatus == Status.success || current.fetchSpaceStatus == Status.error, + buildWhen: (previous, current) => + current.fetchSpaceStatus == Status.success || + current.fetchSpaceStatus == Status.error, builder: (context, state) { if (state.fetchSpaceStatus == Status.loading || state.fetchSpaceStatus == Status.initial) { diff --git a/lib/ui/user/home/home_screen/bloc/user_home_event.dart b/lib/ui/user/home/home_screen/bloc/user_home_event.dart index 581539cad..08e725240 100644 --- a/lib/ui/user/home/home_screen/bloc/user_home_event.dart +++ b/lib/ui/user/home/home_screen/bloc/user_home_event.dart @@ -2,7 +2,6 @@ import 'package:equatable/equatable.dart'; abstract class UserHomeEvent extends Equatable {} - class UserHomeFetchLeaveRequest extends UserHomeEvent { UserHomeFetchLeaveRequest(); diff --git a/lib/ui/user/home/home_screen/user_home_screen.dart b/lib/ui/user/home/home_screen/user_home_screen.dart index 873b1f854..c53f4a9c6 100644 --- a/lib/ui/user/home/home_screen/user_home_screen.dart +++ b/lib/ui/user/home/home_screen/user_home_screen.dart @@ -64,21 +64,18 @@ class _UserHomeScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: - const EdgeInsets.only(top: 25, bottom: 10), + padding: const EdgeInsets.only(top: 25, bottom: 10), child: Text(locale.request_tag, - style: Theme.of(context) - .textTheme - .headlineSmall), + style: + Theme.of(context).textTheme.headlineSmall), ), ListView.separated( physics: const NeverScrollableScrollPhysics(), shrinkWrap: true, itemBuilder: (context, leave) => LeaveCard( onTap: () { - context.goNamed( - Routes.userRequestDetail, - params: { + context.goNamed(Routes.userRequestDetail, + pathParameters: { RoutesParamsConst.leaveId: state.requests[leave].leaveId }); diff --git a/lib/ui/user/leaves/apply_leave/bloc/apply_leave_event.dart b/lib/ui/user/leaves/apply_leave/bloc/apply_leave_event.dart index 50aff7f82..448863572 100644 --- a/lib/ui/user/leaves/apply_leave/bloc/apply_leave_event.dart +++ b/lib/ui/user/leaves/apply_leave/bloc/apply_leave_event.dart @@ -3,46 +3,43 @@ import 'package:projectunity/data/model/leave/leave.dart'; abstract class ApplyLeaveEvent extends Equatable {} - -class ApplyLeaveStartDateChangeEvents extends ApplyLeaveEvent{ +class ApplyLeaveStartDateChangeEvents extends ApplyLeaveEvent { final DateTime? startDate; ApplyLeaveStartDateChangeEvents({required this.startDate}); @override List get props => [startDate]; } -class ApplyLeaveChangeLeaveTypeEvent extends ApplyLeaveEvent{ +class ApplyLeaveChangeLeaveTypeEvent extends ApplyLeaveEvent { final LeaveType? leaveType; ApplyLeaveChangeLeaveTypeEvent({required this.leaveType}); @override List get props => [leaveType]; } -class ApplyLeaveEndDateChangeEvent extends ApplyLeaveEvent{ +class ApplyLeaveEndDateChangeEvent extends ApplyLeaveEvent { final DateTime? endDate; ApplyLeaveEndDateChangeEvent({required this.endDate}); @override List get props => [endDate]; } -class ApplyLeaveReasonChangeEvent extends ApplyLeaveEvent{ +class ApplyLeaveReasonChangeEvent extends ApplyLeaveEvent { final String reason; ApplyLeaveReasonChangeEvent({required this.reason}); @override List get props => [reason]; } -class ApplyLeaveUpdateLeaveOfTheDayEvent extends ApplyLeaveEvent{ +class ApplyLeaveUpdateLeaveOfTheDayEvent extends ApplyLeaveEvent { final DateTime date; final LeaveDayDuration value; - ApplyLeaveUpdateLeaveOfTheDayEvent({required this.date,required this.value}); + ApplyLeaveUpdateLeaveOfTheDayEvent({required this.date, required this.value}); @override - List get props => [date,value]; + List get props => [date, value]; } -class ApplyLeaveSubmitFormEvent extends ApplyLeaveEvent{ +class ApplyLeaveSubmitFormEvent extends ApplyLeaveEvent { @override List get props => []; } - - diff --git a/lib/ui/user/leaves/apply_leave/widget/date_range_selection_leave_request.dart b/lib/ui/user/leaves/apply_leave/widget/date_range_selection_leave_request.dart index 6bc9b1c7e..cfc755707 100644 --- a/lib/ui/user/leaves/apply_leave/widget/date_range_selection_leave_request.dart +++ b/lib/ui/user/leaves/apply_leave/widget/date_range_selection_leave_request.dart @@ -113,8 +113,7 @@ class LeaveTimePeriodBox extends StatelessWidget { width: MediaQuery.of(context).size.width * 0.26, decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), - border: Border.all( - color: AppColors.darkGrey), + border: Border.all(color: AppColors.darkGrey), ), child: Material( color: AppColors.whiteColor, @@ -128,18 +127,19 @@ class LeaveTimePeriodBox extends StatelessWidget { borderRadius: BorderRadius.circular(12), alignment: Alignment.center, value: dayTimePeriod.value, - items: LeaveDayDuration.values.map((dayDuration) => DropdownMenuItem( + items: LeaveDayDuration.values + .map((dayDuration) => DropdownMenuItem( value: dayDuration, child: Center( child: Text(AppLocalizations.of(context) .leave_day_duration_tag(dayDuration.name))))) .toList(), onChanged: (value) { - context.read().add( - ApplyLeaveUpdateLeaveOfTheDayEvent( - date: dayTimePeriod.key, - value: value ?? dayTimePeriod.value)); - }, + context.read().add( + ApplyLeaveUpdateLeaveOfTheDayEvent( + date: dayTimePeriod.key, + value: value ?? dayTimePeriod.value)); + }, ), ), ), diff --git a/lib/ui/user/leaves/apply_leave/widget/leave_type_card.dart b/lib/ui/user/leaves/apply_leave/widget/leave_type_card.dart index 3508a304c..06f25c52d 100644 --- a/lib/ui/user/leaves/apply_leave/widget/leave_type_card.dart +++ b/lib/ui/user/leaves/apply_leave/widget/leave_type_card.dart @@ -49,24 +49,23 @@ class LeaveTypeCard extends StatelessWidget { isExpanded: true, icon: const Icon(Icons.arrow_drop_down), borderRadius: BorderRadius.circular(12), - items: LeaveType.values - .map((leaveType) { - return DropdownMenuItem( - value: leaveType, - child: Row( - children: [ - const SizedBox( - width: primaryHalfSpacing, - ), - Flexible( - child: Text(localization - .leave_type_placeholder_text( - leaveType.value.toString())), - ), - ], - ), - ); - }).toList(), + items: LeaveType.values.map((leaveType) { + return DropdownMenuItem( + value: leaveType, + child: Row( + children: [ + const SizedBox( + width: primaryHalfSpacing, + ), + Flexible( + child: Text( + localization.leave_type_placeholder_text( + leaveType.value.toString())), + ), + ], + ), + ); + }).toList(), value: state.leaveType, onChanged: (LeaveType? leaveType) { context.read().add( diff --git a/lib/ui/user/leaves/detail/bloc/user_leave_detail_bloc.dart b/lib/ui/user/leaves/detail/bloc/user_leave_detail_bloc.dart index 3c5b0fe1b..149f58a84 100644 --- a/lib/ui/user/leaves/detail/bloc/user_leave_detail_bloc.dart +++ b/lib/ui/user/leaves/detail/bloc/user_leave_detail_bloc.dart @@ -12,8 +12,7 @@ class UserLeaveDetailBloc extends Bloc { final LeaveRepo _leaveRepo; - UserLeaveDetailBloc(this._leaveRepo) - : super(UserLeaveDetailInitialState()) { + UserLeaveDetailBloc(this._leaveRepo) : super(UserLeaveDetailInitialState()) { on(_fetchLeaveDetail); on(_cancelLeaveApplication); } @@ -41,7 +40,8 @@ class UserLeaveDetailBloc Emitter emit) async { emit(UserLeaveDetailLoadingState()); try { - await _leaveRepo.updateLeaveStatus(leaveId: event.leaveId,status: LeaveStatus.cancelled); + await _leaveRepo.updateLeaveStatus( + leaveId: event.leaveId, status: LeaveStatus.cancelled); emit(UserCancelLeaveSuccessState()); } on Exception { emit(UserLeaveDetailErrorState(error: firestoreFetchDataError)); diff --git a/lib/ui/user/leaves/detail/widget/cancel_button.dart b/lib/ui/user/leaves/detail/widget/cancel_button.dart index bddf9572c..dfadef78c 100644 --- a/lib/ui/user/leaves/detail/widget/cancel_button.dart +++ b/lib/ui/user/leaves/detail/widget/cancel_button.dart @@ -19,8 +19,7 @@ class CancelButton extends StatelessWidget { BlocProvider.of(context) .add(CancelLeaveApplicationEvent(leaveId: leaveId)); }, - child: Text(AppLocalizations.of(context) - .cancel_button_tag)), + child: Text(AppLocalizations.of(context).cancel_button_tag)), ); } } diff --git a/lib/ui/user/leaves/detail/widget/response_note.dart b/lib/ui/user/leaves/detail/widget/response_note.dart index ad4314e74..89274a240 100644 --- a/lib/ui/user/leaves/detail/widget/response_note.dart +++ b/lib/ui/user/leaves/detail/widget/response_note.dart @@ -36,7 +36,6 @@ class ResponseNote extends StatelessWidget { ), ), ], - ) - ); + )); } } diff --git a/lib/ui/user/leaves/detail/widget/user_leave_date_content.dart b/lib/ui/user/leaves/detail/widget/user_leave_date_content.dart index 5bfe71a3d..3db99a7be 100644 --- a/lib/ui/user/leaves/detail/widget/user_leave_date_content.dart +++ b/lib/ui/user/leaves/detail/widget/user_leave_date_content.dart @@ -18,8 +18,8 @@ class UserLeaveRequestDateContent extends StatelessWidget { Widget build(BuildContext context) { String totalDays = DateFormatter(AppLocalizations.of(context)) .getLeaveDurationPresentationLong(leave.total); - String duration = DateFormatter(AppLocalizations.of(context)).dateInLine( - startDate: leave.startDate, endDate: leave.endDate); + String duration = DateFormatter(AppLocalizations.of(context)) + .dateInLine(startDate: leave.startDate, endDate: leave.endDate); return Container( padding: const EdgeInsets.all(primaryHorizontalSpacing), diff --git a/lib/ui/user/leaves/leaves_screen/widget/leave_count_card.dart b/lib/ui/user/leaves/leaves_screen/widget/leave_count_card.dart index c601cb5ca..60d9fcbc9 100644 --- a/lib/ui/user/leaves/leaves_screen/widget/leave_count_card.dart +++ b/lib/ui/user/leaves/leaves_screen/widget/leave_count_card.dart @@ -52,7 +52,9 @@ class LeaveCountCard extends StatelessWidget { width: 1, color: AppColors.lightGreyColor, ), - Expanded(child: UsedLeaveCountsView(leaveCounts: state.usedLeavesCounts)), + Expanded( + child: UsedLeaveCountsView( + leaveCounts: state.usedLeavesCounts)), ], ); }), diff --git a/lib/ui/user/leaves/leaves_screen/widget/leave_list.dart b/lib/ui/user/leaves/leaves_screen/widget/leave_list.dart index cc395e7fa..f558d7b69 100644 --- a/lib/ui/user/leaves/leaves_screen/widget/leave_list.dart +++ b/lib/ui/user/leaves/leaves_screen/widget/leave_list.dart @@ -19,11 +19,10 @@ class LeaveList extends StatelessWidget { @override Widget build(BuildContext context) { - Future navigateToLeaveDetails(Leave leave) async { final bloc = context.read(); final String? leaveId = await context.pushNamed(Routes.userLeaveDetail, - params: {RoutesParamsConst.leaveId: leave.leaveId}); + pathParameters: {RoutesParamsConst.leaveId: leave.leaveId}); if (leaveId != null) { bloc.add(UpdateLeave(leaveId: leaveId)); } diff --git a/lib/ui/user/members/detail/user_employee_detail_screen.dart b/lib/ui/user/members/detail/user_employee_detail_screen.dart index 877fdb726..273ca1fad 100644 --- a/lib/ui/user/members/detail/user_employee_detail_screen.dart +++ b/lib/ui/user/members/detail/user_employee_detail_screen.dart @@ -54,7 +54,8 @@ class _UserEmployeeDetailScreenState extends State { title: Text(AppLocalizations.of(context).details_tag), ), body: ListView( - padding: const EdgeInsets.symmetric(vertical: primaryHorizontalSpacing), + padding: + const EdgeInsets.symmetric(vertical: primaryHorizontalSpacing), children: [ ProfileCard(employee: widget.employee), const Divider( diff --git a/lib/ui/user/members/detail/widget/tab_content.dart b/lib/ui/user/members/detail/widget/tab_content.dart index 93dd59cb8..e31df903c 100644 --- a/lib/ui/user/members/detail/widget/tab_content.dart +++ b/lib/ui/user/members/detail/widget/tab_content.dart @@ -55,9 +55,10 @@ class TabContent extends StatelessWidget { Leave leave = state.upcomingLeaves[index]; return LeaveCard( onTap: () { - context.goNamed(Routes.userLeaveDetail, params: { - RoutesParamsConst.leaveId: leave.leaveId - }); + context.goNamed(Routes.userLeaveDetail, + pathParameters: { + RoutesParamsConst.leaveId: leave.leaveId + }); }, leave: leave, ); diff --git a/lib/ui/user/members/members_screen/user_members_screen.dart b/lib/ui/user/members/members_screen/user_members_screen.dart index 87ae48bca..851b4e774 100644 --- a/lib/ui/user/members/members_screen/user_members_screen.dart +++ b/lib/ui/user/members/members_screen/user_members_screen.dart @@ -62,7 +62,7 @@ class _UserMembersScreenState extends State { onTap: () { context.goNamed(Routes.userEmployeeDetail, extra: employee, - params: { + pathParameters: { RoutesParamsConst.employeeId: employee.uid }); }, diff --git a/lib/ui/widget/circular_progress_indicator.dart b/lib/ui/widget/circular_progress_indicator.dart index e6d17f7ca..5cea2e698 100644 --- a/lib/ui/widget/circular_progress_indicator.dart +++ b/lib/ui/widget/circular_progress_indicator.dart @@ -77,7 +77,8 @@ class AppCircularProgressIndicator extends StatelessWidget { final Color color; final double size; - const AppCircularProgressIndicator({Key? key, this.size = 38, this.color = AppColors.primaryBlue}) + const AppCircularProgressIndicator( + {Key? key, this.size = 38, this.color = AppColors.primaryBlue}) : super(key: key); @override diff --git a/lib/ui/widget/date_time_picker.dart b/lib/ui/widget/date_time_picker.dart index 9bb156e8a..6f544ddc6 100644 --- a/lib/ui/widget/date_time_picker.dart +++ b/lib/ui/widget/date_time_picker.dart @@ -2,8 +2,7 @@ import 'package:flutter/material.dart'; import 'package:projectunity/data/core/extensions/date_time.dart'; Future pickDate( - {required BuildContext context, - required DateTime initialDate}) async { + {required BuildContext context, required DateTime initialDate}) async { DateTime? pickDate = await showDatePicker( context: context, initialDate: initialDate, diff --git a/lib/ui/widget/error/page_not_found_screen.dart b/lib/ui/widget/error/page_not_found_screen.dart index debd12717..9eec9bc1e 100644 --- a/lib/ui/widget/error/page_not_found_screen.dart +++ b/lib/ui/widget/error/page_not_found_screen.dart @@ -28,17 +28,16 @@ class _PageNotFoundScreenState extends State { mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text(locale.page_not_found_error_code, + Text(locale.page_not_found_error_code, style: const TextStyle( color: AppColors.primaryBlue, fontSize: 50, fontWeight: FontWeight.bold)), const SizedBox(height: 10), - Text(locale.page_not_found_error_title, + Text(locale.page_not_found_error_title, style: AppFontStyle.titleDark), const SizedBox(height: 10), - Text( - locale.page_not_found_error_message, + Text(locale.page_not_found_error_message, style: AppFontStyle.subTitleGrey, textAlign: TextAlign.center), ], diff --git a/lib/ui/widget/leave_application_card.dart b/lib/ui/widget/leave_application_card.dart index beacdec39..fe6bf28ea 100644 --- a/lib/ui/widget/leave_application_card.dart +++ b/lib/ui/widget/leave_application_card.dart @@ -51,7 +51,8 @@ class LeaveApplicationCard extends StatelessWidget { height: 10, ), _LeaveDateContent( - firstDayDuration: leaveApplication.leave.perDayDuration.first, + firstDayDuration: + leaveApplication.leave.perDayDuration.first, totalDays: leaveApplication.leave.total, startDate: leaveApplication.leave.startDate, endDate: leaveApplication.leave.endDate, @@ -78,8 +79,6 @@ class LeaveApplicationCard extends StatelessWidget { } } - - class _LeaveDateContent extends StatelessWidget { final double totalDays; final LeaveDayDuration firstDayDuration; @@ -90,7 +89,8 @@ class _LeaveDateContent extends StatelessWidget { {Key? key, required this.totalDays, required this.startDate, - required this.endDate, required this.firstDayDuration}) + required this.endDate, + required this.firstDayDuration}) : super(key: key); @override @@ -98,7 +98,8 @@ class _LeaveDateContent extends StatelessWidget { String duration = DateFormatter(AppLocalizations.of(context)) .dateInLine(startDate: startDate, endDate: endDate); String days = DateFormatter(AppLocalizations.of(context)) - .getLeaveDurationPresentation(totalLeaves: totalDays,firstDayDuration: firstDayDuration); + .getLeaveDurationPresentation( + totalLeaves: totalDays, firstDayDuration: firstDayDuration); return Text( '$days, $duration ', diff --git a/lib/ui/widget/leave_card.dart b/lib/ui/widget/leave_card.dart index e3ef5aa54..3edfde700 100644 --- a/lib/ui/widget/leave_card.dart +++ b/lib/ui/widget/leave_card.dart @@ -66,7 +66,9 @@ class LeaveCard extends StatelessWidget { const SizedBox(height: 8), Text( DateFormatter(AppLocalizations.of(context)) - .getLeaveDurationPresentation(totalLeaves: leave.total,firstDayDuration: leave.perDayDuration.first) + .getLeaveDurationPresentation( + totalLeaves: leave.total, + firstDayDuration: leave.perDayDuration.first) .toString(), style: AppFontStyle.bodySmallRegular, ), diff --git a/lib/ui/widget/pick_image_bottom_sheet.dart b/lib/ui/widget/pick_image_bottom_sheet.dart index c3d1efd9e..dcccc58ba 100644 --- a/lib/ui/widget/pick_image_bottom_sheet.dart +++ b/lib/ui/widget/pick_image_bottom_sheet.dart @@ -16,7 +16,7 @@ class PickImageBottomSheet extends StatelessWidget { Widget build(BuildContext context) { final locale = AppLocalizations.of(context); return Container( - decoration: BoxDecoration( + decoration: BoxDecoration( boxShadow: AppTheme.commonBoxShadow, color: AppColors.whiteColor, borderRadius: const BorderRadius.only( diff --git a/lib/ui/widget/pick_profile_image/bloc/pick_image_bloc.dart b/lib/ui/widget/pick_profile_image/bloc/pick_image_bloc.dart index 2d4c7e451..533c2b8c3 100644 --- a/lib/ui/widget/pick_profile_image/bloc/pick_image_bloc.dart +++ b/lib/ui/widget/pick_profile_image/bloc/pick_image_bloc.dart @@ -7,7 +7,6 @@ import 'package:projectunity/ui/widget/pick_profile_image/bloc/pick_image_state. @Injectable() class PickImageBloc extends Bloc { - final ImagePicker _imagePicker; PickImageBloc(this._imagePicker) : super(const PickImageState()) { @@ -16,7 +15,8 @@ class PickImageBloc extends Bloc { Future _pickImage( PickImageEvent event, Emitter emit) async { - final XFile? image = await _imagePicker.pickImage(source: event.imageSource); + final XFile? image = + await _imagePicker.pickImage(source: event.imageSource); if (image != null) { final file = File(image.path); emit(state.copyWith(pickedImage: file.path, isPickImageDone: true)); diff --git a/lib/ui/widget/pick_profile_image/bloc/pick_image_state.dart b/lib/ui/widget/pick_profile_image/bloc/pick_image_state.dart index 6049c9760..d0569193b 100644 --- a/lib/ui/widget/pick_profile_image/bloc/pick_image_state.dart +++ b/lib/ui/widget/pick_profile_image/bloc/pick_image_state.dart @@ -17,5 +17,4 @@ class PickImageState extends Equatable { @override List get props => [pickedImage, isPickImageDone]; - -} \ No newline at end of file +} diff --git a/lib/ui/widget/pick_profile_image/pick_user_profile_image.dart b/lib/ui/widget/pick_profile_image/pick_user_profile_image.dart index 2c35980ce..43a3abb92 100644 --- a/lib/ui/widget/pick_profile_image/pick_user_profile_image.dart +++ b/lib/ui/widget/pick_profile_image/pick_user_profile_image.dart @@ -11,23 +11,22 @@ import '../user_profile_image.dart'; import 'bloc/pick_image_bloc.dart'; import 'bloc/pick_image_event.dart'; - class ProfileImagePicker extends StatelessWidget { final String? imageURl; final void Function(String image) onPickImageChange; - const ProfileImagePicker({super.key, this.imageURl, required this.onPickImageChange}); + const ProfileImagePicker( + {super.key, this.imageURl, required this.onPickImageChange}); @override Widget build(BuildContext context) { return BlocProvider( create: (context) => getIt(), - child: ProfileImage(imageURl: imageURl, onPickImageChange: onPickImageChange), + child: ProfileImage( + imageURl: imageURl, onPickImageChange: onPickImageChange), ); } } - - class ProfileImage extends StatelessWidget { final String? imageURl; final void Function(String image) onPickImageChange; diff --git a/lib/ui/widget/space_card.dart b/lib/ui/widget/space_card.dart index 7ad38c37c..d26a6b215 100644 --- a/lib/ui/widget/space_card.dart +++ b/lib/ui/widget/space_card.dart @@ -56,7 +56,7 @@ class SpaceCard extends StatelessWidget { isValid: domain.isNotNullOrEmpty, child: Text(domain ?? "", style: AppFontStyle.subTitleGrey, - overflow: TextOverflow.ellipsis)), + overflow: TextOverflow.ellipsis)), ], ), ), diff --git a/lib/ui/widget/user_profile_image.dart b/lib/ui/widget/user_profile_image.dart index 70e832425..fba84a591 100644 --- a/lib/ui/widget/user_profile_image.dart +++ b/lib/ui/widget/user_profile_image.dart @@ -36,12 +36,12 @@ class ImageProfile extends StatelessWidget { @override Widget build(BuildContext context) { return CircleAvatar( - radius: radius, - backgroundColor: backgroundColor, - backgroundImage: setImage(), - child: (setImage() != null) - ? null - : Icon(Icons.person, size: radius, color: iconColor), - ); + radius: radius, + backgroundColor: backgroundColor, + backgroundImage: setImage(), + child: (setImage() != null) + ? null + : Icon(Icons.person, size: radius, color: iconColor), + ); } } diff --git a/pubspec.lock b/pubspec.lock index 2f7421509..5b8166b37 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,50 +5,50 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "405666cd3cf0ee0a48d21ec67e65406aad2c726d9fa58840d3375e7bdcd32a07" + sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 url: "https://pub.dev" source: hosted - version: "60.0.0" + version: "64.0.0" _flutterfire_internals: dependency: transitive description: name: _flutterfire_internals - sha256: "8eb354cb8ebed8a9fdf63699d15deff533bc133128898afaf754926b57d611b6" + sha256: f5628cd9c92ed11083f425fd1f8f1bc60ecdda458c81d73b143aeda036c35fe7 url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.16" analyzer: dependency: transitive description: name: analyzer - sha256: "1952250bd005bacb895a01bf1b4dc00e3ba1c526cf47dca54dfe24979c65f5b3" + sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" url: "https://pub.dev" source: hosted - version: "5.12.0" + version: "6.2.0" args: dependency: transitive description: name: args - sha256: c372bb384f273f0c2a8aaaa226dad84dc27c8519a691b888725dec59518ad53a + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" async: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" bloc: dependency: transitive description: name: bloc - sha256: "658a5ae59edcf1e58aac98b000a71c762ad8f46f1394c34a52050cafb3e11a80" + sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" url: "https://pub.dev" source: hosted - version: "8.1.1" + version: "8.1.2" boolean_selector: dependency: transitive description: @@ -61,10 +61,10 @@ packages: dependency: transitive description: name: build - sha256: "3fbda25365741f8251b39f3917fb3c8e286a96fd068a5a242e11c2012d495777" + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.4.1" build_config: dependency: transitive description: @@ -77,34 +77,34 @@ packages: dependency: transitive description: name: build_daemon - sha256: "757153e5d9cd88253cb13f28c2fb55a537dc31fefd98137549895b5beb7c6169" + sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "4.0.1" build_resolvers: dependency: transitive description: name: build_resolvers - sha256: db49b8609ef8c81cca2b310618c3017c00f03a92af44c04d310b907b2d692d95 + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.2" build_runner: dependency: "direct dev" description: name: build_runner - sha256: b0a8a7b8a76c493e85f1b84bffa0588859a06197863dba8c9036b15581fd9727 + sha256: "581bacf68f89ec8792f5e5a0b2c4decd1c948e97ce659dc783688c8a88fbec21" url: "https://pub.dev" source: hosted - version: "2.3.3" + version: "2.4.8" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: "14febe0f5bac5ae474117a36099b4de6f1dbc52df6c5e55534b3da9591bf4292" + sha256: c9e32d21dd6626b5c163d48b037ce906bbe428bc23ab77bcd77bb21e593b6185 url: "https://pub.dev" source: hosted - version: "7.2.7" + version: "7.2.11" built_collection: dependency: transitive description: @@ -117,42 +117,42 @@ packages: dependency: transitive description: name: built_value - sha256: "2f17434bd5d52a26762043d6b43bb53b3acd029b4d9071a329f46d67ef297e6d" + sha256: c9aabae0718ec394e5bc3c7272e6bb0dc0b32201a08fe185ec1d8401d3e39309 url: "https://pub.dev" source: hosted - version: "8.5.0" + version: "8.8.1" cached_network_image: dependency: "direct main" description: name: cached_network_image - sha256: fd3d0dc1d451f9a252b32d95d3f0c3c487bc41a75eba2e6097cb0b9c71491b15 + sha256: "28ea9690a8207179c319965c13cd8df184d5ee721ae2ce60f398ced1219cea1f" url: "https://pub.dev" source: hosted - version: "3.2.3" + version: "3.3.1" cached_network_image_platform_interface: dependency: transitive description: name: cached_network_image_platform_interface - sha256: bb2b8403b4ccdc60ef5f25c70dead1f3d32d24b9d6117cfc087f496b178594a7 + sha256: "9e90e78ae72caa874a323d78fa6301b3fb8fa7ea76a8f96dc5b5bf79f283bf2f" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "4.0.0" cached_network_image_web: dependency: transitive description: name: cached_network_image_web - sha256: b8eb814ebfcb4dea049680f8c1ffb2df399e4d03bf7a352c775e26fa06e02fa0 + sha256: "42a835caa27c220d1294311ac409a43361088625a4f23c820b006dd9bffb3316" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.1.1" characters: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" checked_yaml: dependency: transitive description: @@ -173,42 +173,42 @@ packages: dependency: "direct main" description: name: cloud_firestore - sha256: d597313deea7c06132c3e5d608b6c96b2804f39566f9074fd662753e64659895 + sha256: "8bfbb5a2edbc6052452326d60de0113fea2bcbf081d34a3f8e45c8b38307b31c" url: "https://pub.dev" source: hosted - version: "4.7.1" + version: "4.14.0" cloud_firestore_platform_interface: dependency: transitive description: name: cloud_firestore_platform_interface - sha256: f6900ac874e326eede700483cc33e034f64bfb98b0cbcdc6c1a5133146de52f9 + sha256: "73ff438fe46028f0e19f55da18b6ddc6906ab750562cd7d9ffab77ff8c0c4307" url: "https://pub.dev" source: hosted - version: "5.14.1" + version: "6.1.0" cloud_firestore_web: dependency: transitive description: name: cloud_firestore_web - sha256: "2f7d865102ff5209d279652d2954e161a1e74d410abe95ed2931818277df4677" + sha256: "232e45e95970d3a6baab8f50f9c3a6e2838d145d9d91ec9a7392837c44296397" url: "https://pub.dev" source: hosted - version: "3.5.1" + version: "3.9.0" code_builder: dependency: transitive description: name: code_builder - sha256: "0d43dd1288fd145de1ecc9a3948ad4a6d5a82f0a14c4fdd0892260787d975cbe" + sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37 url: "https://pub.dev" source: hosted - version: "4.4.0" + version: "4.10.0" collection: dependency: "direct main" description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.18.0" connectivity_plus: dependency: "direct main" description: @@ -237,10 +237,10 @@ packages: dependency: transitive description: name: cross_file - sha256: "0b0036e8cccbfbe0555fd83c1d31a6f30b77a96b598b35a5d36dd41f718695e9" + sha256: fedaadfa3a6996f75211d835aaeb8fede285dae94262485698afd832371b9a5e url: "https://pub.dev" source: hosted - version: "0.3.3+4" + version: "0.3.3+8" crypto: dependency: transitive description: @@ -253,18 +253,18 @@ packages: dependency: transitive description: name: dart_style - sha256: f4f1f73ab3fd2afcbcca165ee601fe980d966af6a21b5970c6c9376955c528ad + sha256: "40ae61a5d43feea6d24bd22c0537a6629db858963b99b4bc1c3db80676f32368" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.4" dbus: dependency: transitive description: name: dbus - sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263" + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" url: "https://pub.dev" source: hosted - version: "0.7.8" + version: "0.7.10" device_info_plus: dependency: "direct main" description: @@ -301,10 +301,10 @@ packages: dependency: transitive description: name: ffi - sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.0" file: dependency: transitive description: @@ -313,94 +313,126 @@ packages: url: "https://pub.dev" source: hosted version: "6.1.4" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "045d372bf19b02aeb69cacf8b4009555fb5f6f0b7ad8016e5f46dd1387ddd492" + url: "https://pub.dev" + source: hosted + version: "0.9.2+1" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: b15c3da8bd4908b9918111fa486903f5808e388b8d1c559949f584725a6594d6 + url: "https://pub.dev" + source: hosted + version: "0.9.3+3" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b + url: "https://pub.dev" + source: hosted + version: "2.6.2" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: d3547240c20cabf205c7c7f01a50ecdbc413755814d6677f3cb366f04abcead0 + url: "https://pub.dev" + source: hosted + version: "0.9.3+1" firebase_auth: dependency: "direct main" description: name: firebase_auth - sha256: "64ac4dc04b51aab9d17c23b496c90f948b9ce2065d7b83e0829c7a497d88f9ce" + sha256: "279b2773ff61afd9763202cb5582e2b995ee57419d826b9af6517302a59b672f" url: "https://pub.dev" source: hosted - version: "4.6.1" + version: "4.16.0" firebase_auth_platform_interface: dependency: transitive description: name: firebase_auth_platform_interface - sha256: "63fd67d125ae483722ff3742953e2e06bbc1e6cb3da68e5f7f4430d5f82f9373" + sha256: "3c9cfaccb7549492edf5b0c67c6dd1c6727c7830891aa6727f2fb225f0226626" url: "https://pub.dev" source: hosted - version: "6.15.1" + version: "7.0.9" firebase_auth_web: dependency: transitive description: name: firebase_auth_web - sha256: "241a4ecce80da2014e3cd93d7b7e1a66e9b683e4241d466d73676ac90599b805" + sha256: c7b1379ccef7abf4b6816eede67a868c44142198e42350f51c01d8fc03f95a7d url: "https://pub.dev" source: hosted - version: "5.5.1" + version: "5.8.13" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: "250678b816279b3240c3a33e1f76bf712c00718f1fbeffc85873a5da8c077379" + sha256: "96607c0e829a581c2a483c658f04e8b159964c3bae2730f73297070bc85d40bb" url: "https://pub.dev" source: hosted - version: "2.13.0" + version: "2.24.2" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + sha256: c437ae5d17e6b5cc7981cf6fd458a5db4d12979905f9aafd1fea930428a9fe63 url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "5.0.0" firebase_core_web: dependency: transitive description: name: firebase_core_web - sha256: "8c0f4c87d20e2d001a5915df238c1f9c88704231f591324205f5a5d2a7740a45" + sha256: d585bdf3c656c3f7821ba1bd44da5f13365d22fcecaf5eb75c4295246aaa83c0 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.10.0" firebase_crashlytics: dependency: "direct main" description: name: firebase_crashlytics - sha256: "0d74cca3085f144f99aa4bd82cc4d33280d4cb72bac0b733cbf97c2d7d126df8" + sha256: "5125b7f3fcef2bfdd7e071afe7edcefd9597968003e44e073456c773d91694ee" url: "https://pub.dev" source: hosted - version: "3.3.1" + version: "3.4.9" firebase_crashlytics_platform_interface: dependency: transitive description: name: firebase_crashlytics_platform_interface - sha256: "13880033d5f2055f53bcda28024e16607b8400445a425f86732c1935da9260db" + sha256: "359197344def001589c84f8d1d57c05f6e2e773f559205610ce58c25e2045a57" url: "https://pub.dev" source: hosted - version: "3.6.1" + version: "3.6.16" firebase_storage: dependency: "direct main" description: name: firebase_storage - sha256: "89ff2dfd353f953fb2bbbe04359ea1a46d643944f310cfed22dadf352fc16976" + sha256: "75e6cb6bed65138b5bbd86bfd7cf9bc9a175fb0c31aacc400e9203df117ffbe6" url: "https://pub.dev" source: hosted - version: "11.2.1" + version: "11.6.0" firebase_storage_platform_interface: dependency: transitive description: name: firebase_storage_platform_interface - sha256: c06ccd21c3ed20da6128629ab7d525f7b613caddfcd5466ba4a1ff58655261ac + sha256: "545a3a8edf337850403bb0fa03c8074a53deb87c0107d19755c77a82ce07919e" url: "https://pub.dev" source: hosted - version: "4.4.1" + version: "5.1.3" firebase_storage_web: dependency: transitive description: name: firebase_storage_web - sha256: "26a039f211b226fc216f9f06f13402bdf08661edb7c42cb1de3bd236afbbbf75" + sha256: ee6870ff79aa304b8996ba18a4aefe1e8b3fc31fd385eab6574180267aa8d393 url: "https://pub.dev" source: hosted - version: "3.6.1" + version: "3.6.17" fixnum: dependency: transitive description: @@ -422,30 +454,22 @@ packages: url: "https://pub.dev" source: hosted version: "8.1.3" - flutter_blurhash: - dependency: transitive - description: - name: flutter_blurhash - sha256: "05001537bd3fac7644fa6558b09ec8c0a3f2eba78c0765f88912882b1331a5c6" - url: "https://pub.dev" - source: hosted - version: "0.7.0" flutter_cache_manager: dependency: transitive description: name: flutter_cache_manager - sha256: "32cd900555219333326a2d0653aaaf8671264c29befa65bbd9856d204a4c9fb3" + sha256: "8207f27539deb83732fdda03e259349046a39a4c767269285f449ade355d54ba" url: "https://pub.dev" source: hosted - version: "3.3.0" + version: "3.3.1" flutter_lints: dependency: "direct dev" description: name: flutter_lints - sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.3" flutter_localizations: dependency: "direct main" description: flutter @@ -455,58 +479,58 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "96af49aa6b57c10a312106ad6f71deed5a754029c24789bbf620ba784f0bd0b0" + sha256: b068ffc46f82a55844acfa4fdbb61fad72fa2aef0905548419d97f0f95c456da url: "https://pub.dev" source: hosted - version: "2.0.14" + version: "2.0.17" flutter_secure_storage: dependency: "direct main" description: name: flutter_secure_storage - sha256: "98352186ee7ad3639ccc77ad7924b773ff6883076ab952437d20f18a61f0a7c5" + sha256: "22dbf16f23a4bcf9d35e51be1c84ad5bb6f627750565edd70dab70f3ff5fff8f" url: "https://pub.dev" source: hosted - version: "8.0.0" + version: "8.1.0" flutter_secure_storage_linux: dependency: transitive description: name: flutter_secure_storage_linux - sha256: "0912ae29a572230ad52d8a4697e5518d7f0f429052fd51df7e5a7952c7efe2a3" + sha256: "3d5032e314774ee0e1a7d0a9f5e2793486f0dff2dd9ef5a23f4e3fb2a0ae6a9e" url: "https://pub.dev" source: hosted - version: "1.1.3" + version: "1.2.0" flutter_secure_storage_macos: dependency: transitive description: name: flutter_secure_storage_macos - sha256: "083add01847fc1c80a07a08e1ed6927e9acd9618a35e330239d4422cd2a58c50" + sha256: bd33935b4b628abd0b86c8ca20655c5b36275c3a3f5194769a7b3f37c905369c url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.1" flutter_secure_storage_platform_interface: dependency: transitive description: name: flutter_secure_storage_platform_interface - sha256: b3773190e385a3c8a382007893d678ae95462b3c2279e987b55d140d3b0cb81b + sha256: "0d4d3a5dd4db28c96ae414d7ba3b8422fd735a8255642774803b2532c9a61d7e" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.2" flutter_secure_storage_web: dependency: transitive description: name: flutter_secure_storage_web - sha256: "42938e70d4b872e856e678c423cc0e9065d7d294f45bc41fc1981a4eb4beaffe" + sha256: "30f84f102df9dcdaa2241866a958c2ec976902ebdaa8883fbfe525f1f2f3cf20" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.1.2" flutter_secure_storage_windows: dependency: transitive description: name: flutter_secure_storage_windows - sha256: fc2910ec9b28d60598216c29ea763b3a96c401f0ce1d13cdf69ccb0e5c93c3ee + sha256: "38f9501c7cb6f38961ef0e1eacacee2b2d4715c63cc83fe56449c4d3d0b47255" url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.1" flutter_test: dependency: "direct dev" description: flutter @@ -529,82 +553,90 @@ packages: dependency: "direct main" description: name: get_it - sha256: "529de303c739fca98cd7ece5fca500d8ff89649f1bb4b4e94fb20954abcd7468" + sha256: d0b88dc35a7f97fd91fec0cf8f165abd97a57977968d8fc02ba0bc92e14ba07e url: "https://pub.dev" source: hosted - version: "7.6.0" + version: "7.6.6" glob: dependency: transitive description: name: glob - sha256: "4515b5b6ddb505ebdd242a5f2cc5d22d3d6a80013789debfbda7777f47ea308c" + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" go_router: dependency: "direct main" description: name: go_router - sha256: bd7e671d26fd39c78cba82070fa34ef1f830b0e7ed1aeebccabc6561302a7ee5 + sha256: "3b40e751eaaa855179b416974d59d29669e750d2e50fcdb2b37f1cb0ca8c803a" url: "https://pub.dev" source: hosted - version: "6.5.9" + version: "13.0.1" + google_identity_services_web: + dependency: transitive + description: + name: google_identity_services_web + sha256: "0c56c2c5d60d6dfaf9725f5ad4699f04749fb196ee5a70487a46ef184837ccf6" + url: "https://pub.dev" + source: hosted + version: "0.3.0+2" google_sign_in: dependency: "direct main" description: name: google_sign_in - sha256: "821f354c053d51a2d417b02d42532a19a6ea8057d2f9ebb8863c07d81c98aaf9" + sha256: "0b8787cb9c1a68ad398e8010e8c8766bfa33556d2ab97c439fb4137756d7308f" url: "https://pub.dev" source: hosted - version: "5.4.4" + version: "6.2.1" google_sign_in_android: dependency: transitive description: name: google_sign_in_android - sha256: "2a8b90b766ce00b03e7543f4ffeec97b6eb51fb6c3f31ce2a364bd1f1b9dd7fc" + sha256: bfd42c81c30c6faba16e0f62968d5505a87504aaa672b3155ee931461abb0a49 url: "https://pub.dev" source: hosted - version: "6.1.14" + version: "6.1.21" google_sign_in_ios: dependency: transitive description: name: google_sign_in_ios - sha256: "6ec0e13a4c5c646471b9f6a25ceb3ae76d339889d4c0f79b729bf0714215a63e" + sha256: f3336d9e44d4d28063ac90271f6db5caf99f0480cb07281330e7a432edb95226 url: "https://pub.dev" source: hosted - version: "5.6.2" + version: "5.7.3" google_sign_in_platform_interface: dependency: transitive description: name: google_sign_in_platform_interface - sha256: "95a9e0a8701b5485f2ca330fd1fc6f918f5ce088042ce1019c5e389d8574ae4c" + sha256: "1f6e5787d7a120cc0359ddf315c92309069171306242e181c09472d1b00a2971" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.5" google_sign_in_web: dependency: transitive description: name: google_sign_in_web - sha256: "75cc41ebc53b1756320ee14d9c3018ad3e6cea298147dbcd86e9d0c8d6720b40" + sha256: a278ea2d01013faf341cbb093da880d0f2a552bbd1cb6ee90b5bebac9ba69d77 url: "https://pub.dev" source: hosted - version: "0.10.2+1" + version: "0.12.3+2" graphs: dependency: transitive description: name: graphs - sha256: "772db3d53d23361d4ffcf5a9bb091cf3ee9b22f2be52cd107cd7a2683a89ba0e" + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.3.1" http: dependency: "direct main" description: name: http - sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba url: "https://pub.dev" source: hosted - version: "0.13.6" + version: "1.2.0" http_multi_server: dependency: transitive description: @@ -625,66 +657,90 @@ packages: dependency: "direct main" description: name: image_picker - sha256: "9978d3510af4e6a902e545ce19229b926e6de6a1828d6134d3aab2e129a4d270" + sha256: "26222b01a0c9a2c8fe02fc90b8208bd3325da5ed1f4a2acabf75939031ac0bdd" url: "https://pub.dev" source: hosted - version: "0.8.7+5" + version: "1.0.7" image_picker_android: dependency: transitive description: name: image_picker_android - sha256: "364967c8d581f5d75fc05f6c79fcf1115e3c05db3d3eee1aaca52e0da3f7501c" + sha256: "39f2bfe497e495450c81abcd44b62f56c2a36a37a175da7d137b4454977b51b1" url: "https://pub.dev" source: hosted - version: "0.8.6+15" + version: "0.8.9+3" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - sha256: "98f50d6b9f294c8ba35e25cc0d13b04bfddd25dbc8d32fa9d566a6572f2c081c" + sha256: e2423c53a68b579a7c37a1eda967b8ae536c3d98518e5db95ca1fe5719a730a3 url: "https://pub.dev" source: hosted - version: "2.1.12" + version: "3.0.2" image_picker_ios: dependency: transitive description: name: image_picker_ios - sha256: d779210bda268a03b57e923fb1e410f32f5c5e708ad256348bcbf1f44f558fd0 + sha256: fadafce49e8569257a0cad56d24438a6fa1f0cbd7ee0af9b631f7492818a4ca3 + url: "https://pub.dev" + source: hosted + version: "0.8.9+1" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "4ed1d9bb36f7cd60aa6e6cd479779cc56a4cb4e4de8f49d487b1aaad831300fa" url: "https://pub.dev" source: hosted - version: "0.8.7+4" + version: "0.2.1+1" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: "3f5ad1e8112a9a6111c46d0b57a7be2286a9a07fc6e1976fdf5be2bd31d4ff62" + url: "https://pub.dev" + source: hosted + version: "0.2.1+1" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - sha256: "1991219d9dbc42a99aff77e663af8ca51ced592cd6685c9485e3458302d3d4f8" + sha256: fa4e815e6fcada50e35718727d83ba1c92f1edf95c0b4436554cec301b56233b + url: "https://pub.dev" + source: hosted + version: "2.9.3" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" url: "https://pub.dev" source: hosted - version: "2.6.3" + version: "0.2.1+1" injectable: dependency: "direct main" description: name: injectable - sha256: c0cc829eb71c950889e2ae363f0755a9686852b5ea21584b5aefc106bce64d0c + sha256: cd3c422e13270c81f64ab73c80406b2b2ed563fe59d0ff2093eb7eee63d0bbeb url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.3.2" injectable_generator: dependency: "direct dev" description: name: injectable_generator - sha256: "0670348cfeb5f62de97977f21e11c826c41e4fcf2a34e686de3aa94f1d47a190" + sha256: f9d3c05f0938403f79ad6c6d23ec8e37a7a05ad980b1bf9399493f3e41845788 url: "https://pub.dev" source: hosted - version: "2.1.5" + version: "2.4.1" intl: dependency: "direct main" description: name: intl - sha256: "910f85bce16fb5c6f614e117efa303e85a1731bb0081edf3604a2ae6e9a3cc91" + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.18.1" io: dependency: transitive description: @@ -697,10 +753,10 @@ packages: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.7" json_annotation: dependency: "direct main" description: @@ -713,50 +769,50 @@ packages: dependency: "direct dev" description: name: json_serializable - sha256: "43793352f90efa5d8b251893a63d767b2f7c833120e3cc02adad55eefec04dc7" + sha256: aa1f5a8912615733e0fdc7a02af03308933c93235bdc8d50d0b0c8a8ccb0b969 url: "https://pub.dev" source: hosted - version: "6.6.2" + version: "6.7.1" lints: dependency: transitive description: name: lints - sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.1" logging: dependency: transitive description: name: logging - sha256: "04094f2eb032cbb06c6f6e8d3607edcfcb0455e2bb6cbc010cb01171dcb64e6d" + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" matcher: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.10.0" mime: dependency: transitive description: @@ -769,10 +825,10 @@ packages: dependency: "direct dev" description: name: mockito - sha256: dd61809f04da1838a680926de50a9e87385c1de91c6579629c3d1723946e8059 + sha256: "6841eed20a7befac0ce07df8116c8b8233ed1f4486a7647c7fc5a02ae6163917" url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "5.4.4" nested: dependency: transitive description: @@ -793,18 +849,18 @@ packages: dependency: "direct main" description: name: oauth2 - sha256: "1e8376c222651904caf7785fd2fa01b1e2be608c94bec842a94e116deca88f13" + sha256: c4013ef62be37744efdc0861878fd9e9285f34db1f9e331cc34100d7674feb42 url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" octo_image: dependency: transitive description: name: octo_image - sha256: "107f3ed1330006a3bea63615e81cf637433f5135a52466c7caa0e7152bca9143" + sha256: "45b40f99622f11901238e18d48f5f12ea36426d8eced9f4cbf58479c7aa2430d" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "2.0.0" package_config: dependency: transitive description: @@ -817,10 +873,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: "10259b111176fba5c505b102e3a5b022b51dd97e30522e906d6922c745584745" + sha256: "88bc797f44a94814f2213db1c9bd5badebafdfb8290ca9f78d4b9ee2a3db4d79" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "5.0.1" package_info_plus_platform_interface: dependency: transitive description: @@ -833,90 +889,82 @@ packages: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" path_provider: dependency: transitive description: name: path_provider - sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" + sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b url: "https://pub.dev" source: hosted - version: "2.0.15" + version: "2.1.2" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" + sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" url: "https://pub.dev" source: hosted - version: "2.0.27" + version: "2.2.2" path_provider_foundation: dependency: transitive description: name: path_provider_foundation - sha256: "1995d88ec2948dac43edf8fe58eb434d35d22a2940ecee1a9fefcd62beee6eb3" + sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" url: "https://pub.dev" source: hosted - version: "2.2.3" + version: "2.3.2" path_provider_linux: dependency: transitive description: name: path_provider_linux - sha256: "2ae08f2216225427e64ad224a24354221c2c7907e448e6e0e8b57b1eb9f10ad1" + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 url: "https://pub.dev" source: hosted - version: "2.1.10" + version: "2.2.1" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" url: "https://pub.dev" source: hosted - version: "2.0.6" + version: "2.1.2" path_provider_windows: dependency: transitive description: name: path_provider_windows - sha256: d3f80b32e83ec208ac95253e0cd4d298e104fbc63cb29c5c69edaed43b0c69d6 + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" url: "https://pub.dev" source: hosted - version: "2.1.6" - pedantic: - dependency: transitive - description: - name: pedantic - sha256: "67fc27ed9639506c856c840ccce7594d0bdcd91bc8d53d6e52359449a1d50602" - url: "https://pub.dev" - source: hosted - version: "1.11.1" + version: "2.2.1" petitparser: dependency: transitive description: name: petitparser - sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 url: "https://pub.dev" source: hosted - version: "5.1.0" + version: "6.0.2" platform: dependency: transitive description: name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.4" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.8" pool: dependency: transitive description: @@ -925,22 +973,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.1" - process: - dependency: transitive - description: - name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" - url: "https://pub.dev" - source: hosted - version: "4.2.4" provider: dependency: transitive description: name: provider - sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096" url: "https://pub.dev" source: hosted - version: "6.0.5" + version: "6.1.1" pub_semver: dependency: transitive description: @@ -957,14 +997,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.3" - quiver: - dependency: transitive - description: - name: quiver - sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47 - url: "https://pub.dev" - source: hosted - version: "3.2.1" recase: dependency: transitive description: @@ -985,58 +1017,58 @@ packages: dependency: "direct main" description: name: shared_preferences - sha256: "16d3fb6b3692ad244a695c0183fca18cf81fd4b821664394a781de42386bf022" + sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.2.2" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "6478c6bbbecfe9aced34c483171e90d7c078f5883558b30ec3163cf18402c749" + sha256: "8568a389334b6e83415b6aae55378e158fbc2314e074983362d20c562780fb06" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.2.1" shared_preferences_foundation: dependency: transitive description: name: shared_preferences_foundation - sha256: e014107bb79d6d3297196f4f2d0db54b5d1f85b8ea8ff63b8e8b391a02700feb + sha256: "7708d83064f38060c7b39db12aefe449cb8cdc031d6062280087bc4cdb988f5c" url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.3.5" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - sha256: "9d387433ca65717bbf1be88f4d5bb18f10508917a8fa2fb02e0fd0d7479a9afa" + sha256: "9f2cbcf46d4270ea8be39fa156d86379077c8a5228d9dfdb1164ae0bb93f1faa" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.3.2" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - sha256: fb5cf25c0235df2d0640ac1b1174f6466bd311f621574997ac59018a6664548d + sha256: "22e2ecac9419b4246d7c22bfbbda589e3acf5c0351137d87dd2939d984d37c3b" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.3.2" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - sha256: "74083203a8eae241e0de4a0d597dbedab3b8fef5563f33cf3c12d7e93c655ca5" + sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.2.2" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - sha256: "5e588e2efef56916a3b229c3bfe81e6a525665a454519ca51dbcc4236a274173" + sha256: "841ad54f3c8381c480d0c9b508b89a34036f512482c407e6df7a9c4aa2ef8f59" url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.3.2" shelf: dependency: transitive description: @@ -1070,50 +1102,58 @@ packages: dependency: transitive description: name: source_gen - sha256: "373f96cf5a8744bc9816c1ff41cf5391bbdbe3d7a96fe98c622b6738a8a7bd33" + sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.5.0" source_helper: dependency: transitive description: name: source_helper - sha256: "3b67aade1d52416149c633ba1bb36df44d97c6b51830c2198e934e3fca87ca1f" + sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" url: "https://pub.dev" source: hosted - version: "1.3.3" + version: "1.3.4" source_span: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "7.0.0" sqflite: dependency: transitive description: name: sqflite - sha256: b4d6710e1200e96845747e37338ea8a819a12b51689a3bcf31eff0003b37a0b9 + sha256: "591f1602816e9c31377d5f008c2d9ef7b8aca8941c3f89cc5fd9d84da0c38a9a" url: "https://pub.dev" source: hosted - version: "2.2.8+4" + version: "2.3.0" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: e77abf6ff961d69dfef41daccbb66b51e9983cdd5cb35bf30733598057401555 + sha256: bb4738f15b23352822f4c42a531677e5c6f522e079461fd240ead29d8d8a54a6 url: "https://pub.dev" source: hosted - version: "2.4.5" + version: "2.5.0+2" stack_trace: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" sticky_headers: dependency: "direct main" description: @@ -1126,10 +1166,10 @@ packages: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" stream_transform: dependency: transitive description: @@ -1150,18 +1190,18 @@ packages: dependency: transitive description: name: synchronized - sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" + sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.0+1" table_calendar: dependency: "direct main" description: name: table_calendar - sha256: "7f1270313c0cdb245b583ed8518982c01d4a7e95869b3c30abcbae3b642c45d0" + sha256: "1e3521a3e6d3fc7f645a58b135ab663d458ab12504f1ea7f9b4b81d47086c478" url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.0.9" term_glyph: dependency: transitive description: @@ -1174,10 +1214,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.6.1" timing: dependency: transitive description: @@ -1198,74 +1238,74 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: eb1e00ab44303d50dd487aab67ebc575456c146c6af44422f9c13889984c00f3 + sha256: d25bb0ca00432a5e1ee40e69c36c85863addf7cc45e433769d61bed3fe81fd96 url: "https://pub.dev" source: hosted - version: "6.1.11" + version: "6.2.3" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "1a5848f598acc5b7d8f7c18b8cb834ab667e59a13edc3c93e9d09cf38cc6bc87" + sha256: "507dc655b1d9cb5ebc756032eb785f114e415f91557b73bf60b7e201dfedeb2f" url: "https://pub.dev" source: hosted - version: "6.0.34" + version: "6.2.2" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "9af7ea73259886b92199f9e42c116072f05ff9bea2dcb339ab935dfc957392c2" + sha256: "75bb6fe3f60070407704282a2d295630cab232991eb52542b18347a8a941df03" url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "6.2.4" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: "207f4ddda99b95b4d4868320a352d374b0b7e05eefad95a4a26f57da413443f5" + sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.1.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: "91ee3e75ea9dadf38036200c5d3743518f4a5eb77a8d13fda1ee5764373f185e" + sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.1.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - sha256: "6c9ca697a5ae218ce56cece69d46128169a58aa8653c1b01d26fcd4aad8c4370" + sha256: a932c3a8082e118f80a475ce692fde89dc20fddb24c57360b96bc56f7035de1f url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.3.1" url_launcher_web: dependency: transitive description: name: url_launcher_web - sha256: "81fe91b6c4f84f222d186a9d23c73157dc4c8e1c71489c4d08be1ad3b228f1aa" + sha256: fff0932192afeedf63cdd50ecbb1bc825d31aed259f02bb8dba0f3b729a5e88b url: "https://pub.dev" source: hosted - version: "2.0.16" + version: "2.2.3" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: "254708f17f7c20a9c8c471f67d86d76d4a3f9c1591aad1e15292008aceb82771" + sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 url: "https://pub.dev" source: hosted - version: "3.0.6" + version: "3.1.1" uuid: dependency: transitive description: name: uuid - sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8 url: "https://pub.dev" source: hosted - version: "3.0.7" + version: "4.3.3" vector_math: dependency: transitive description: @@ -1278,10 +1318,18 @@ packages: dependency: transitive description: name: watcher - sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -1310,18 +1358,18 @@ packages: dependency: transitive description: name: xdg_directories - sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.4" xml: dependency: transitive description: name: xml - sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5" + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 url: "https://pub.dev" source: hosted - version: "6.2.2" + version: "6.5.0" yaml: dependency: transitive description: @@ -1331,5 +1379,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=2.19.0 <3.0.0" - flutter: ">=3.3.0" + dart: ">=3.2.0 <4.0.0" + flutter: ">=3.16.0" diff --git a/pubspec.yaml b/pubspec.yaml index 35a534867..3ad066d4a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,7 +6,7 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: ">=2.17.0 <3.0.0" + sdk: '>=3.2.0 <4.0.0' dependencies: flutter: @@ -15,7 +15,7 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - cached_network_image: ^3.2.3 + cached_network_image: ^3.3.1 cloud_firestore: ^4.5.2 collection: ^1.17.0 connectivity_plus: ^3.0.5 @@ -28,15 +28,15 @@ dependencies: flutter_bloc: ^8.1.3 flutter_secure_storage: ^8.0.0 get_it: ^7.3.0 - google_sign_in: ^5.4.4 - go_router: ^6.5.8 - http: ^0.13.5 - intl: ^0.17.0 + google_sign_in: ^6.2.1 + go_router: ^13.0.1 + http: ^1.2.0 + intl: ^0.18.1 injectable: ^2.1.1 - image_picker: ^0.8.7+3 + image_picker: ^1.0.7 json_annotation: ^4.8.1 - oauth2: ^2.0.1 - package_info_plus: ^3.1.2 + oauth2: ^2.0.2 + package_info_plus: ^5.0.1 simple_gesture_detector: rxdart: ^0.27.7 shared_preferences: ^2.1.1 diff --git a/test/unit_test/admin/home/home_screen/admin_home_bloc_test.dart b/test/unit_test/admin/home/home_screen/admin_home_bloc_test.dart index 72dd44161..bfe386db8 100644 --- a/test/unit_test/admin/home/home_screen/admin_home_bloc_test.dart +++ b/test/unit_test/admin/home/home_screen/admin_home_bloc_test.dart @@ -68,15 +68,16 @@ void main() { status: Status.loading, ), AdminHomeState( - status: Status.success, - leaveAppMap: bloc.convertListToMap([LeaveApplication(employee: employee, leave: leave)]) - ), + status: Status.success, + leaveAppMap: bloc.convertListToMap( + [LeaveApplication(employee: employee, leave: leave)])), ])); }); test('Emits failure after fetch data', () { when(employeeRepo.employees).thenAnswer((_) => Stream.value([employee])); - when(leaveRepo.pendingLeaves).thenAnswer((_) => Stream.error(firestoreFetchDataError)); + when(leaveRepo.pendingLeaves) + .thenAnswer((_) => Stream.error(firestoreFetchDataError)); bloc.add(AdminHomeInitialLoadEvent()); expectLater( bloc.stream, @@ -85,12 +86,10 @@ void main() { status: Status.loading, ), const AdminHomeState( - error: firestoreFetchDataError, - status: Status.error, + error: firestoreFetchDataError, + status: Status.error, ), ])); }); - - }); } diff --git a/test/unit_test/admin/leaves/application_detail/admin_leave_request_details_bloc_test.dart b/test/unit_test/admin/leaves/application_detail/admin_leave_request_details_bloc_test.dart index 06cab9532..563510eb6 100644 --- a/test/unit_test/admin/leaves/application_detail/admin_leave_request_details_bloc_test.dart +++ b/test/unit_test/admin/leaves/application_detail/admin_leave_request_details_bloc_test.dart @@ -26,8 +26,7 @@ void main() { setUp(() { leaveRepo = MockLeaveRepo(); notificationService = MockNotificationService(); - bloc = AdminLeaveDetailsBloc( - leaveRepo, notificationService); + bloc = AdminLeaveDetailsBloc(leaveRepo, notificationService); }); group('Leave Application Detail bloc', () { @@ -43,10 +42,11 @@ void main() { test( 'Emits loading state and success state respectively if leave counts are fetched successfully from firestore', () { - when(leaveRepo.getUserUsedLeaves(uid: 'id')).thenAnswer((_) async => const LeaveCounts(casualLeaves: 5,urgentLeaves: 5)); + when(leaveRepo.getUserUsedLeaves(uid: 'id')).thenAnswer( + (_) async => const LeaveCounts(casualLeaves: 5, urgentLeaves: 5)); AdminLeaveDetailsState successState = const AdminLeaveDetailsState( adminReply: '', - usedLeavesCount: LeaveCounts(casualLeaves: 5,urgentLeaves: 5), + usedLeavesCount: LeaveCounts(casualLeaves: 5, urgentLeaves: 5), error: null, actionStatus: Status.initial, leaveCountStatus: Status.success); @@ -58,7 +58,8 @@ void main() { test( 'Emits loading state and error state if exception is thrown from any cause', () { - when(leaveRepo.getUserUsedLeaves(uid: 'id')).thenThrow(Exception('error')); + when(leaveRepo.getUserUsedLeaves(uid: 'id')) + .thenThrow(Exception('error')); AdminLeaveDetailsState errorState = const AdminLeaveDetailsState( adminReply: '', usedLeavesCount: LeaveCounts(), @@ -167,7 +168,9 @@ void main() { status: LeaveStatus.approved)) .thenAnswer((realInvocation) async => true); when(leaveRepo.updateLeaveStatus( - leaveId: "leave-id", status: LeaveStatus.approved, response: '')) + leaveId: "leave-id", + status: LeaveStatus.approved, + response: '')) .thenThrow(Exception(firestoreFetchDataError)); bloc.add(LeaveResponseEvent( name: "dummy", diff --git a/test/unit_test/admin/member/detail/employee_detail_bloc_test.dart b/test/unit_test/admin/member/detail/employee_detail_bloc_test.dart index aa8f3daae..708719353 100644 --- a/test/unit_test/admin/member/detail/employee_detail_bloc_test.dart +++ b/test/unit_test/admin/member/detail/employee_detail_bloc_test.dart @@ -50,9 +50,11 @@ void main() { employeeRepo = MockEmployeeRepo(); employeeDetailBloc = EmployeeDetailBloc(accountService, spaceService, userStateNotifier, employeeService, leaveRepo, employeeRepo); - when(leaveRepo.getUserUsedLeaves(uid: employee.uid)).thenAnswer((_) async => const LeaveCounts(urgentLeaves: 5,casualLeaves: 5)); + when(leaveRepo.getUserUsedLeaves(uid: employee.uid)).thenAnswer( + (_) async => const LeaveCounts(urgentLeaves: 5, casualLeaves: 5)); when(userStateNotifier.currentSpaceId).thenReturn("space-id"); - when(spaceService.getPaidLeaves(spaceId: "space-id")).thenAnswer((_) async => 12); + when(spaceService.getPaidLeaves(spaceId: "space-id")) + .thenAnswer((_) async => 12); }); group('Employee detail bloc', () { @@ -61,9 +63,8 @@ void main() { }); test('Emits Failure state when employee is found null', () { - when(employeeRepo.memberDetails(employee.uid)) - .thenAnswer((_) => Stream.value(null)); + .thenAnswer((_) => Stream.value(null)); employeeDetailBloc .add(EmployeeDetailInitialLoadEvent(employeeId: employee.uid)); expectLater( @@ -89,7 +90,7 @@ void main() { test('Emits Failure state when exception is thrown while fetching leaves', () { when(employeeRepo.memberDetails(employee.uid)) - .thenAnswer((_) => Stream.value(employee)); + .thenAnswer((_) => Stream.value(employee)); when(leaveRepo.getUserUsedLeaves(uid: employee.uid)) .thenThrow(Exception(firestoreFetchDataError)); employeeDetailBloc @@ -102,15 +103,18 @@ void main() { ])); }); - test('Emits Loading state while fetch data from firestore and then EmitsSuccess state with detail of employee ', + test( + 'Emits Loading state while fetch data from firestore and then EmitsSuccess state with detail of employee ', () { - when(employeeRepo.memberDetails(employee.uid)) - .thenAnswer((_) => Stream.value(employee)); + when(employeeRepo.memberDetails(employee.uid)) + .thenAnswer((_) => Stream.value(employee)); employeeDetailBloc .add(EmployeeDetailInitialLoadEvent(employeeId: employee.uid)); EmployeeDetailLoadedState loadedState = EmployeeDetailLoadedState( - employee: employee, timeOffRatio: 10 / 12, usedLeaves: const LeaveCounts(urgentLeaves: 5,casualLeaves: 5)); + employee: employee, + timeOffRatio: 10 / 12, + usedLeaves: const LeaveCounts(urgentLeaves: 5, casualLeaves: 5)); expectLater(employeeDetailBloc.stream, emitsInOrder([EmployeeDetailLoadingState(), loadedState])); }); @@ -128,16 +132,22 @@ void main() { test('deactivate employee success test', () async { employeeDetailBloc.add(EmployeeStatusChangeEvent( employeeId: employee.uid, status: EmployeeStatus.inactive)); - await untilCalled(employeeService.changeAccountStatus(id: employee.uid, status: EmployeeStatus.inactive)); - verify(employeeService.changeAccountStatus(id: employee.uid, status: EmployeeStatus.inactive)).called(1); + await untilCalled(employeeService.changeAccountStatus( + id: employee.uid, status: EmployeeStatus.inactive)); + verify(employeeService.changeAccountStatus( + id: employee.uid, status: EmployeeStatus.inactive)) + .called(1); - await untilCalled(accountService.deleteSpaceIdFromAccount(spaceId: 'space-id', uid:employee.uid)); - verify(accountService.deleteSpaceIdFromAccount(spaceId: 'space-id', uid:employee.uid)).called(1); + await untilCalled(accountService.deleteSpaceIdFromAccount( + spaceId: 'space-id', uid: employee.uid)); + verify(accountService.deleteSpaceIdFromAccount( + spaceId: 'space-id', uid: employee.uid)) + .called(1); }); test('activate employee failed test', () { when(employeeService.changeAccountStatus( - id: employee.uid, status: EmployeeStatus.active)) + id: employee.uid, status: EmployeeStatus.active)) .thenThrow(Exception("error")); employeeDetailBloc.add(EmployeeStatusChangeEvent( employeeId: employee.uid, status: EmployeeStatus.active)); @@ -148,11 +158,17 @@ void main() { test('activate employee success test', () async { employeeDetailBloc.add(EmployeeStatusChangeEvent( employeeId: employee.uid, status: EmployeeStatus.active)); - await untilCalled(employeeService.changeAccountStatus(id: employee.uid, status: EmployeeStatus.active)); - verify(employeeService.changeAccountStatus(id: employee.uid, status: EmployeeStatus.active)).called(1); + await untilCalled(employeeService.changeAccountStatus( + id: employee.uid, status: EmployeeStatus.active)); + verify(employeeService.changeAccountStatus( + id: employee.uid, status: EmployeeStatus.active)) + .called(1); - await untilCalled(accountService.addSpaceIdFromAccount(spaceId: 'space-id', uid:employee.uid)); - verify(accountService.addSpaceIdFromAccount(spaceId: 'space-id', uid:employee.uid)).called(1); + await untilCalled(accountService.addSpaceIdFromAccount( + spaceId: 'space-id', uid: employee.uid)); + verify(accountService.addSpaceIdFromAccount( + spaceId: 'space-id', uid: employee.uid)) + .called(1); }); }); } diff --git a/test/unit_test/admin/member/edit_employee/admin_edit_employee_details_test.dart b/test/unit_test/admin/member/edit_employee/admin_edit_employee_details_test.dart index 547511ad3..9543ec2e7 100644 --- a/test/unit_test/admin/member/edit_employee/admin_edit_employee_details_test.dart +++ b/test/unit_test/admin/member/edit_employee/admin_edit_employee_details_test.dart @@ -14,8 +14,7 @@ import 'package:projectunity/ui/admin/members/edit_employee/bloc/admin_edit_empl import 'admin_edit_employee_details_test.mocks.dart'; -@GenerateMocks( - [EmployeeService, StorageService, UserStateNotifier]) +@GenerateMocks([EmployeeService, StorageService, UserStateNotifier]) void main() { late UserStateNotifier userStateNotifier; late StorageService storageService; @@ -77,8 +76,7 @@ void main() { test('pick and change profile image test', () { editEmployeeDetailsBloc.add(ChangeProfileImageEvent('path')); - expect( - editEmployeeDetailsBloc.stream, + expect(editEmployeeDetailsBloc.stream, emits(const AdminEditEmployeeDetailsState(pickedImage: 'path'))); }); @@ -161,10 +159,11 @@ void main() { test('update Employee details with profile test', () async { when(userStateNotifier.currentSpaceId).thenReturn('space-id'); - - editEmployeeDetailsBloc.add(EditEmployeeByAdminInitialEvent(roleType: emp.role, dateOfJoining: emp.dateOfJoining)); + editEmployeeDetailsBloc.add(EditEmployeeByAdminInitialEvent( + roleType: emp.role, dateOfJoining: emp.dateOfJoining)); editEmployeeDetailsBloc.add(ChangeProfileImageEvent('path')); - when(storageService.uploadProfilePic(path: 'images/space-id/${emp.uid}/profile', imagePath: 'path')) + when(storageService.uploadProfilePic( + path: 'images/space-id/${emp.uid}/profile', imagePath: 'path')) .thenAnswer((realInvocation) async => 'image-url'); editEmployeeDetailsBloc.add(UpdateEmployeeByAdminEvent( previousEmployeeData: emp, @@ -176,13 +175,17 @@ void main() { expect( editEmployeeDetailsBloc.stream, emitsInOrder([ - AdminEditEmployeeDetailsState(dateOfJoining: emp.dateOfJoining.dateOnly, role: Role.admin), - AdminEditEmployeeDetailsState(dateOfJoining: emp.dateOfJoining.dateOnly, role: Role.admin,pickedImage: 'path'), AdminEditEmployeeDetailsState( - status: Status.loading, + dateOfJoining: emp.dateOfJoining.dateOnly, role: Role.admin), + AdminEditEmployeeDetailsState( dateOfJoining: emp.dateOfJoining.dateOnly, role: Role.admin, - pickedImage: 'path', + pickedImage: 'path'), + AdminEditEmployeeDetailsState( + status: Status.loading, + dateOfJoining: emp.dateOfJoining.dateOnly, + role: Role.admin, + pickedImage: 'path', ), AdminEditEmployeeDetailsState( dateOfJoining: emp.dateOfJoining.dateOnly, diff --git a/test/unit_test/bloc/network/network_connection_bloc_test.dart b/test/unit_test/bloc/network/network_connection_bloc_test.dart index df16a1dfa..29f75d3be 100644 --- a/test/unit_test/bloc/network/network_connection_bloc_test.dart +++ b/test/unit_test/bloc/network/network_connection_bloc_test.dart @@ -42,8 +42,8 @@ void main() { when(connectivity.onConnectivityChanged).thenAnswer( (_) => Stream.fromIterable([ConnectivityResult.ethernet])); networkConnectionBloc.add(NetworkConnectionObserveEvent()); - expectLater(networkConnectionBloc.stream, - emits(NetworkConnectionFailureState())); + expectLater( + networkConnectionBloc.stream, emits(NetworkConnectionFailureState())); }); }); } diff --git a/test/unit_test/bloc/user_state/user_state_controller_bloc_test.dart b/test/unit_test/bloc/user_state/user_state_controller_bloc_test.dart index d627d898f..25eb6b9f0 100644 --- a/test/unit_test/bloc/user_state/user_state_controller_bloc_test.dart +++ b/test/unit_test/bloc/user_state/user_state_controller_bloc_test.dart @@ -13,7 +13,8 @@ import 'package:projectunity/data/services/space_service.dart'; import 'user_state_controller_bloc_test.mocks.dart'; -@GenerateMocks([EmployeeRepo, SpaceService, UserStateNotifier, SpaceChangeNotifier]) +@GenerateMocks( + [EmployeeRepo, SpaceService, UserStateNotifier, SpaceChangeNotifier]) void main() { late UserStateControllerBloc bloc; late EmployeeRepo employeeRepo; @@ -67,7 +68,7 @@ void main() { .thenAnswer((realInvocation) => Stream.value(employee)); bloc = UserStateControllerBloc( - employeeRepo, userStateNotifier, spaceService,spaceChangeNotifier); + employeeRepo, userStateNotifier, spaceService, spaceChangeNotifier); }); test('Should emit initial state as default state of bloc', () { diff --git a/test/unit_test/model/employee/employee_test.dart b/test/unit_test/model/employee/employee_test.dart index 38cb3b61f..e6a08cd80 100644 --- a/test/unit_test/model/employee/employee_test.dart +++ b/test/unit_test/model/employee/employee_test.dart @@ -6,7 +6,7 @@ void main() { group('from json and from firestore', () { test('returns correct Employee object ', () { expect( - Employee.fromJson( { + Employee.fromJson({ 'uid': 'unique-user-doc-id', 'role': 1, 'name': 'Andrew jhone', @@ -46,15 +46,17 @@ void main() { 'Date Of Birth-Timestamp to int', DateTime(2000)) .having((employee) => employee.dateOfJoining, 'Date Of Joining-Timestamp to int', DateTime(2000)) - .having((employee) => employee.status, - 'status int to enum(active, inactive)', EmployeeStatus.active) + .having( + (employee) => employee.status, + 'status int to enum(active, inactive)', + EmployeeStatus.active) .having( (employee) => employee.level, 'Level of employee', 'L1')); }); }); test('apply correct employee to firestore', () { - Employee employee = Employee( + Employee employee = Employee( uid: 'Unique-user-id', role: Role.admin, name: 'Andrew jhone', @@ -80,7 +82,7 @@ void main() { 'image_url': employee.imageUrl, 'address': employee.address, 'level': employee.level, - 'gender':employee.gender!.value, + 'gender': employee.gender!.value, 'date_of_joining': employee.dateOfJoining.millisecondsSinceEpoch, 'status': employee.status.value, }; diff --git a/test/unit_test/model/form/form_field_test.dart b/test/unit_test/model/form/form_field_test.dart index 299eb6fd1..6df4e35ca 100644 --- a/test/unit_test/model/form/form_field_test.dart +++ b/test/unit_test/model/form/form_field_test.dart @@ -1,7 +1,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:projectunity/data/model/org_forms/org_form_field/org_form_field.dart'; - void main() { group("Form Field", () { group('from json and from firestore', () { diff --git a/test/unit_test/model/form/form_info_test.dart b/test/unit_test/model/form/form_info_test.dart index 554a1d9e3..e05f05dde 100644 --- a/test/unit_test/model/form/form_info_test.dart +++ b/test/unit_test/model/form/form_info_test.dart @@ -20,7 +20,8 @@ void main() { .having((info) => info.title, 'form title', 'title') .having((info) => info.description, 'form description', 'description') - .having((info) => info.headerImage, 'Form header url', 'image-url') + .having( + (info) => info.headerImage, 'Form header url', 'image-url') .having((info) => info.createdAt, 'Form create time', DateTime(2023)) .having((info) => info.oneTimeResponse, diff --git a/test/unit_test/model/leave/leave_test.dart b/test/unit_test/model/leave/leave_test.dart index 2cc68668a..415135728 100644 --- a/test/unit_test/model/leave/leave_test.dart +++ b/test/unit_test/model/leave/leave_test.dart @@ -6,7 +6,7 @@ void main() { group('from json and from firestore', () { test('returns correct Leave object ', () { expect( - Leave.fromJson( { + Leave.fromJson({ 'leave_id': 'unique-leave-doc-id', 'uid': 'unique-user-id', 'type': 1, @@ -24,8 +24,8 @@ void main() { 'unique-leave-doc-id') .having( (leave) => leave.uid, 'Unique user id', 'unique-user-id') - .having( - (leave) => leave.type, 'Type of leave e.g seek casual', LeaveType.urgentLeave) + .having((leave) => leave.type, 'Type of leave e.g seek casual', + LeaveType.urgentLeave) .having((leave) => leave.startDate, 'Leave start date timestamp to int value', DateTime(2000)) .having((leave) => leave.endDate, @@ -37,8 +37,10 @@ void main() { (leave) => leave.status, 'Status of leave: Pending-1, Approved-2, Rejected-3', LeaveStatus.pending) - .having((leave) => leave.appliedOn, - 'Time of applicaton applied-TimeStamp to int', DateTime(2000)) + .having( + (leave) => leave.appliedOn, + 'Time of applicaton applied-TimeStamp to int', + DateTime(2000)) .having( (leave) => leave.perDayDuration, 'Duration of each leave day like 0-no leave, 1- first half', diff --git a/test/unit_test/shared/drawer/drawer_test.dart b/test/unit_test/shared/drawer/drawer_test.dart index ca84742c2..0fe71f9c3 100644 --- a/test/unit_test/shared/drawer/drawer_test.dart +++ b/test/unit_test/shared/drawer/drawer_test.dart @@ -32,8 +32,8 @@ void main() { userStateNotifier = MockUserStateNotifier(); employeeService = MockEmployeeService(); accountService = MockAccountService(); - bloc = DrawerBloc(spaceService, userStateNotifier, accountService, - employeeService); + bloc = DrawerBloc( + spaceService, userStateNotifier, accountService, employeeService); when(userStateNotifier.userUID).thenReturn('uid'); when(userStateNotifier.currentSpaceId).thenReturn('sid'); when(accountService.fetchSpaceIds(uid: 'uid')) @@ -126,7 +126,8 @@ void main() { }); test("sign out failure test", () { - when(userStateNotifier.removeEmployeeWithSpace()).thenThrow(Exception("error")); + when(userStateNotifier.removeEmployeeWithSpace()) + .thenThrow(Exception("error")); bloc.add(SignOutFromSpaceEvent()); expect( bloc.stream, diff --git a/test/unit_test/shared/profile/view_profile/view_profile_bloc_test.dart b/test/unit_test/shared/profile/view_profile/view_profile_bloc_test.dart index df9bbd90f..1c2ae6c9a 100644 --- a/test/unit_test/shared/profile/view_profile/view_profile_bloc_test.dart +++ b/test/unit_test/shared/profile/view_profile/view_profile_bloc_test.dart @@ -61,16 +61,16 @@ void main() { }); test('Should emit loading state and then Error state in Stream have error ', - () { - bloc.add(InitialLoadevent()); - when(userStateNotifier.employeeId).thenReturn('uid'); - when(employeeRepo.memberDetails('uid')) - .thenAnswer((_) => Stream.error(firestoreFetchDataError)); - expectLater( - bloc.stream, - emitsInOrder([ - ViewProfileLoadingState(), - ViewProfileErrorState(firestoreFetchDataError) - ])); - }); + () { + bloc.add(InitialLoadevent()); + when(userStateNotifier.employeeId).thenReturn('uid'); + when(employeeRepo.memberDetails('uid')) + .thenAnswer((_) => Stream.error(firestoreFetchDataError)); + expectLater( + bloc.stream, + emitsInOrder([ + ViewProfileLoadingState(), + ViewProfileErrorState(firestoreFetchDataError) + ])); + }); } diff --git a/test/unit_test/space/edit_space_test/edit_space_test.dart b/test/unit_test/space/edit_space_test/edit_space_test.dart index 005e30a21..287236b17 100644 --- a/test/unit_test/space/edit_space_test/edit_space_test.dart +++ b/test/unit_test/space/edit_space_test/edit_space_test.dart @@ -64,15 +64,19 @@ void main() { const EditSpaceState(deleteWorkSpaceStatus: Status.loading), const EditSpaceState(deleteWorkSpaceStatus: Status.success), ])); - await untilCalled(spaceService.deleteSpace(spaceId: "space-id", owners: ["uid"], uid: 'uid' )); - verify(spaceService.deleteSpace(spaceId: "space-id", owners: ['uid'],uid: 'uid')).called(1); + await untilCalled(spaceService.deleteSpace( + spaceId: "space-id", owners: ["uid"], uid: 'uid')); + verify(spaceService.deleteSpace( + spaceId: "space-id", owners: ['uid'], uid: 'uid')) + .called(1); await untilCalled(userStateNotifier.removeEmployeeWithSpace()); verify(userStateNotifier.removeEmployeeWithSpace()).called(1); }); test("Delete space failure test", () async { bloc.add(DeleteSpaceEvent()); - when(spaceService.deleteSpace(spaceId: 'space-id', owners: ['uid'], uid: 'uid')) + when(spaceService.deleteSpace( + spaceId: 'space-id', owners: ['uid'], uid: 'uid')) .thenThrow(Exception("error")); expect( bloc.stream, diff --git a/test/unit_test/user/leaves/apply_leave/apply_leave_bloc_test.dart b/test/unit_test/user/leaves/apply_leave/apply_leave_bloc_test.dart index df58b9925..75fd60e3b 100644 --- a/test/unit_test/user/leaves/apply_leave/apply_leave_bloc_test.dart +++ b/test/unit_test/user/leaves/apply_leave/apply_leave_bloc_test.dart @@ -348,7 +348,9 @@ void main() { receiver: 'hr@canopas.com', name: "dummy", startDate: leave.startDate, - duration: appFunctions.getNotificationDuration(total: leave.total, firstLeaveDayDuration:leave.perDayDuration.first), + duration: appFunctions.getNotificationDuration( + total: leave.total, + firstLeaveDayDuration: leave.perDayDuration.first), endDate: leave.endDate)) .thenAnswer((realInvocation) async => true); leaveRequestBloc.add(ApplyLeaveEndDateChangeEvent(endDate: futureDate)); diff --git a/test/widget_test.dart b/test/widget_test.dart index d2be7cdba..ae40864af 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -7,9 +7,6 @@ import 'package:flutter_test/flutter_test.dart'; - void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - - }); + testWidgets('Counter increments smoke test', (WidgetTester tester) async {}); }