From 8c286e36aceddaeb51f5c3cdfadd31b88a6cc1df Mon Sep 17 00:00:00 2001 From: Mayank Variya <140152611+cp-mayank@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:29:57 +0530 Subject: [PATCH] Remove add player via contact (#154) * Remove add player via contact * fix lint * fix lint * remove ios permission * remove permission description --------- Co-authored-by: sidhdhi canopas --- data/.flutter-plugins-dependencies | 2 +- data/lib/extensions/list_extensions.dart | 10 +- data/lib/service/user/user_service.dart | 38 -- khelo/.gitignore | 2 + .../android/app/src/main/AndroidManifest.xml | 2 - khelo/assets/locales/app_en.arb | 13 - khelo/ios/Podfile | 2 - khelo/ios/Podfile.lock | 44 +-- khelo/ios/Runner/Info.plist | 2 - khelo/lib/ui/app_route.dart | 10 - .../flow/home/components/tournament_item.dart | 13 +- .../components/team_selection_view.dart | 2 +- .../components/complete_profile_progress.dart | 4 +- .../support/contact_support_view_model.dart | 3 +- .../add_team_member_screen.dart | 63 +--- .../confirm_number_sheet.dart | 211 ----------- .../confirm_number_view_model.dart | 69 ---- .../confirm_number_view_model.freezed.dart | 262 ------------- .../contact_selection_screen.dart | 326 ----------------- .../contact_selection_view_model.dart | 177 --------- .../contact_selection_view_model.freezed.dart | 345 ------------------ .../ui/flow/team/scanner/scanner_screen.dart | 2 +- .../detail/components/flexible_space.dart | 10 +- .../detail/components/match_group_tag.dart | 2 +- .../detail/tournament_detail_screen.dart | 5 +- khelo/pubspec.lock | 60 ++- khelo/pubspec.yaml | 3 - style/lib/button/bottom_sticky_overlay.dart | 2 +- style/lib/button/large_icon_button.dart | 5 +- style/lib/button/primary_button.dart | 4 +- style/lib/button/secondary_button.dart | 2 +- 31 files changed, 91 insertions(+), 1604 deletions(-) delete mode 100644 khelo/lib/ui/flow/team/add_team_member/confirm_number_sheet/confirm_number_sheet.dart delete mode 100644 khelo/lib/ui/flow/team/add_team_member/confirm_number_sheet/confirm_number_view_model.dart delete mode 100644 khelo/lib/ui/flow/team/add_team_member/confirm_number_sheet/confirm_number_view_model.freezed.dart delete mode 100644 khelo/lib/ui/flow/team/add_team_member/contact_selection/contact_selection_screen.dart delete mode 100644 khelo/lib/ui/flow/team/add_team_member/contact_selection/contact_selection_view_model.dart delete mode 100644 khelo/lib/ui/flow/team/add_team_member/contact_selection/contact_selection_view_model.freezed.dart diff --git a/data/.flutter-plugins-dependencies b/data/.flutter-plugins-dependencies index a3d8252f..07384434 100644 --- a/data/.flutter-plugins-dependencies +++ b/data/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"cloud_firestore","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_firestore-5.4.4/","native_build":true,"dependencies":["firebase_core"]},{"name":"cloud_functions","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_functions-5.1.3/","native_build":true,"dependencies":["firebase_core"]},{"name":"device_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/device_info_plus-10.1.2/","native_build":true,"dependencies":[]},{"name":"firebase_auth","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_auth-5.3.1/","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_core-3.6.0/","native_build":true,"dependencies":[]},{"name":"firebase_messaging","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_messaging-15.1.3/","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_storage","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_storage-12.3.2/","native_build":true,"dependencies":["firebase_core"]},{"name":"flutter_timezone","path":"/home/mayank/.pub-cache/hosted/pub.dev/flutter_timezone-3.0.1/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/package_info_plus-8.0.2/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/home/mayank/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"cloud_firestore","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_firestore-5.4.4/","native_build":true,"dependencies":["firebase_core"]},{"name":"cloud_functions","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_functions-5.1.3/","native_build":true,"dependencies":["firebase_core"]},{"name":"device_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/device_info_plus-10.1.2/","native_build":true,"dependencies":[]},{"name":"firebase_auth","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_auth-5.3.1/","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_core-3.6.0/","native_build":true,"dependencies":[]},{"name":"firebase_messaging","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_messaging-15.1.3/","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_storage","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_storage-12.3.2/","native_build":true,"dependencies":["firebase_core"]},{"name":"flutter_timezone","path":"/home/mayank/.pub-cache/hosted/pub.dev/flutter_timezone-3.0.1/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/package_info_plus-8.0.2/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/home/mayank/.pub-cache/hosted/pub.dev/shared_preferences_android-2.3.3/","native_build":true,"dependencies":[]}],"macos":[{"name":"cloud_firestore","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_firestore-5.4.4/","native_build":true,"dependencies":["firebase_core"]},{"name":"cloud_functions","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_functions-5.1.3/","native_build":true,"dependencies":["firebase_core"]},{"name":"device_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/device_info_plus-10.1.2/","native_build":true,"dependencies":[]},{"name":"firebase_auth","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_auth-5.3.1/","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_core-3.6.0/","native_build":true,"dependencies":[]},{"name":"firebase_messaging","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_messaging-15.1.3/","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_storage","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_storage-12.3.2/","native_build":true,"dependencies":["firebase_core"]},{"name":"flutter_timezone","path":"/home/mayank/.pub-cache/hosted/pub.dev/flutter_timezone-3.0.1/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/package_info_plus-8.0.2/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/home/mayank/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/device_info_plus-10.1.2/","native_build":false,"dependencies":[]},{"name":"package_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/package_info_plus-8.0.2/","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"/home/mayank/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/home/mayank/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"cloud_firestore","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_firestore-5.4.4/","native_build":true,"dependencies":["firebase_core"]},{"name":"device_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/device_info_plus-10.1.2/","native_build":false,"dependencies":[]},{"name":"firebase_auth","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_auth-5.3.1/","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_core-3.6.0/","native_build":true,"dependencies":[]},{"name":"firebase_storage","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_storage-12.3.2/","native_build":true,"dependencies":["firebase_core"]},{"name":"flutter_timezone","path":"/home/mayank/.pub-cache/hosted/pub.dev/flutter_timezone-3.0.1/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/package_info_plus-8.0.2/","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"/home/mayank/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/home/mayank/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"cloud_firestore_web","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_firestore_web-4.3.2/","dependencies":["firebase_core_web"]},{"name":"cloud_functions_web","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_functions_web-4.10.2/","dependencies":["firebase_core_web"]},{"name":"device_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/device_info_plus-10.1.2/","dependencies":[]},{"name":"firebase_auth_web","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_auth_web-5.13.2/","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_core_web-2.18.1/","dependencies":[]},{"name":"firebase_messaging_web","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_messaging_web-3.9.2/","dependencies":["firebase_core_web"]},{"name":"firebase_storage_web","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_storage_web-3.10.2/","dependencies":["firebase_core_web"]},{"name":"flutter_timezone","path":"/home/mayank/.pub-cache/hosted/pub.dev/flutter_timezone-3.0.1/","dependencies":[]},{"name":"package_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/package_info_plus-8.0.2/","dependencies":[]},{"name":"shared_preferences_web","path":"/home/mayank/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/","dependencies":[]}]},"dependencyGraph":[{"name":"cloud_firestore","dependencies":["cloud_firestore_web","firebase_core"]},{"name":"cloud_firestore_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"cloud_functions","dependencies":["cloud_functions_web","firebase_core"]},{"name":"cloud_functions_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"device_info_plus","dependencies":[]},{"name":"firebase_auth","dependencies":["firebase_auth_web","firebase_core"]},{"name":"firebase_auth_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"firebase_messaging","dependencies":["firebase_core","firebase_messaging_web"]},{"name":"firebase_messaging_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_storage","dependencies":["firebase_core","firebase_storage_web"]},{"name":"firebase_storage_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"flutter_timezone","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2024-11-25 14:43:28.651480","version":"3.24.3","swift_package_manager_enabled":false} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"cloud_firestore","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_firestore-5.4.4/","native_build":true,"dependencies":["firebase_core"]},{"name":"cloud_functions","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_functions-5.1.3/","native_build":true,"dependencies":["firebase_core"]},{"name":"device_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/device_info_plus-10.1.2/","native_build":true,"dependencies":[]},{"name":"firebase_auth","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_auth-5.3.1/","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_core-3.6.0/","native_build":true,"dependencies":[]},{"name":"firebase_messaging","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_messaging-15.1.3/","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_storage","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_storage-12.3.2/","native_build":true,"dependencies":["firebase_core"]},{"name":"flutter_timezone","path":"/home/mayank/.pub-cache/hosted/pub.dev/flutter_timezone-3.0.1/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/package_info_plus-8.0.2/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/home/mayank/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"cloud_firestore","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_firestore-5.4.4/","native_build":true,"dependencies":["firebase_core"]},{"name":"cloud_functions","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_functions-5.1.3/","native_build":true,"dependencies":["firebase_core"]},{"name":"device_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/device_info_plus-10.1.2/","native_build":true,"dependencies":[]},{"name":"firebase_auth","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_auth-5.3.1/","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_core-3.6.0/","native_build":true,"dependencies":[]},{"name":"firebase_messaging","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_messaging-15.1.3/","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_storage","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_storage-12.3.2/","native_build":true,"dependencies":["firebase_core"]},{"name":"flutter_timezone","path":"/home/mayank/.pub-cache/hosted/pub.dev/flutter_timezone-3.0.1/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/package_info_plus-8.0.2/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/home/mayank/.pub-cache/hosted/pub.dev/shared_preferences_android-2.3.3/","native_build":true,"dependencies":[]}],"macos":[{"name":"cloud_firestore","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_firestore-5.4.4/","native_build":true,"dependencies":["firebase_core"]},{"name":"cloud_functions","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_functions-5.1.3/","native_build":true,"dependencies":["firebase_core"]},{"name":"device_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/device_info_plus-10.1.2/","native_build":true,"dependencies":[]},{"name":"firebase_auth","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_auth-5.3.1/","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_core-3.6.0/","native_build":true,"dependencies":[]},{"name":"firebase_messaging","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_messaging-15.1.3/","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_storage","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_storage-12.3.2/","native_build":true,"dependencies":["firebase_core"]},{"name":"flutter_timezone","path":"/home/mayank/.pub-cache/hosted/pub.dev/flutter_timezone-3.0.1/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/package_info_plus-8.0.2/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/home/mayank/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.5.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/device_info_plus-10.1.2/","native_build":false,"dependencies":[]},{"name":"package_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/package_info_plus-8.0.2/","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"/home/mayank/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/home/mayank/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.4.1/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"cloud_firestore","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_firestore-5.4.4/","native_build":true,"dependencies":["firebase_core"]},{"name":"device_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/device_info_plus-10.1.2/","native_build":false,"dependencies":[]},{"name":"firebase_auth","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_auth-5.3.1/","native_build":true,"dependencies":["firebase_core"]},{"name":"firebase_core","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_core-3.6.0/","native_build":true,"dependencies":[]},{"name":"firebase_storage","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_storage-12.3.2/","native_build":true,"dependencies":["firebase_core"]},{"name":"flutter_timezone","path":"/home/mayank/.pub-cache/hosted/pub.dev/flutter_timezone-3.0.1/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/package_info_plus-8.0.2/","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"/home/mayank/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/home/mayank/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.4.1/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"cloud_firestore_web","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_firestore_web-4.3.2/","dependencies":["firebase_core_web"]},{"name":"cloud_functions_web","path":"/home/mayank/.pub-cache/hosted/pub.dev/cloud_functions_web-4.10.2/","dependencies":["firebase_core_web"]},{"name":"device_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/device_info_plus-10.1.2/","dependencies":[]},{"name":"firebase_auth_web","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_auth_web-5.13.2/","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_core_web-2.18.1/","dependencies":[]},{"name":"firebase_messaging_web","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_messaging_web-3.9.2/","dependencies":["firebase_core_web"]},{"name":"firebase_storage_web","path":"/home/mayank/.pub-cache/hosted/pub.dev/firebase_storage_web-3.10.2/","dependencies":["firebase_core_web"]},{"name":"flutter_timezone","path":"/home/mayank/.pub-cache/hosted/pub.dev/flutter_timezone-3.0.1/","dependencies":[]},{"name":"package_info_plus","path":"/home/mayank/.pub-cache/hosted/pub.dev/package_info_plus-8.0.2/","dependencies":[]},{"name":"shared_preferences_web","path":"/home/mayank/.pub-cache/hosted/pub.dev/shared_preferences_web-2.4.2/","dependencies":[]}]},"dependencyGraph":[{"name":"cloud_firestore","dependencies":["cloud_firestore_web","firebase_core"]},{"name":"cloud_firestore_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"cloud_functions","dependencies":["cloud_functions_web","firebase_core"]},{"name":"cloud_functions_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"device_info_plus","dependencies":[]},{"name":"firebase_auth","dependencies":["firebase_auth_web","firebase_core"]},{"name":"firebase_auth_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_core","dependencies":["firebase_core_web"]},{"name":"firebase_core_web","dependencies":[]},{"name":"firebase_messaging","dependencies":["firebase_core","firebase_messaging_web"]},{"name":"firebase_messaging_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"firebase_storage","dependencies":["firebase_core","firebase_storage_web"]},{"name":"firebase_storage_web","dependencies":["firebase_core","firebase_core_web"]},{"name":"flutter_timezone","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2024-12-17 11:49:20.127177","version":"3.27.0","swift_package_manager_enabled":false} \ No newline at end of file diff --git a/data/lib/extensions/list_extensions.dart b/data/lib/extensions/list_extensions.dart index 88774e69..285dae92 100644 --- a/data/lib/extensions/list_extensions.dart +++ b/data/lib/extensions/list_extensions.dart @@ -1,5 +1,5 @@ extension ListExtension on List { - ///Update the element at any position; it will return the same list if the element is not found. + // Update the element at any position; it will return the same list if the element is not found. List updateWhere({ required bool Function(E element) where, required E Function(E oldElement) updated, @@ -17,10 +17,10 @@ extension ListExtension on List { return newList; } - /// This converts a list into a list of lists, using the specified size. - /// For example: - /// List numbers = List.generate(100, (index) => index + 1); - /// List> result = numbers.chunked(5); + // This converts a list into a list of lists, using the specified size. + // For example: + // List numbers = List.generate(100, (index) => index + 1); + // List> result = numbers.chunked(5); List> chunked(int size) { return List.generate((length / size).ceil(), (index) { final int start = index * size; diff --git a/data/lib/service/user/user_service.dart b/data/lib/service/user/user_service.dart index 526254a9..760c1bc2 100644 --- a/data/lib/service/user/user_service.dart +++ b/data/lib/service/user/user_service.dart @@ -1,8 +1,6 @@ import 'package:cloud_firestore/cloud_firestore.dart'; -import 'package:http/http.dart' as http; import '../../errors/app_error.dart'; import '../../extensions/list_extensions.dart'; -import '../../api/network/client.dart'; import '../device/device_service.dart'; import '../../utils/constant/firestore_constant.dart'; import '../../utils/dummy_deactivated_account.dart'; @@ -10,13 +8,11 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../api/user/user_models.dart'; import '../../storage/app_preferences.dart'; -import 'user_endpoint.dart'; final userServiceProvider = Provider((ref) { final service = UserService( ref.read(currentUserPod), FirebaseFirestore.instance, - ref.read(httpProvider), ref.read(deviceServiceProvider), ); @@ -28,13 +24,11 @@ class UserService { UserModel? _currentUser; final FirebaseFirestore firestore; - final http.Client client; final DeviceService deviceService; UserService( this._currentUser, this.firestore, - this.client, this.deviceService, ); @@ -104,20 +98,6 @@ class UserService { } } - Future getUserByPhoneNumber(String number) async { - try { - final snapshot = - await _userRef.where(FireStoreConst.phone, isEqualTo: number).get(); - if (snapshot.docs.isNotEmpty) { - return snapshot.docs.first.data(); - } else { - return null; - } - } catch (error, stack) { - throw AppError.fromError(error, stack); - } - } - Future> getUsersByIds(List ids) async { final List users = []; try { @@ -175,24 +155,6 @@ class UserService { } } - Future createNewUser( - String phoneNumber, - String displayName, - ) async { - try { - final response = await client.req( - CreateUserEndpoint( - name: displayName, - phone: phoneNumber, - ), - ); - - return UserModel.fromJson(response.data); - } catch (error, stack) { - throw AppError.fromError(error, stack); - } - } - Future updateUser(UserModel user) async { try { final userRef = _userRef.doc(user.id); diff --git a/khelo/.gitignore b/khelo/.gitignore index fdd92677..c52e741a 100644 --- a/khelo/.gitignore +++ b/khelo/.gitignore @@ -5,9 +5,11 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ migrate_working_dir/ # IntelliJ related diff --git a/khelo/android/app/src/main/AndroidManifest.xml b/khelo/android/app/src/main/AndroidManifest.xml index db9ec764..f3f96053 100644 --- a/khelo/android/app/src/main/AndroidManifest.xml +++ b/khelo/android/app/src/main/AndroidManifest.xml @@ -2,8 +2,6 @@ - - 11.0) - FirebaseAuthInterop (~> 11.0) @@ -1210,14 +1210,14 @@ PODS: - GoogleUtilities/Environment (~> 8.0) - GTMSessionFetcher/Core (~> 3.4) - RecaptchaInterop (~> 100.0) - - FirebaseAuthInterop (11.3.0) + - FirebaseAuthInterop (11.6.0) - FirebaseCore (11.2.0): - FirebaseCoreInternal (~> 11.0) - GoogleUtilities/Environment (~> 8.0) - GoogleUtilities/Logger (~> 8.0) - - FirebaseCoreExtension (11.3.0): + - FirebaseCoreExtension (11.4.1): - FirebaseCore (~> 11.0) - - FirebaseCoreInternal (11.3.0): + - FirebaseCoreInternal (11.6.0): - "GoogleUtilities/NSData+zlib (~> 8.0)" - FirebaseCrashlytics (11.2.0): - FirebaseCore (~> 11.0) @@ -1256,7 +1256,7 @@ PODS: - FirebaseMessagingInterop (~> 11.0) - FirebaseSharedSwift (~> 11.0) - GTMSessionFetcher/Core (~> 3.4) - - FirebaseInstallations (11.3.0): + - FirebaseInstallations (11.4.0): - FirebaseCore (~> 11.0) - GoogleUtilities/Environment (~> 8.0) - GoogleUtilities/UserDefaults (~> 8.0) @@ -1270,8 +1270,8 @@ PODS: - GoogleUtilities/Reachability (~> 8.0) - GoogleUtilities/UserDefaults (~> 8.0) - nanopb (~> 3.30910.0) - - FirebaseMessagingInterop (11.3.0) - - FirebaseRemoteConfigInterop (11.3.0) + - FirebaseMessagingInterop (11.6.0) + - FirebaseRemoteConfigInterop (11.6.0) - FirebaseSessions (11.3.0): - FirebaseCore (~> 11.0) - FirebaseCoreExtension (~> 11.0) @@ -1281,7 +1281,7 @@ PODS: - GoogleUtilities/UserDefaults (~> 8.0) - nanopb (~> 3.30910.0) - PromisesSwift (~> 2.1) - - FirebaseSharedSwift (11.3.0) + - FirebaseSharedSwift (11.6.0) - FirebaseStorage (11.2.0): - FirebaseAppCheckInterop (~> 11.0) - FirebaseAuthInterop (~> 11.0) @@ -1290,8 +1290,6 @@ PODS: - GoogleUtilities/Environment (~> 8.0) - GTMSessionFetcher/Core (~> 3.4) - Flutter (1.0.0) - - flutter_contacts (0.0.1): - - Flutter - flutter_local_notifications (0.0.1): - Flutter - flutter_timezone (0.0.1): @@ -1422,7 +1420,7 @@ PODS: - TOCropViewController (~> 2.7.4) - image_picker_ios (0.0.1): - Flutter - - leveldb-library (1.22.5) + - leveldb-library (1.22.6) - MTBBarcodeScanner (5.0.11) - nanopb (3.30910.0): - nanopb/decode (= 3.30910.0) @@ -1466,7 +1464,6 @@ DEPENDENCIES: - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - firebase_storage (from `.symlinks/plugins/firebase_storage/ios`) - Flutter (from `Flutter`) - - flutter_contacts (from `.symlinks/plugins/flutter_contacts/ios`) - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - flutter_timezone (from `.symlinks/plugins/flutter_timezone/ios`) - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) @@ -1536,8 +1533,6 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/firebase_storage/ios" Flutter: :path: Flutter - flutter_contacts: - :path: ".symlinks/plugins/flutter_contacts/ios" flutter_local_notifications: :path: ".symlinks/plugins/flutter_local_notifications/ios" flutter_timezone: @@ -1577,25 +1572,24 @@ SPEC CHECKSUMS: firebase_crashlytics: 37d104d457b51760b48504a93a12b3bf70995d77 firebase_messaging: 15d114e1a41fc31e4fbabcd48d765a19eec94a38 firebase_storage: 61d62709bb4eda114cf68172f0dfde7ec23779ad - FirebaseAppCheckInterop: 7789a8adfb09e905ce02a76540b94b059029ea81 + FirebaseAppCheckInterop: 347aa09a805219a31249b58fc956888e9fcb314b FirebaseAuth: 2a198b8cdbbbd457f08d74df7040feb0a0e7777a - FirebaseAuthInterop: c453b7ba7c49b88b2f519bb8d2e29edf7ada4a2a + FirebaseAuthInterop: a919d415797d23b7bfe195a04f322b86c65020ef FirebaseCore: a282032ae9295c795714ded2ec9c522fc237f8da - FirebaseCoreExtension: 30bb063476ef66cd46925243d64ad8b2c8ac3264 - FirebaseCoreInternal: ac26d09a70c730e497936430af4e60fb0c68ec4e + FirebaseCoreExtension: f1bc67a4702931a7caa097d8e4ac0a1b0d16720e + FirebaseCoreInternal: d98ab91e2d80a56d7b246856a8885443b302c0c2 FirebaseCrashlytics: cfc69af5b53565dc6a5e563788809b5778ac4eac FirebaseFirestore: 62708adbc1dfcd6d165a7c0a202067b441912dc9 FirebaseFirestoreInternal: ad9b9ee2d3d430c8f31333a69b3b6737a7206232 FirebaseFunctions: 8ff3cb87f2c18fd564dddd4e5086a899392e1d07 - FirebaseInstallations: 58cf94dabf1e2bb2fa87725a9be5c2249171cda0 + FirebaseInstallations: 6ef4a1c7eb2a61ee1f74727d7f6ce2e72acf1414 FirebaseMessaging: c9ec7b90c399c7a6100297e9d16f8a27fc7f7152 - FirebaseMessagingInterop: 41f840551051fa9e5516b2f572c659e03a79e00d - FirebaseRemoteConfigInterop: c3a5c31b3c22079f41ba1dc645df889d9ce38cb9 + FirebaseMessagingInterop: d768073b71144b7bceadfec019d3dc49c743d53e + FirebaseRemoteConfigInterop: e75e348953352a000331eb77caf01e424248e176 FirebaseSessions: 655ff17f3cc1a635cbdc2d69b953878001f9e25b - FirebaseSharedSwift: d39c2ad64a11a8d936ce25a42b00df47078bb59c + FirebaseSharedSwift: a4e5dfca3e210633bb3a3dfb94176c019211948b FirebaseStorage: 9353f926690b2329957860abfcbc8b4074fe45e8 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 - flutter_contacts: edb1c5ce76aa433e20e6cb14c615f4c0b66e0983 flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086 flutter_timezone: ffb07bdad3c6276af8dada0f11978d8a1f8a20bb fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c @@ -1606,7 +1600,7 @@ SPEC CHECKSUMS: GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 image_cropper: 37d40f62177c101ff4c164906d259ea2c3aa70cf image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1 - leveldb-library: e8eadf9008a61f9e1dde3978c086d2b6d9b9dc28 + leveldb-library: cc8b8f8e013647a295ad3f8cd2ddf49a6f19be19 MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c @@ -1623,6 +1617,6 @@ SPEC CHECKSUMS: TOCropViewController: 80b8985ad794298fb69d3341de183f33d1853654 url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe -PODFILE CHECKSUM: 263bbdc4af357de40d8d908cfc1d29ff7d1f184b +PODFILE CHECKSUM: 080c4d0c0f64eaecad20947df573da50713d7bd0 COCOAPODS: 1.15.2 diff --git a/khelo/ios/Runner/Info.plist b/khelo/ios/Runner/Info.plist index 58913373..06cea328 100644 --- a/khelo/ios/Runner/Info.plist +++ b/khelo/ios/Runner/Info.plist @@ -46,8 +46,6 @@ Capture a new profile image using your device's camera for a personalized and up-to-date appearance. NSPhotoLibraryUsageDescription Select a profile image from your device's gallery to showcase your preferred photo in moments of your choice. - NSContactsUsageDescription - Sync and select contacts from your device to easily add team members and enhance collaboration. UIApplicationSupportsIndirectInputEvents UIBackgroundModes diff --git a/khelo/lib/ui/app_route.dart b/khelo/lib/ui/app_route.dart index 34a93ca3..e1b1abad 100644 --- a/khelo/lib/ui/app_route.dart +++ b/khelo/lib/ui/app_route.dart @@ -22,7 +22,6 @@ import 'package:khelo/ui/flow/settings/edit_profile/edit_profile_screen.dart'; import 'package:khelo/ui/flow/sign_in/phone_verification/phone_verification_screen.dart'; import 'package:khelo/ui/flow/team/add_team/add_team_screen.dart'; import 'package:khelo/ui/flow/team/add_team_member/add_team_member_screen.dart'; -import 'package:khelo/ui/flow/team/add_team_member/contact_selection/contact_selection_screen.dart'; import 'package:khelo/ui/flow/team/detail/make_admin/make_team_admin_screen.dart'; import 'package:khelo/ui/flow/team/detail/team_detail_screen.dart'; import 'package:khelo/ui/flow/team/scanner/scanner_screen.dart'; @@ -60,7 +59,6 @@ class AppRoute { static const pathMatchDetailTab = '/match-detail-tab'; static const pathSearchHome = "/search-home"; static const pathViewAll = "/view-all"; - static const pathContactSelection = "/contact-selection"; static const pathAddTournament = "/add-tournament"; static const pathTeamSelection = "/team-selection"; static const pathMatchSelection = "/match-selection"; @@ -341,10 +339,6 @@ class AppRoute { builder: (_) => QrCodeView(id: id, description: description), ); - static AppRoute contactSelection({required List memberIds}) => - AppRoute(pathContactSelection, - builder: (_) => ContactSelectionScreen(memberIds: memberIds)); - static final routes = [ GoRoute( path: main.path, @@ -437,10 +431,6 @@ class AppRoute { path: pathUserDetail, builder: (context, state) => state.widget(context), ), - GoRoute( - path: pathContactSelection, - builder: (context, state) => state.widget(context), - ), GoRoute( path: pathScannerScreen, builder: (context, state) => state.widget(context), diff --git a/khelo/lib/ui/flow/home/components/tournament_item.dart b/khelo/lib/ui/flow/home/components/tournament_item.dart index c4268371..bf2c8aeb 100644 --- a/khelo/lib/ui/flow/home/components/tournament_item.dart +++ b/khelo/lib/ui/flow/home/components/tournament_item.dart @@ -125,8 +125,8 @@ class _TournamentItemState extends State { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - dominant.withOpacity(0), - dominant.withOpacity(0.5), + dominant.withValues(alpha: 0), + dominant.withValues(alpha: 0.5), dominant, ], ), @@ -217,14 +217,17 @@ class _TournamentItemState extends State { if (dominant == context.colorScheme.primary) { return ( context.colorScheme.onPrimary, - context.colorScheme.onPrimary.withOpacity(0.8) + context.colorScheme.onPrimary.withValues(alpha: 0.8) ); } if (dominant.computeLuminance() < 0.5) { - return (Colors.white, Colors.white.withOpacity(0.8)); + return (Colors.white, Colors.white.withValues(alpha: 0.8)); } else { - return (Colors.black.withOpacity(0.87), Colors.black.withOpacity(0.6)); + return ( + Colors.black.withValues(alpha: 0.87), + Colors.black.withValues(alpha: 0.6) + ); } } } diff --git a/khelo/lib/ui/flow/matches/add_match/components/team_selection_view.dart b/khelo/lib/ui/flow/matches/add_match/components/team_selection_view.dart index e837830d..04e55f3b 100644 --- a/khelo/lib/ui/flow/matches/add_match/components/team_selection_view.dart +++ b/khelo/lib/ui/flow/matches/add_match/components/team_selection_view.dart @@ -94,7 +94,7 @@ class TeamSelectionView extends StatelessWidget { : context.colorScheme.alert), color: validSquad ? context.colorScheme.containerHigh - : context.colorScheme.alert.withOpacity(0.2), + : context.colorScheme.alert.withValues(alpha: 0.2), shape: BoxShape.circle, image: (team != null && team.profile_img_url != null) ? DecorationImage( diff --git a/khelo/lib/ui/flow/profile/components/complete_profile_progress.dart b/khelo/lib/ui/flow/profile/components/complete_profile_progress.dart index c2b02e69..755f0225 100644 --- a/khelo/lib/ui/flow/profile/components/complete_profile_progress.dart +++ b/khelo/lib/ui/flow/profile/components/complete_profile_progress.dart @@ -25,7 +25,9 @@ class _CompleteProfileProgressState widget.user?.gender != null && widget.user?.player_role != null && widget.user?.batting_style != null && - widget.user?.bowling_style != null) return const SizedBox(); + widget.user?.bowling_style != null) { + return const SizedBox(); + } return OnTapScale( onTap: () => AppRoute.editProfile().push(context), diff --git a/khelo/lib/ui/flow/settings/support/contact_support_view_model.dart b/khelo/lib/ui/flow/settings/support/contact_support_view_model.dart index 105dcf48..bcdbdaf6 100644 --- a/khelo/lib/ui/flow/settings/support/contact_support_view_model.dart +++ b/khelo/lib/ui/flow/settings/support/contact_support_view_model.dart @@ -147,8 +147,7 @@ class ContactSupportViewStateNotifier id: _supportService.generateSupportId, title: state.titleController.text.trim(), description: state.descriptionController.text.trim(), - attachmentUrls: - state.attachments.map((e) => e.url).whereNotNull().toList(), + attachmentUrls: state.attachments.map((e) => e.url).nonNulls.toList(), userId: _currentUserId ?? '', createdAt: DateTime.now(), createdTime: DateTime.now(), diff --git a/khelo/lib/ui/flow/team/add_team_member/add_team_member_screen.dart b/khelo/lib/ui/flow/team/add_team_member/add_team_member_screen.dart index 5f14b0ee..0bc3f4d8 100644 --- a/khelo/lib/ui/flow/team/add_team_member/add_team_member_screen.dart +++ b/khelo/lib/ui/flow/team/add_team_member/add_team_member_screen.dart @@ -1,6 +1,5 @@ import 'package:data/api/team/team_model.dart'; import 'package:data/api/user/user_models.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -107,20 +106,14 @@ class _AddTeamMemberScreenState extends ConsumerState { return Padding( padding: context.mediaQueryPadding + const EdgeInsets.symmetric(vertical: 8), - child: Stack( - alignment: Alignment.bottomRight, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - _searchField(context, state), - if (state.selectedUsers.isNotEmpty) ...[ - _selectedPlayerList(context, state), - ], - _searchedPlayerList(context, state), - ], - ), - _addViaContactButton(context), + _searchField(context, state), + if (state.selectedUsers.isNotEmpty) ...[ + _selectedPlayerList(context, state), + ], + _searchedPlayerList(context, state), ], ), ); @@ -281,48 +274,6 @@ class _AddTeamMemberScreenState extends ConsumerState { ); } - Widget _addViaContactButton(BuildContext context) { - return OnTapScale( - onTap: () async { - final user = - await AppRoute.contactSelection(memberIds: notifier.getMemberIds()) - .push(context); - if (context.mounted && user != null) { - notifier.selectUser(user); - } - }, - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), - margin: const EdgeInsets.symmetric(horizontal: 16), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(30), - color: context.colorScheme.containerLowOnSurface, - ), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Icon( - CupertinoIcons.add, - size: 18, - weight: 24, - color: context.colorScheme.textPrimary, - ), - const SizedBox(width: 8), - Flexible( - child: Text( - context.l10n.add_team_player_add_via_contact_title, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: AppTextStyle.button - .copyWith(color: context.colorScheme.textPrimary), - ), - ) - ], - ), - ), - ); - } - Widget _crossIcon(BuildContext context) { return Container( height: 24, diff --git a/khelo/lib/ui/flow/team/add_team_member/confirm_number_sheet/confirm_number_sheet.dart b/khelo/lib/ui/flow/team/add_team_member/confirm_number_sheet/confirm_number_sheet.dart deleted file mode 100644 index 09473de9..00000000 --- a/khelo/lib/ui/flow/team/add_team_member/confirm_number_sheet/confirm_number_sheet.dart +++ /dev/null @@ -1,211 +0,0 @@ -import 'package:canopas_country_picker/canopas_country_picker.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:go_router/go_router.dart'; -import 'package:khelo/components/country_code_view.dart'; -import 'package:khelo/domain/extensions/context_extensions.dart'; -import 'package:khelo/domain/extensions/widget_extension.dart'; -import 'package:style/button/primary_button.dart'; -import 'package:style/extensions/context_extensions.dart'; -import 'package:style/text/app_text_field.dart'; -import 'package:style/text/app_text_style.dart'; - -import 'confirm_number_view_model.dart'; - -class ConfirmNumberSheet extends ConsumerStatefulWidget { - final CountryCode? code; - final String? defaultNumber; - final bool isForCreateUser; - - static Future show( - BuildContext context, { - CountryCode? code, - String? defaultNumber, - bool isForCreateUser = false, - }) { - HapticFeedback.mediumImpact(); - return showModalBottomSheet( - context: context, - isScrollControlled: true, - enableDrag: false, - showDragHandle: true, - useRootNavigator: true, - backgroundColor: context.colorScheme.surface, - builder: (context) { - return Padding( - padding: - EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), - child: ConfirmNumberSheet( - code: code, - defaultNumber: defaultNumber, - isForCreateUser: isForCreateUser, - ), - ); - }, - ); - } - - const ConfirmNumberSheet({ - super.key, - this.code, - this.defaultNumber, - this.isForCreateUser = false, - }); - - @override - ConsumerState createState() => _ConfirmNumberSheetState(); -} - -class _ConfirmNumberSheetState extends ConsumerState { - late ConfirmNumberViewNotifier notifier; - - @override - void initState() { - notifier = ref.read(confirmNumberStateProvider.notifier); - runPostFrame(() => notifier.setData( - widget.code, widget.defaultNumber, widget.isForCreateUser)); - super.initState(); - } - - @override - Widget build(BuildContext context) { - final state = ref.watch(confirmNumberStateProvider); - - _observeIsPop(state); - - return Container( - padding: context.mediaQueryPadding + - const EdgeInsets.only(bottom: 24, left: 16, right: 16), - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Text( - state.isForCreateUser - ? context.l10n.confirm_number_add_user_manually_title - : context.l10n.confirm_number_confirm_phone_title, - style: AppTextStyle.header3 - .copyWith(color: context.colorScheme.textPrimary), - ), - const SizedBox(height: 24), - if (state.isForCreateUser) ...[ - AppTextField( - controller: state.nameController, - autoFocus: true, - style: AppTextStyle.subtitle3.copyWith( - color: context.colorScheme.textPrimary, - ), - hintStyle: AppTextStyle.subtitle3.copyWith( - color: context.colorScheme.textDisabled, - ), - hintText: context.l10n.confirm_number_name_title, - backgroundColor: context.colorScheme.containerLowOnSurface, - borderRadius: BorderRadius.circular(30), - borderType: AppTextFieldBorderType.outline, - borderColor: BorderColor( - focusColor: Colors.transparent, - unFocusColor: Colors.transparent), - onChanged: (_) => notifier.onTextChange(), - contentPadding: const EdgeInsets.symmetric(horizontal: 16), - onTapOutside: (event) => - FocusManager.instance.primaryFocus?.unfocus(), - ), - const SizedBox(height: 24), - ], - _phoneInputField(context, state), - const SizedBox(height: 40), - PrimaryButton( - context.l10n.confirm_number_confirm_title, - enabled: state.isButtonEnable, - onPressed: notifier.onConfirmTap, - ), - ], - ), - ), - ); - } - - Widget _phoneInputField( - BuildContext context, - ConfirmNumberViewState state, - ) { - return MediaQuery.withNoTextScaling( - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CountryCodeView( - countryCode: state.code, - onCodeChange: notifier.onCodeChange, - ), - const SizedBox(width: 8), - Expanded( - child: AppTextField( - controller: state.phoneController, - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.digitsOnly, - ], - style: AppTextStyle.header2.copyWith( - color: context.colorScheme.textSecondary, - ), - hintStyle: AppTextStyle.header2.copyWith( - color: context.colorScheme.outline, - ), - hintText: context.l10n.sign_in_phone_number_placeholder, - backgroundColor: context.colorScheme.containerLowOnSurface, - borderRadius: BorderRadius.circular(40), - borderType: AppTextFieldBorderType.outline, - borderColor: BorderColor( - focusColor: Colors.transparent, - unFocusColor: Colors.transparent), - prefixIcon: _inputFieldPrefix(context, state), - prefixIconConstraints: const BoxConstraints.tightFor(), - onChanged: (_) => notifier.onTextChange(), - onSubmitted: (_) => notifier.onConfirmTap(), - onTapOutside: (event) => - FocusManager.instance.primaryFocus?.unfocus(), - ), - ), - ], - ), - ); - } - - Widget _inputFieldPrefix( - BuildContext context, - ConfirmNumberViewState state, - ) { - return Padding( - padding: const EdgeInsets.only(left: 12.0), - child: IntrinsicHeight( - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - state.code.dialCode, - style: AppTextStyle.header2 - .copyWith(color: context.colorScheme.textPrimary), - ), - VerticalDivider( - width: 24, - color: context.colorScheme.outline, - ), - ], - ), - ), - ); - } - - void _observeIsPop(ConfirmNumberViewState state) { - ref.listen(confirmNumberStateProvider.select((value) => value.isPop), - (previous, next) { - if (next == true && context.mounted) { - String name = state.nameController.text; - String number = state.phoneController.text; - context.pop((name, state.code, number)); - } - }); - } -} diff --git a/khelo/lib/ui/flow/team/add_team_member/confirm_number_sheet/confirm_number_view_model.dart b/khelo/lib/ui/flow/team/add_team_member/confirm_number_sheet/confirm_number_view_model.dart deleted file mode 100644 index bb7d03ff..00000000 --- a/khelo/lib/ui/flow/team/add_team_member/confirm_number_sheet/confirm_number_view_model.dart +++ /dev/null @@ -1,69 +0,0 @@ -import 'package:canopas_country_picker/canopas_country_picker.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'confirm_number_view_model.freezed.dart'; - -final confirmNumberStateProvider = StateNotifierProvider.autoDispose< - ConfirmNumberViewNotifier, ConfirmNumberViewState>((ref) { - return ConfirmNumberViewNotifier(); -}); - -class ConfirmNumberViewNotifier extends StateNotifier { - ConfirmNumberViewNotifier() - : super(ConfirmNumberViewState( - phoneController: TextEditingController(), - nameController: TextEditingController(), - code: CountryCode.getCountryCodeByAlpha2( - countryAlpha2Code: - WidgetsBinding.instance.platformDispatcher.locale.countryCode, - ), - )); - - void setData( - CountryCode? code, - String? defaultNumber, - bool isForCreateUser, - ) { - state.phoneController.text = defaultNumber ?? ''; - state = state.copyWith( - isForCreateUser: isForCreateUser, code: code ?? state.code); - onTextChange(); - } - - void onCodeChange(CountryCode code) { - state = state.copyWith(code: code); - } - - void onTextChange() { - final isNameNotEmpty = state.isForCreateUser - ? state.nameController.text.trim().isNotEmpty - : true; - final isPhoneNotEmpty = state.phoneController.text.trim().length > 3; - state = state.copyWith(isButtonEnable: isNameNotEmpty && isPhoneNotEmpty); - } - - void onConfirmTap() { - state = state.copyWith(isPop: true); - } - - @override - void dispose() { - state.nameController.dispose(); - state.phoneController.dispose(); - super.dispose(); - } -} - -@freezed -class ConfirmNumberViewState with _$ConfirmNumberViewState { - const factory ConfirmNumberViewState({ - required TextEditingController phoneController, - required TextEditingController nameController, - required CountryCode code, - @Default(false) bool isButtonEnable, - @Default(false) bool isForCreateUser, - @Default(false) bool isPop, - }) = _ConfirmNumberViewState; -} diff --git a/khelo/lib/ui/flow/team/add_team_member/confirm_number_sheet/confirm_number_view_model.freezed.dart b/khelo/lib/ui/flow/team/add_team_member/confirm_number_sheet/confirm_number_view_model.freezed.dart deleted file mode 100644 index 1d169e39..00000000 --- a/khelo/lib/ui/flow/team/add_team_member/confirm_number_sheet/confirm_number_view_model.freezed.dart +++ /dev/null @@ -1,262 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'confirm_number_view_model.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -/// @nodoc -mixin _$ConfirmNumberViewState { - TextEditingController get phoneController => - throw _privateConstructorUsedError; - TextEditingController get nameController => - throw _privateConstructorUsedError; - CountryCode get code => throw _privateConstructorUsedError; - bool get isButtonEnable => throw _privateConstructorUsedError; - bool get isForCreateUser => throw _privateConstructorUsedError; - bool get isPop => throw _privateConstructorUsedError; - - /// Create a copy of ConfirmNumberViewState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ConfirmNumberViewStateCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $ConfirmNumberViewStateCopyWith<$Res> { - factory $ConfirmNumberViewStateCopyWith(ConfirmNumberViewState value, - $Res Function(ConfirmNumberViewState) then) = - _$ConfirmNumberViewStateCopyWithImpl<$Res, ConfirmNumberViewState>; - @useResult - $Res call( - {TextEditingController phoneController, - TextEditingController nameController, - CountryCode code, - bool isButtonEnable, - bool isForCreateUser, - bool isPop}); -} - -/// @nodoc -class _$ConfirmNumberViewStateCopyWithImpl<$Res, - $Val extends ConfirmNumberViewState> - implements $ConfirmNumberViewStateCopyWith<$Res> { - _$ConfirmNumberViewStateCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ConfirmNumberViewState - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? phoneController = null, - Object? nameController = null, - Object? code = null, - Object? isButtonEnable = null, - Object? isForCreateUser = null, - Object? isPop = null, - }) { - return _then(_value.copyWith( - phoneController: null == phoneController - ? _value.phoneController - : phoneController // ignore: cast_nullable_to_non_nullable - as TextEditingController, - nameController: null == nameController - ? _value.nameController - : nameController // ignore: cast_nullable_to_non_nullable - as TextEditingController, - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as CountryCode, - isButtonEnable: null == isButtonEnable - ? _value.isButtonEnable - : isButtonEnable // ignore: cast_nullable_to_non_nullable - as bool, - isForCreateUser: null == isForCreateUser - ? _value.isForCreateUser - : isForCreateUser // ignore: cast_nullable_to_non_nullable - as bool, - isPop: null == isPop - ? _value.isPop - : isPop // ignore: cast_nullable_to_non_nullable - as bool, - ) as $Val); - } -} - -/// @nodoc -abstract class _$$ConfirmNumberViewStateImplCopyWith<$Res> - implements $ConfirmNumberViewStateCopyWith<$Res> { - factory _$$ConfirmNumberViewStateImplCopyWith( - _$ConfirmNumberViewStateImpl value, - $Res Function(_$ConfirmNumberViewStateImpl) then) = - __$$ConfirmNumberViewStateImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {TextEditingController phoneController, - TextEditingController nameController, - CountryCode code, - bool isButtonEnable, - bool isForCreateUser, - bool isPop}); -} - -/// @nodoc -class __$$ConfirmNumberViewStateImplCopyWithImpl<$Res> - extends _$ConfirmNumberViewStateCopyWithImpl<$Res, - _$ConfirmNumberViewStateImpl> - implements _$$ConfirmNumberViewStateImplCopyWith<$Res> { - __$$ConfirmNumberViewStateImplCopyWithImpl( - _$ConfirmNumberViewStateImpl _value, - $Res Function(_$ConfirmNumberViewStateImpl) _then) - : super(_value, _then); - - /// Create a copy of ConfirmNumberViewState - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? phoneController = null, - Object? nameController = null, - Object? code = null, - Object? isButtonEnable = null, - Object? isForCreateUser = null, - Object? isPop = null, - }) { - return _then(_$ConfirmNumberViewStateImpl( - phoneController: null == phoneController - ? _value.phoneController - : phoneController // ignore: cast_nullable_to_non_nullable - as TextEditingController, - nameController: null == nameController - ? _value.nameController - : nameController // ignore: cast_nullable_to_non_nullable - as TextEditingController, - code: null == code - ? _value.code - : code // ignore: cast_nullable_to_non_nullable - as CountryCode, - isButtonEnable: null == isButtonEnable - ? _value.isButtonEnable - : isButtonEnable // ignore: cast_nullable_to_non_nullable - as bool, - isForCreateUser: null == isForCreateUser - ? _value.isForCreateUser - : isForCreateUser // ignore: cast_nullable_to_non_nullable - as bool, - isPop: null == isPop - ? _value.isPop - : isPop // ignore: cast_nullable_to_non_nullable - as bool, - )); - } -} - -/// @nodoc - -class _$ConfirmNumberViewStateImpl implements _ConfirmNumberViewState { - const _$ConfirmNumberViewStateImpl( - {required this.phoneController, - required this.nameController, - required this.code, - this.isButtonEnable = false, - this.isForCreateUser = false, - this.isPop = false}); - - @override - final TextEditingController phoneController; - @override - final TextEditingController nameController; - @override - final CountryCode code; - @override - @JsonKey() - final bool isButtonEnable; - @override - @JsonKey() - final bool isForCreateUser; - @override - @JsonKey() - final bool isPop; - - @override - String toString() { - return 'ConfirmNumberViewState(phoneController: $phoneController, nameController: $nameController, code: $code, isButtonEnable: $isButtonEnable, isForCreateUser: $isForCreateUser, isPop: $isPop)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ConfirmNumberViewStateImpl && - (identical(other.phoneController, phoneController) || - other.phoneController == phoneController) && - (identical(other.nameController, nameController) || - other.nameController == nameController) && - (identical(other.code, code) || other.code == code) && - (identical(other.isButtonEnable, isButtonEnable) || - other.isButtonEnable == isButtonEnable) && - (identical(other.isForCreateUser, isForCreateUser) || - other.isForCreateUser == isForCreateUser) && - (identical(other.isPop, isPop) || other.isPop == isPop)); - } - - @override - int get hashCode => Object.hash(runtimeType, phoneController, nameController, - code, isButtonEnable, isForCreateUser, isPop); - - /// Create a copy of ConfirmNumberViewState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ConfirmNumberViewStateImplCopyWith<_$ConfirmNumberViewStateImpl> - get copyWith => __$$ConfirmNumberViewStateImplCopyWithImpl< - _$ConfirmNumberViewStateImpl>(this, _$identity); -} - -abstract class _ConfirmNumberViewState implements ConfirmNumberViewState { - const factory _ConfirmNumberViewState( - {required final TextEditingController phoneController, - required final TextEditingController nameController, - required final CountryCode code, - final bool isButtonEnable, - final bool isForCreateUser, - final bool isPop}) = _$ConfirmNumberViewStateImpl; - - @override - TextEditingController get phoneController; - @override - TextEditingController get nameController; - @override - CountryCode get code; - @override - bool get isButtonEnable; - @override - bool get isForCreateUser; - @override - bool get isPop; - - /// Create a copy of ConfirmNumberViewState - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ConfirmNumberViewStateImplCopyWith<_$ConfirmNumberViewStateImpl> - get copyWith => throw _privateConstructorUsedError; -} diff --git a/khelo/lib/ui/flow/team/add_team_member/contact_selection/contact_selection_screen.dart b/khelo/lib/ui/flow/team/add_team_member/contact_selection/contact_selection_screen.dart deleted file mode 100644 index aa75aa40..00000000 --- a/khelo/lib/ui/flow/team/add_team_member/contact_selection/contact_selection_screen.dart +++ /dev/null @@ -1,326 +0,0 @@ -import 'dart:typed_data'; - -import 'package:canopas_country_picker/canopas_country_picker.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_contacts/contact.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:go_router/go_router.dart'; -import 'package:khelo/components/app_page.dart'; -import 'package:khelo/components/empty_screen.dart'; -import 'package:khelo/components/error_screen.dart'; -import 'package:khelo/domain/extensions/context_extensions.dart'; -import 'package:khelo/domain/extensions/widget_extension.dart'; -import 'package:khelo/ui/flow/team/add_team_member/confirm_number_sheet/confirm_number_sheet.dart'; -import 'package:khelo/ui/flow/team/add_team_member/contact_selection/contact_selection_view_model.dart'; -import 'package:permission_handler/permission_handler.dart'; -import 'package:style/animations/on_tap_scale.dart'; -import 'package:style/button/action_button.dart'; -import 'package:style/button/secondary_button.dart'; -import 'package:style/extensions/context_extensions.dart'; -import 'package:style/indicator/progress_indicator.dart'; -import 'package:style/text/app_text_style.dart'; - -import '../../../../../components/error_snackbar.dart'; - -class ContactSelectionScreen extends ConsumerStatefulWidget { - final List memberIds; - - const ContactSelectionScreen({super.key, required this.memberIds}); - - @override - ConsumerState createState() => _ContactSelectionScreenState(); -} - -class _ContactSelectionScreenState - extends ConsumerState { - late ContactSelectionViewNotifier notifier; - - @override - void initState() { - notifier = ref.read(contactSelectionStateProvider.notifier); - runPostFrame(() => notifier.setData(widget.memberIds)); - super.initState(); - } - - @override - Widget build(BuildContext context) { - final state = ref.watch(contactSelectionStateProvider); - - _observeActionError(); - _observeAlreadyAdded(); - _observeSelectedUser(); - - return AppPage( - title: context.l10n.contact_selection_contact_title, - actions: [ - (state.isActionInProgress) - ? const Padding( - padding: EdgeInsets.only(right: 16.0), - child: AppProgressIndicator( - size: AppProgressIndicatorSize.small, - ), - ) - : actionButton( - context, - icon: Icon( - Icons.add, - color: context.colorScheme.textPrimary, - ), - onPressed: () async { - final confirmedNumber = await ConfirmNumberSheet.show< - (String, CountryCode, String)>( - context, - code: CountryCode.getCountryCodeByAlpha2( - countryAlpha2Code: state.deviceCountryCode, - ), - isForCreateUser: true, - ); - if (context.mounted && confirmedNumber != null) { - notifier.getUserByPhoneNumber( - confirmedNumber.$1, - "${confirmedNumber.$2.dialCode} ${confirmedNumber.$3}", - ); - } - }, - ), - ], - body: Builder( - builder: (context) => Padding( - padding: context.mediaQueryPadding, - child: _body(context, state), - )), - ); - } - - Widget _body(BuildContext context, ContactSelectionState state) { - if (state.loading) { - return const Center( - child: AppProgressIndicator(), - ); - } - - if (state.error != null) { - return ErrorScreen( - error: state.error, - onRetryTap: notifier.fetchContacts, - ); - } - if (state.contacts.isEmpty && state.hasContactPermission) { - return EmptyScreen( - title: context.l10n.contact_selection_empty_contact, - description: context.l10n.contact_selection_empty_contact_description, - isShowButton: false, - ); - } - - if (!state.hasContactPermission) { - return EmptyScreen( - title: context.l10n.contact_selection_access_permission, - description: - context.l10n.contact_selection_access_permission_description, - buttonTitle: context.l10n.contact_selection_allow_title, - onTap: () => _requestContactPermission(context), - ); - } - - return ListView.separated( - itemCount: state.contacts.length, - padding: const EdgeInsets.symmetric(vertical: 16), - separatorBuilder: (context, index) => Divider( - color: context.colorScheme.outline, - height: 32, - ), - itemBuilder: (context, index) { - final contact = state.contacts.elementAt(index); - return _contactCellView(context, state.isActionInProgress, contact); - }, - ); - } - - Widget _contactCellView( - BuildContext context, - bool isActionInProgress, - Contact contact, - ) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: Row( - children: [ - _profileImageView( - context, - contact.thumbnail, - contact.displayName.characters.firstOrNull, - ), - const SizedBox(width: 16), - Expanded( - child: Text( - contact.displayName, - style: AppTextStyle.subtitle2 - .copyWith(color: context.colorScheme.textPrimary), - ), - ), - const SizedBox(width: 4), - SecondaryButton( - context.l10n.common_add_title, - enabled: contact.phones.isNotEmpty && !isActionInProgress, - onPressed: () async { - if (contact.phones.isEmpty) { - return; - } - if (contact.phones.length > 1) { - _showSelectNumberDialog(context, contact); - } else { - final firstNumber = contact.phones.first.number; - if (firstNumber.isNotEmpty) { - showConfirmNumberSheet( - context, contact.displayName, firstNumber); - } - } - }, - ), - ], - ), - ); - } - - Future _showSelectNumberDialog( - BuildContext context, - Contact contact, - ) async { - final number = await showAdaptiveDialog( - context: context, - barrierDismissible: true, - builder: (context) => AlertDialog.adaptive( - content: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: contact.phones.map((e) { - final showDivider = contact.phones.lastOrNull != e; - if (e.number.isEmpty) return const SizedBox(); - - return OnTapScale( - onTap: () => context.pop(e.number), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - e.number, - style: AppTextStyle.subtitle3 - .copyWith(color: context.colorScheme.textPrimary), - ), - if (showDivider) - Divider( - height: 36, - color: context.colorScheme.outline, - ), - ], - ), - ); - }).toList(), - ), - ), - ), - ); - - if (context.mounted && number != null) { - showConfirmNumberSheet(context, contact.displayName, number); - } - } - - Future showConfirmNumberSheet( - BuildContext context, - String? displayName, - String phoneNumber, - ) async { - final (code, number) = notifier.getNormalisedNumber(phoneNumber); - final confirmedNumber = - await ConfirmNumberSheet.show<(String, CountryCode, String)>( - context, - code: code, - defaultNumber: number, - ); - if (context.mounted && confirmedNumber != null) { - notifier.getUserByPhoneNumber( - displayName, - "${confirmedNumber.$2.dialCode} ${confirmedNumber.$3}", - ); - } - } - - Widget _profileImageView( - BuildContext context, - Uint8List? image, - String? initial, - ) { - return Container( - height: 40, - width: 40, - alignment: Alignment.center, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: context.colorScheme.containerHigh, - image: image != null && image.isNotEmpty - ? DecorationImage(image: MemoryImage(image), fit: BoxFit.fill) - : null), - child: image != null && image.isNotEmpty - ? null - : Text( - initial ?? '?', - textScaler: TextScaler.noScaling, - style: AppTextStyle.subtitle1 - .copyWith(color: context.colorScheme.textPrimary), - ), - ); - } - - Future _requestContactPermission( - BuildContext context, - ) async { - final PermissionStatus status = await Permission.contacts.status; - - if (status == PermissionStatus.permanentlyDenied) { - openAppSettings(); - return; - } - - if (status == PermissionStatus.denied) { - await Permission.contacts.request(); - if (!context.mounted) return; - } - - notifier.checkContactPermission(requestIfNotGranted: false); - } - - void _observeActionError() { - ref.listen( - contactSelectionStateProvider.select((value) => value.actionError), - (previous, next) { - if (next != null) { - showErrorSnackBar(context: context, error: next); - } - }); - } - - void _observeAlreadyAdded() { - ref.listen( - contactSelectionStateProvider.select((value) => value.alreadyAdded), - (previous, next) { - if (next == true && context.mounted) { - showErrorSnackBar( - context: context, - error: context.l10n.add_team_member_already_added, - ); - } - }); - } - - void _observeSelectedUser() { - ref.listen( - contactSelectionStateProvider.select((value) => value.selectedUser), - (previous, next) { - if (next != null && context.mounted) { - context.pop(next); - } - }); - } -} diff --git a/khelo/lib/ui/flow/team/add_team_member/contact_selection/contact_selection_view_model.dart b/khelo/lib/ui/flow/team/add_team_member/contact_selection/contact_selection_view_model.dart deleted file mode 100644 index bcebfbb4..00000000 --- a/khelo/lib/ui/flow/team/add_team_member/contact_selection/contact_selection_view_model.dart +++ /dev/null @@ -1,177 +0,0 @@ -import 'package:canopas_country_picker/canopas_country_picker.dart'; -import 'package:collection/collection.dart'; -import 'package:data/api/user/user_models.dart'; -import 'package:data/service/device/device_service.dart'; -import 'package:data/service/user/user_service.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter_contacts/flutter_contacts.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:permission_handler/permission_handler.dart'; - -part 'contact_selection_view_model.freezed.dart'; - -final contactSelectionStateProvider = StateNotifierProvider.autoDispose< - ContactSelectionViewNotifier, ContactSelectionState>((ref) { - return ContactSelectionViewNotifier( - ref.read(userServiceProvider), - ref.read(deviceServiceProvider), - ); -}); - -class ContactSelectionViewNotifier - extends StateNotifier { - final UserService _userService; - final DeviceService _deviceService; - List _memberIds = []; - - ContactSelectionViewNotifier(this._userService, this._deviceService) - : super(ContactSelectionState( - deviceCountryCode: WidgetsBinding - .instance.platformDispatcher.locale.countryCode)) { - _fetchCountryCode(); - } - - void setData(List memberIds) { - _memberIds = memberIds; - checkContactPermission(); - } - - Future fetchContacts() async { - try { - state = state.copyWith(error: null, loading: true); - final fetchedContacts = await FlutterContacts.getContacts( - withProperties: true, - withThumbnail: true, - ); - state = state.copyWith(contacts: fetchedContacts, loading: false); - } catch (e) { - state = state.copyWith(loading: false, error: e); - debugPrint("ContactSelectionViewNotifier: Error getting contacts"); - } - } - - void _fetchCountryCode() async { - try { - final deviceCountryCode = await _deviceService.countryCode; - state = state.copyWith(deviceCountryCode: deviceCountryCode); - } catch (e) { - debugPrint( - "ContactSelectionViewNotifier: Error in fetchCountryCode -> $e"); - } - } - - void checkContactPermission({requestIfNotGranted = true}) async { - var status = await Permission.contacts.status; - if (requestIfNotGranted && - !status.isGranted && - status != PermissionStatus.permanentlyDenied) { - // Show initial permission prompt after 2 seconds - await Future.delayed(const Duration(seconds: 2)); - if (!mounted) return; - status = await Permission.contacts.request(); - } - - state = state.copyWith( - hasContactPermission: status.isGranted, - loading: false, - ); - - if (status.isGranted) { - fetchContacts(); - } - } - - Future getUserByPhoneNumber(String? name, String number) async { - state = state.copyWith(alreadyAdded: false, isActionInProgress: true); - try { - final user = await _userService.getUserByPhoneNumber(number); - if (user == null) { - _createUser(name, number); - } else if (_memberIds.contains(user.id)) { - state = state.copyWith(alreadyAdded: true, isActionInProgress: false); - } else { - state = state.copyWith(selectedUser: user, isActionInProgress: false); - } - } catch (e) { - state = state.copyWith(actionError: e, isActionInProgress: false); - debugPrint( - "ContactSelectionViewNotifier: Error getting user by phone number $e"); - } - } - - Future _createUser(String? name, String number) async { - if (name == null) { - state = state.copyWith(isActionInProgress: false); - return; - } - - try { - final user = await _userService.createNewUser(number, name); - state = state.copyWith(selectedUser: user, isActionInProgress: false); - } catch (e) { - state = state.copyWith(actionError: e, isActionInProgress: false); - debugPrint("ContactSelectionViewNotifier: Error creating new user $e"); - } - } - - (CountryCode, String) getNormalisedNumber(String phoneNumber) { - String? code; - if (phoneNumber.startsWith('+')) { - phoneNumber = _keepDigitAndPlusAtStart(phoneNumber); - - final matchedCountryCode = CountryCode.allCodes - .firstWhereOrNull( - (element) => phoneNumber.startsWith(element.dialCode)) - ?.dialCode; - code = matchedCountryCode ?? state.deviceCountryCode; - final trimFrom = matchedCountryCode != null ? code?.length : 1; - phoneNumber = phoneNumber.substring(trimFrom ?? 1); - } else { - phoneNumber = phoneNumber.replaceAll(RegExp(r'[^0-9]'), ''); - } - - CountryCode? countryCode; - if (code == null) { - countryCode = CountryCode.getCountryCodeByAlpha2( - countryAlpha2Code: state.deviceCountryCode, - ); - } else { - countryCode = CountryCode.getCountryCodeByDialCode(dialCode: code); - // handle default returned US code in case not found - if (countryCode.dialCode == "+1" && code != "+1") { - countryCode = CountryCode.getCountryCodeByAlpha2( - countryAlpha2Code: state.deviceCountryCode, - ); - } - } - return (countryCode, phoneNumber); - } -} - -String _keepDigitAndPlusAtStart(String input) { - String formatted = input.replaceAll(RegExp(r'[^+\d]'), ''); - - if (formatted.startsWith('+')) { - formatted = '+${formatted.replaceAll(RegExp(r'[^\d]'), '')}'; - } else { - formatted = formatted.replaceAll(RegExp(r'[^\d]'), ''); - } - - return formatted; -} - -@freezed -class ContactSelectionState with _$ContactSelectionState { - const factory ContactSelectionState({ - Object? error, - Object? actionError, - String? deviceCountryCode, - UserModel? selectedUser, - @Default(false) bool loading, - @Default(false) bool isActionInProgress, - @Default(false) bool alreadyAdded, - @Default(false) bool hasContactPermission, - @Default([]) List contacts, - }) = _ContactSelectionState; -} diff --git a/khelo/lib/ui/flow/team/add_team_member/contact_selection/contact_selection_view_model.freezed.dart b/khelo/lib/ui/flow/team/add_team_member/contact_selection/contact_selection_view_model.freezed.dart deleted file mode 100644 index 66cf049f..00000000 --- a/khelo/lib/ui/flow/team/add_team_member/contact_selection/contact_selection_view_model.freezed.dart +++ /dev/null @@ -1,345 +0,0 @@ -// coverage:ignore-file -// GENERATED CODE - DO NOT MODIFY BY HAND -// ignore_for_file: type=lint -// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark - -part of 'contact_selection_view_model.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -T _$identity(T value) => value; - -final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); - -/// @nodoc -mixin _$ContactSelectionState { - Object? get error => throw _privateConstructorUsedError; - Object? get actionError => throw _privateConstructorUsedError; - String? get deviceCountryCode => throw _privateConstructorUsedError; - UserModel? get selectedUser => throw _privateConstructorUsedError; - bool get loading => throw _privateConstructorUsedError; - bool get isActionInProgress => throw _privateConstructorUsedError; - bool get alreadyAdded => throw _privateConstructorUsedError; - bool get hasContactPermission => throw _privateConstructorUsedError; - List get contacts => throw _privateConstructorUsedError; - - /// Create a copy of ContactSelectionState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - $ContactSelectionStateCopyWith get copyWith => - throw _privateConstructorUsedError; -} - -/// @nodoc -abstract class $ContactSelectionStateCopyWith<$Res> { - factory $ContactSelectionStateCopyWith(ContactSelectionState value, - $Res Function(ContactSelectionState) then) = - _$ContactSelectionStateCopyWithImpl<$Res, ContactSelectionState>; - @useResult - $Res call( - {Object? error, - Object? actionError, - String? deviceCountryCode, - UserModel? selectedUser, - bool loading, - bool isActionInProgress, - bool alreadyAdded, - bool hasContactPermission, - List contacts}); - - $UserModelCopyWith<$Res>? get selectedUser; -} - -/// @nodoc -class _$ContactSelectionStateCopyWithImpl<$Res, - $Val extends ContactSelectionState> - implements $ContactSelectionStateCopyWith<$Res> { - _$ContactSelectionStateCopyWithImpl(this._value, this._then); - - // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; - - /// Create a copy of ContactSelectionState - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? error = freezed, - Object? actionError = freezed, - Object? deviceCountryCode = freezed, - Object? selectedUser = freezed, - Object? loading = null, - Object? isActionInProgress = null, - Object? alreadyAdded = null, - Object? hasContactPermission = null, - Object? contacts = null, - }) { - return _then(_value.copyWith( - error: freezed == error ? _value.error : error, - actionError: freezed == actionError ? _value.actionError : actionError, - deviceCountryCode: freezed == deviceCountryCode - ? _value.deviceCountryCode - : deviceCountryCode // ignore: cast_nullable_to_non_nullable - as String?, - selectedUser: freezed == selectedUser - ? _value.selectedUser - : selectedUser // ignore: cast_nullable_to_non_nullable - as UserModel?, - loading: null == loading - ? _value.loading - : loading // ignore: cast_nullable_to_non_nullable - as bool, - isActionInProgress: null == isActionInProgress - ? _value.isActionInProgress - : isActionInProgress // ignore: cast_nullable_to_non_nullable - as bool, - alreadyAdded: null == alreadyAdded - ? _value.alreadyAdded - : alreadyAdded // ignore: cast_nullable_to_non_nullable - as bool, - hasContactPermission: null == hasContactPermission - ? _value.hasContactPermission - : hasContactPermission // ignore: cast_nullable_to_non_nullable - as bool, - contacts: null == contacts - ? _value.contacts - : contacts // ignore: cast_nullable_to_non_nullable - as List, - ) as $Val); - } - - /// Create a copy of ContactSelectionState - /// with the given fields replaced by the non-null parameter values. - @override - @pragma('vm:prefer-inline') - $UserModelCopyWith<$Res>? get selectedUser { - if (_value.selectedUser == null) { - return null; - } - - return $UserModelCopyWith<$Res>(_value.selectedUser!, (value) { - return _then(_value.copyWith(selectedUser: value) as $Val); - }); - } -} - -/// @nodoc -abstract class _$$ContactSelectionStateImplCopyWith<$Res> - implements $ContactSelectionStateCopyWith<$Res> { - factory _$$ContactSelectionStateImplCopyWith( - _$ContactSelectionStateImpl value, - $Res Function(_$ContactSelectionStateImpl) then) = - __$$ContactSelectionStateImplCopyWithImpl<$Res>; - @override - @useResult - $Res call( - {Object? error, - Object? actionError, - String? deviceCountryCode, - UserModel? selectedUser, - bool loading, - bool isActionInProgress, - bool alreadyAdded, - bool hasContactPermission, - List contacts}); - - @override - $UserModelCopyWith<$Res>? get selectedUser; -} - -/// @nodoc -class __$$ContactSelectionStateImplCopyWithImpl<$Res> - extends _$ContactSelectionStateCopyWithImpl<$Res, - _$ContactSelectionStateImpl> - implements _$$ContactSelectionStateImplCopyWith<$Res> { - __$$ContactSelectionStateImplCopyWithImpl(_$ContactSelectionStateImpl _value, - $Res Function(_$ContactSelectionStateImpl) _then) - : super(_value, _then); - - /// Create a copy of ContactSelectionState - /// with the given fields replaced by the non-null parameter values. - @pragma('vm:prefer-inline') - @override - $Res call({ - Object? error = freezed, - Object? actionError = freezed, - Object? deviceCountryCode = freezed, - Object? selectedUser = freezed, - Object? loading = null, - Object? isActionInProgress = null, - Object? alreadyAdded = null, - Object? hasContactPermission = null, - Object? contacts = null, - }) { - return _then(_$ContactSelectionStateImpl( - error: freezed == error ? _value.error : error, - actionError: freezed == actionError ? _value.actionError : actionError, - deviceCountryCode: freezed == deviceCountryCode - ? _value.deviceCountryCode - : deviceCountryCode // ignore: cast_nullable_to_non_nullable - as String?, - selectedUser: freezed == selectedUser - ? _value.selectedUser - : selectedUser // ignore: cast_nullable_to_non_nullable - as UserModel?, - loading: null == loading - ? _value.loading - : loading // ignore: cast_nullable_to_non_nullable - as bool, - isActionInProgress: null == isActionInProgress - ? _value.isActionInProgress - : isActionInProgress // ignore: cast_nullable_to_non_nullable - as bool, - alreadyAdded: null == alreadyAdded - ? _value.alreadyAdded - : alreadyAdded // ignore: cast_nullable_to_non_nullable - as bool, - hasContactPermission: null == hasContactPermission - ? _value.hasContactPermission - : hasContactPermission // ignore: cast_nullable_to_non_nullable - as bool, - contacts: null == contacts - ? _value._contacts - : contacts // ignore: cast_nullable_to_non_nullable - as List, - )); - } -} - -/// @nodoc - -class _$ContactSelectionStateImpl implements _ContactSelectionState { - const _$ContactSelectionStateImpl( - {this.error, - this.actionError, - this.deviceCountryCode, - this.selectedUser, - this.loading = false, - this.isActionInProgress = false, - this.alreadyAdded = false, - this.hasContactPermission = false, - final List contacts = const []}) - : _contacts = contacts; - - @override - final Object? error; - @override - final Object? actionError; - @override - final String? deviceCountryCode; - @override - final UserModel? selectedUser; - @override - @JsonKey() - final bool loading; - @override - @JsonKey() - final bool isActionInProgress; - @override - @JsonKey() - final bool alreadyAdded; - @override - @JsonKey() - final bool hasContactPermission; - final List _contacts; - @override - @JsonKey() - List get contacts { - if (_contacts is EqualUnmodifiableListView) return _contacts; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_contacts); - } - - @override - String toString() { - return 'ContactSelectionState(error: $error, actionError: $actionError, deviceCountryCode: $deviceCountryCode, selectedUser: $selectedUser, loading: $loading, isActionInProgress: $isActionInProgress, alreadyAdded: $alreadyAdded, hasContactPermission: $hasContactPermission, contacts: $contacts)'; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$ContactSelectionStateImpl && - const DeepCollectionEquality().equals(other.error, error) && - const DeepCollectionEquality() - .equals(other.actionError, actionError) && - (identical(other.deviceCountryCode, deviceCountryCode) || - other.deviceCountryCode == deviceCountryCode) && - (identical(other.selectedUser, selectedUser) || - other.selectedUser == selectedUser) && - (identical(other.loading, loading) || other.loading == loading) && - (identical(other.isActionInProgress, isActionInProgress) || - other.isActionInProgress == isActionInProgress) && - (identical(other.alreadyAdded, alreadyAdded) || - other.alreadyAdded == alreadyAdded) && - (identical(other.hasContactPermission, hasContactPermission) || - other.hasContactPermission == hasContactPermission) && - const DeepCollectionEquality().equals(other._contacts, _contacts)); - } - - @override - int get hashCode => Object.hash( - runtimeType, - const DeepCollectionEquality().hash(error), - const DeepCollectionEquality().hash(actionError), - deviceCountryCode, - selectedUser, - loading, - isActionInProgress, - alreadyAdded, - hasContactPermission, - const DeepCollectionEquality().hash(_contacts)); - - /// Create a copy of ContactSelectionState - /// with the given fields replaced by the non-null parameter values. - @JsonKey(includeFromJson: false, includeToJson: false) - @override - @pragma('vm:prefer-inline') - _$$ContactSelectionStateImplCopyWith<_$ContactSelectionStateImpl> - get copyWith => __$$ContactSelectionStateImplCopyWithImpl< - _$ContactSelectionStateImpl>(this, _$identity); -} - -abstract class _ContactSelectionState implements ContactSelectionState { - const factory _ContactSelectionState( - {final Object? error, - final Object? actionError, - final String? deviceCountryCode, - final UserModel? selectedUser, - final bool loading, - final bool isActionInProgress, - final bool alreadyAdded, - final bool hasContactPermission, - final List contacts}) = _$ContactSelectionStateImpl; - - @override - Object? get error; - @override - Object? get actionError; - @override - String? get deviceCountryCode; - @override - UserModel? get selectedUser; - @override - bool get loading; - @override - bool get isActionInProgress; - @override - bool get alreadyAdded; - @override - bool get hasContactPermission; - @override - List get contacts; - - /// Create a copy of ContactSelectionState - /// with the given fields replaced by the non-null parameter values. - @override - @JsonKey(includeFromJson: false, includeToJson: false) - _$$ContactSelectionStateImplCopyWith<_$ContactSelectionStateImpl> - get copyWith => throw _privateConstructorUsedError; -} diff --git a/khelo/lib/ui/flow/team/scanner/scanner_screen.dart b/khelo/lib/ui/flow/team/scanner/scanner_screen.dart index 1cfdd2cc..d0b24061 100644 --- a/khelo/lib/ui/flow/team/scanner/scanner_screen.dart +++ b/khelo/lib/ui/flow/team/scanner/scanner_screen.dart @@ -229,7 +229,7 @@ class _ScannerScreenState extends ConsumerState { onPressed: () => context.pop(), icon: Icon( Icons.close, - color: context.colorScheme.textPrimary.withOpacity(0.8), + color: context.colorScheme.textPrimary.withValues(alpha: 0.8), ), ), Expanded( diff --git a/khelo/lib/ui/flow/tournament/detail/components/flexible_space.dart b/khelo/lib/ui/flow/tournament/detail/components/flexible_space.dart index 9f0b248d..7f9eadec 100644 --- a/khelo/lib/ui/flow/tournament/detail/components/flexible_space.dart +++ b/khelo/lib/ui/flow/tournament/detail/components/flexible_space.dart @@ -116,9 +116,9 @@ class _FlexibleSpaceState extends State { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - dominant.withOpacity(0), - dominant.withOpacity(0.2), - dominant.withOpacity(0.86), + dominant.withValues(alpha: 0), + dominant.withValues(alpha: 0.2), + dominant.withValues(alpha: 0.86), ], ), ), @@ -198,9 +198,9 @@ class _FlexibleSpaceState extends State { palette?.dominantColor?.color ?? context.colorScheme.surface; if (dominant.computeLuminance() < 0.5) { - return (Colors.white, Colors.white.withOpacity(0.86)); + return (Colors.white, Colors.white.withValues(alpha: 0.86)); } else { - return (Colors.black, Colors.black.withOpacity(0.7)); + return (Colors.black, Colors.black.withValues(alpha: 0.7)); } } } diff --git a/khelo/lib/ui/flow/tournament/detail/components/match_group_tag.dart b/khelo/lib/ui/flow/tournament/detail/components/match_group_tag.dart index 96a12bb5..02a9553e 100644 --- a/khelo/lib/ui/flow/tournament/detail/components/match_group_tag.dart +++ b/khelo/lib/ui/flow/tournament/detail/components/match_group_tag.dart @@ -19,7 +19,7 @@ class MatchGroupTag extends StatelessWidget { child: Container( padding: EdgeInsets.symmetric(horizontal: 12, vertical: 2), decoration: BoxDecoration( - color: context.colorScheme.primary.withOpacity(0.2), + color: context.colorScheme.primary.withValues(alpha: 0.2), borderRadius: BorderRadius.circular(30), ), child: Text( diff --git a/khelo/lib/ui/flow/tournament/detail/tournament_detail_screen.dart b/khelo/lib/ui/flow/tournament/detail/tournament_detail_screen.dart index a1edfa43..aaf130eb 100644 --- a/khelo/lib/ui/flow/tournament/detail/tournament_detail_screen.dart +++ b/khelo/lib/ui/flow/tournament/detail/tournament_detail_screen.dart @@ -119,7 +119,7 @@ class _TournamentDetailScreenState size: 20, backgroundColor: context .colorScheme.containerHighOnSurface - .withOpacity(0.4), + .withValues(alpha: 0.4), onPressed: () => _moreActionButton(context, state), ), ] @@ -246,7 +246,8 @@ class _TournamentDetailScreenState width: 28, decoration: BoxDecoration( shape: BoxShape.circle, - color: context.colorScheme.containerHighOnSurface.withOpacity(0.4), + color: context.colorScheme.containerHighOnSurface + .withValues(alpha: 0.4), ), alignment: Alignment.center, child: Icon( diff --git a/khelo/pubspec.lock b/khelo/pubspec.lock index 5d0c5a70..91728730 100644 --- a/khelo/pubspec.lock +++ b/khelo/pubspec.lock @@ -5,10 +5,10 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 + sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" url: "https://pub.dev" source: hosted - version: "72.0.0" + version: "76.0.0" _flutterfire_internals: dependency: transitive description: @@ -21,15 +21,15 @@ packages: dependency: transitive description: dart source: sdk - version: "0.3.2" + version: "0.3.3" analyzer: dependency: transitive description: name: analyzer - sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" url: "https://pub.dev" source: hosted - version: "6.7.0" + version: "6.11.0" analyzer_plugin: dependency: transitive description: @@ -266,10 +266,10 @@ packages: dependency: "direct main" description: name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" color: dependency: transitive description: @@ -594,14 +594,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.4.1" - flutter_contacts: - dependency: "direct main" - description: - name: flutter_contacts - sha256: "388d32cd33f16640ee169570128c933b45f3259bddbfae7a100bb49e5ffea9ae" - url: "https://pub.dev" - source: hosted - version: "1.1.9+2" flutter_gen_core: dependency: transitive description: @@ -957,18 +949,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.5" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: @@ -997,10 +989,10 @@ packages: dependency: transitive description: name: macros - sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" url: "https://pub.dev" source: hosted - version: "0.1.2-main.4" + version: "0.1.3-main.0" matcher: dependency: transitive description: @@ -1405,7 +1397,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.99" + version: "0.0.0" smooth_page_indicator: dependency: "direct main" description: @@ -1482,10 +1474,10 @@ packages: dependency: transitive description: name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.11.1" + version: "1.12.0" state_notifier: dependency: transitive description: @@ -1514,10 +1506,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" style: dependency: "direct main" description: @@ -1545,26 +1537,26 @@ packages: dependency: transitive description: name: test - sha256: "7ee44229615f8f642b68120165ae4c2a75fe77ae2065b1e55ae4711f6cf0899e" + sha256: "713a8789d62f3233c46b4a90b174737b2c04cb6ae4500f2aa8b1be8f03f5e67f" url: "https://pub.dev" source: hosted - version: "1.25.7" + version: "1.25.8" test_api: dependency: transitive description: name: test_api - sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.2" + version: "0.7.3" test_core: dependency: transitive description: name: test_core - sha256: "55ea5a652e38a1dfb32943a7973f3681a60f872f8c3a05a14664ad54ef9c6696" + sha256: "12391302411737c176b0b5d6491f466b0dd56d4763e347b6714efbaa74d7953d" url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.6.5" time: dependency: transitive description: @@ -1713,10 +1705,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "14.2.5" + version: "14.3.0" watcher: dependency: transitive description: diff --git a/khelo/pubspec.yaml b/khelo/pubspec.yaml index 1f781da9..bde4b118 100644 --- a/khelo/pubspec.yaml +++ b/khelo/pubspec.yaml @@ -57,9 +57,6 @@ dependencies: qr_code_scanner: ^1.0.1 palette_generator: ^0.3.3+5 - # contacts - flutter_contacts: ^1.1.9+2 - # picker canopas_country_picker: ^0.0.10 image_picker: ^1.1.2 diff --git a/style/lib/button/bottom_sticky_overlay.dart b/style/lib/button/bottom_sticky_overlay.dart index c5bdc06d..be5ac700 100644 --- a/style/lib/button/bottom_sticky_overlay.dart +++ b/style/lib/button/bottom_sticky_overlay.dart @@ -27,7 +27,7 @@ class BottomStickyOverlay extends StatelessWidget { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - context.colorScheme.surface.withOpacity(0), + context.colorScheme.surface.withValues(alpha: 0), context.colorScheme.surface, context.colorScheme.surface, context.colorScheme.surface, diff --git a/style/lib/button/large_icon_button.dart b/style/lib/button/large_icon_button.dart index 42b7213b..db991f75 100644 --- a/style/lib/button/large_icon_button.dart +++ b/style/lib/button/large_icon_button.dart @@ -28,7 +28,10 @@ class LargeIconButton extends StatelessWidget { final bg = backgroundColor ?? context.colorScheme.primary; final bgColor = tappable ? bg - : Color.alphaBlend(bg.withOpacity(0.4), context.colorScheme.surface); + : Color.alphaBlend( + bg.withValues(alpha: 0.4), + context.colorScheme.surface, + ); return OnTapScale( enabled: tappable, diff --git a/style/lib/button/primary_button.dart b/style/lib/button/primary_button.dart index 813edfe4..b12d830a 100644 --- a/style/lib/button/primary_button.dart +++ b/style/lib/button/primary_button.dart @@ -37,12 +37,12 @@ class PrimaryButton extends StatelessWidget { final bg = background ?? colorScheme.primary; final bgColor = tappable ? bg - : Color.alphaBlend(bg.withOpacity(0.4), colorScheme.surface); + : Color.alphaBlend(bg.withValues(alpha: 0.4), colorScheme.surface); final fg = foreground ?? colorScheme.onPrimary; final fgColor = tappable ? fg - : Color.alphaBlend(fg.withOpacity(0.5), colorScheme.surface); + : Color.alphaBlend(fg.withValues(alpha: 0.5), colorScheme.surface); return OnTapScale( onTap: () { diff --git a/style/lib/button/secondary_button.dart b/style/lib/button/secondary_button.dart index 80b91f1a..364ba758 100644 --- a/style/lib/button/secondary_button.dart +++ b/style/lib/button/secondary_button.dart @@ -29,7 +29,7 @@ class SecondaryButton extends StatelessWidget { color: enabled ? context.colorScheme.primary : Color.alphaBlend( - context.colorScheme.primary.withOpacity(0.5), + context.colorScheme.primary.withValues(alpha: 0.5), context.colorScheme.surface)), ), backgroundColor: context.colorScheme.containerLowOnSurface,