Skip to content

Commit

Permalink
update firebase package and snack bar for failure response
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-ishita-g committed Jun 6, 2024
1 parent 3551e2c commit 96a878b
Show file tree
Hide file tree
Showing 18 changed files with 215 additions and 118 deletions.
92 changes: 46 additions & 46 deletions app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -958,64 +958,64 @@ PODS:
- BoringSSL-GRPC/Implementation (0.0.32):
- BoringSSL-GRPC/Interface (= 0.0.32)
- BoringSSL-GRPC/Interface (0.0.32)
- cloud_firestore (4.17.5):
- Firebase/Firestore (= 10.25.0)
- cloud_firestore (5.0.0):
- Firebase/Firestore (= 10.27.0)
- firebase_core
- Flutter
- cloud_functions (4.7.6):
- Firebase/Functions (= 10.25.0)
- cloud_functions (5.0.0):
- Firebase/Functions (= 10.27.0)
- firebase_core
- Flutter
- device_info_plus (0.0.1):
- Flutter
- Firebase/Auth (10.25.0):
- Firebase/Auth (10.27.0):
- Firebase/CoreOnly
- FirebaseAuth (~> 10.25.0)
- Firebase/CoreOnly (10.25.0):
- FirebaseCore (= 10.25.0)
- Firebase/Firestore (10.25.0):
- FirebaseAuth (~> 10.27.0)
- Firebase/CoreOnly (10.27.0):
- FirebaseCore (= 10.27.0)
- Firebase/Firestore (10.27.0):
- Firebase/CoreOnly
- FirebaseFirestore (~> 10.25.0)
- Firebase/Functions (10.25.0):
- FirebaseFirestore (~> 10.27.0)
- Firebase/Functions (10.27.0):
- Firebase/CoreOnly
- FirebaseFunctions (~> 10.25.0)
- Firebase/Storage (10.25.0):
- FirebaseFunctions (~> 10.27.0)
- Firebase/Storage (10.27.0):
- Firebase/CoreOnly
- FirebaseStorage (~> 10.25.0)
- firebase_auth (4.20.0):
- Firebase/Auth (= 10.25.0)
- FirebaseStorage (~> 10.27.0)
- firebase_auth (5.0.0):
- Firebase/Auth (= 10.27.0)
- firebase_core
- Flutter
- firebase_core (2.32.0):
- Firebase/CoreOnly (= 10.25.0)
- firebase_core (3.0.0):
- Firebase/CoreOnly (= 10.27.0)
- Flutter
- firebase_storage (11.7.7):
- Firebase/Storage (= 10.25.0)
- firebase_storage (12.0.0):
- Firebase/Storage (= 10.27.0)
- firebase_core
- Flutter
- FirebaseAppCheckInterop (10.27.0)
- FirebaseAuth (10.25.0):
- FirebaseAuth (10.27.0):
- FirebaseAppCheckInterop (~> 10.17)
- FirebaseCore (~> 10.0)
- GoogleUtilities/AppDelegateSwizzler (~> 7.8)
- GoogleUtilities/Environment (~> 7.8)
- GTMSessionFetcher/Core (< 4.0, >= 2.1)
- RecaptchaInterop (~> 100.0)
- FirebaseAuthInterop (10.27.0)
- FirebaseCore (10.25.0):
- FirebaseCore (10.27.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.12)
- GoogleUtilities/Logger (~> 7.12)
- FirebaseCoreExtension (10.27.0):
- FirebaseCore (~> 10.0)
- FirebaseCoreInternal (10.27.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- FirebaseFirestore (10.25.0):
- FirebaseFirestore (10.27.0):
- FirebaseCore (~> 10.0)
- FirebaseCoreExtension (~> 10.0)
- FirebaseFirestoreInternal (= 10.25.0)
- FirebaseFirestoreInternal (= 10.27.0)
- FirebaseSharedSwift (~> 10.0)
- FirebaseFirestoreInternal (10.25.0):
- FirebaseFirestoreInternal (10.27.0):
- abseil/algorithm (~> 1.20240116.1)
- abseil/base (~> 1.20240116.1)
- abseil/container/flat_hash_map (~> 1.20240116.1)
Expand All @@ -1030,7 +1030,7 @@ PODS:
- gRPC-Core (~> 1.62.0)
- leveldb-library (~> 1.22)
- nanopb (< 2.30911.0, >= 2.30908.0)
- FirebaseFunctions (10.25.0):
- FirebaseFunctions (10.27.0):
- FirebaseAppCheckInterop (~> 10.10)
- FirebaseAuthInterop (~> 10.25)
- FirebaseCore (~> 10.0)
Expand All @@ -1040,7 +1040,7 @@ PODS:
- GTMSessionFetcher/Core (< 4.0, >= 2.1)
- FirebaseMessagingInterop (10.27.0)
- FirebaseSharedSwift (10.27.0)
- FirebaseStorage (10.25.0):
- FirebaseStorage (10.27.0):
- FirebaseAppCheckInterop (~> 10.0)
- FirebaseAuthInterop (~> 10.25)
- FirebaseCore (~> 10.0)
Expand Down Expand Up @@ -1174,11 +1174,11 @@ PODS:
- image_picker_ios (0.0.1):
- Flutter
- leveldb-library (1.22.5)
- nanopb (2.30909.1):
- nanopb/decode (= 2.30909.1)
- nanopb/encode (= 2.30909.1)
- nanopb/decode (2.30909.1)
- nanopb/encode (2.30909.1)
- nanopb (2.30910.0):
- nanopb/decode (= 2.30910.0)
- nanopb/encode (= 2.30910.0)
- nanopb/decode (2.30910.0)
- nanopb/encode (2.30910.0)
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
Expand Down Expand Up @@ -1282,25 +1282,25 @@ SPEC CHECKSUMS:
abseil: d121da9ef7e2ff4cab7666e76c5a3e0915ae08c3
AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa
BoringSSL-GRPC: 1e2348957acdbcad360b80a264a90799984b2ba6
cloud_firestore: 003d53b6b8b392600b7769acf9421cc4f23e5911
cloud_functions: 1a28a0b6ec4caf864692e54e1f5c1934431510c8
cloud_firestore: 8cbdffc6eec66f2c2e67f19e4c6f9a872c222d19
cloud_functions: 800466fd033f2e623a27c006add7be953df28227
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
Firebase: 0312a2352584f782ea56f66d91606891d4607f06
firebase_auth: 5719ddc9f654b813405899480e84971bd8e61235
firebase_core: a626d00494efa398e7c54f25f1454a64c8abf197
firebase_storage: 5c0f552d6b27d621429d7fd16ebab4be94a3c954
Firebase: 26b040b20866a55f55eb3611b9fcf3ae64816b86
firebase_auth: 17ce83d25a062b2a594e5dfce91a4ad36e3739d5
firebase_core: 5926464bbb028fef87d2443369b73ada2a8a3608
firebase_storage: ff66671828d524fc9e36f30cd7ed1909036324c7
FirebaseAppCheckInterop: 0dd062c9926a76332ca5711dbed6f1a9ac540b54
FirebaseAuth: c0f93dcc570c9da2bffb576969d793e95c344fbb
FirebaseAuth: 77a012b7e08042bf44d0db835ca2e86e6ca7bbd3
FirebaseAuthInterop: 0344acef098654eaf59f6add4c93254349bc5de4
FirebaseCore: 7ec4d0484817f12c3373955bc87762d96842d483
FirebaseCore: a2b95ae4ce7c83ceecfbbbe3b6f1cddc7415a808
FirebaseCoreExtension: 4ec89dd0c6de93d6becde32122d68b7c35f6bf5d
FirebaseCoreInternal: 4b297a2d56063dbea2c1d0d04222d44a8d058862
FirebaseFirestore: 977ccc27a3caa5d68279f209c3b0450f85b9dc5f
FirebaseFirestoreInternal: 04b8afa77b4e5b84e86ab5ad985193e9573239fa
FirebaseFunctions: 93b1c7f352aec3922925a0e856cb1d6a09197083
FirebaseFirestore: 7169b75e7db8f9796d4130e3c2157ed444f100d4
FirebaseFirestoreInternal: 7ba63f170a554ae49392da44f9430e5b7915a7ff
FirebaseFunctions: d95bacf9a201ebabd2df7d2412281538016a07dd
FirebaseMessagingInterop: 8e911a5387664e849d316c5cd257c33fa1d37529
FirebaseSharedSwift: a03fe7a59ee646fef71099a887f774fe25d745b8
FirebaseStorage: 44f4e25073f6fa0d4d8c09f5bec299ee9e4eb985
FirebaseStorage: 255526c3d04c49874d7a5e3886964a79f77d6f33
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_timezone: ffb07bdad3c6276af8dada0f11978d8a1f8a20bb
google_sign_in_ios: 07375bfbf2620bc93a602c0e27160d6afc6ead38
Expand All @@ -1313,7 +1313,7 @@ SPEC CHECKSUMS:
image_cropper: 2c150b3d63f4feaad31054d20381ddac0a460e63
image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
leveldb-library: e8eadf9008a61f9e1dde3978c086d2b6d9b9dc28
nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5
nanopb: 438bc412db1928dac798aa6fd75726007be04262
package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
Expand All @@ -1325,4 +1325,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796

COCOAPODS: 1.14.3
COCOAPODS: 1.15.2
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import 'package:style/indicator/progress_indicator.dart';
import 'package:style/text/app_text_dart.dart';
import 'package:style/text/app_text_field.dart';
import 'package:yourspace_flutter/domain/extenstions/context_extenstions.dart';
import 'package:yourspace_flutter/ui/components/error_snakebar.dart';
import 'package:yourspace_flutter/ui/flow/setting/contact_support/contact_support_view_model.dart';

import '../../../components/app_page.dart';
Expand All @@ -33,6 +34,7 @@ class _ContactSupportScreenState extends ConsumerState<ContactSupportScreen> {
notifier = ref.watch(contactSupportViewStateProvider.notifier);
final state = ref.watch(contactSupportViewStateProvider);
_observePop();
_observeError();

return AppPage(
title: context.l10n.contact_support_title,
Expand Down Expand Up @@ -209,4 +211,12 @@ class _ContactSupportScreenState extends ConsumerState<ContactSupportScreen> {
}
});
}

void _observeError() {
ref.listen(contactSupportViewStateProvider.select((state) => state.error), (previous, next) {
if (next != null) {
showErrorSnackBar(context, next.toString());
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class ContactSupportViewNotifier
error: error,
stackTrace: stackTrace,
);
state = state.copyWith(error: error);
}
}

Expand Down
10 changes: 10 additions & 0 deletions app/lib/ui/flow/setting/profile/profile_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import 'package:style/text/app_text_field.dart';
import 'package:yourspace_flutter/domain/extenstions/context_extenstions.dart';
import 'package:yourspace_flutter/ui/app_route.dart';
import 'package:yourspace_flutter/ui/components/app_page.dart';
import 'package:yourspace_flutter/ui/components/error_snakebar.dart';
import 'package:yourspace_flutter/ui/flow/setting/profile/profile_view_model.dart';

import '../../../../gen/assets.gen.dart';
Expand All @@ -40,6 +41,7 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
final state = ref.watch(editProfileViewStateProvider);
_observePop();
_observeAccountDeleted();
_observeError();

return AppPage(
title: context.l10n.edit_profile_title,
Expand Down Expand Up @@ -301,4 +303,12 @@ class _ProfileScreenState extends ConsumerState<ProfileScreen> {
}
});
}

void _observeError() {
ref.listen(editProfileViewStateProvider.select((state) => state.error), (previous, next) {
if (next != null) {
showErrorSnackBar(context, next.toString());
}
});
}
}
5 changes: 4 additions & 1 deletion app/lib/ui/flow/setting/profile/profile_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class EditProfileViewNotifier extends StateNotifier<EditProfileViewState> {
error: error,
stackTrace: stack,
);
state = state.copyWith(error: error);
}
}

Expand All @@ -70,6 +71,7 @@ class EditProfileViewNotifier extends StateNotifier<EditProfileViewState> {
error: error,
stackTrace: stack
);
state = state.copyWith(error: error);
}
}

Expand Down Expand Up @@ -112,7 +114,7 @@ class EditProfileViewNotifier extends StateNotifier<EditProfileViewState> {
error: error,
stackTrace: stack,
);
state = state.copyWith(profileUrl: '', uploadingImage: false);
state = state.copyWith(profileUrl: '', uploadingImage: false, error: error);
onChange();
}
}
Expand All @@ -139,5 +141,6 @@ class EditProfileViewState with _$EditProfileViewState {
required TextEditingController email,
required TextEditingController phone,
required String profileUrl,
Object? error,
}) = _EditProfileViewState;
}
29 changes: 22 additions & 7 deletions app/lib/ui/flow/setting/profile/profile_view_model.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ mixin _$EditProfileViewState {
TextEditingController get email => throw _privateConstructorUsedError;
TextEditingController get phone => throw _privateConstructorUsedError;
String get profileUrl => throw _privateConstructorUsedError;
Object? get error => throw _privateConstructorUsedError;

@JsonKey(ignore: true)
$EditProfileViewStateCopyWith<EditProfileViewState> get copyWith =>
Expand All @@ -54,7 +55,8 @@ abstract class $EditProfileViewStateCopyWith<$Res> {
TextEditingController lastName,
TextEditingController email,
TextEditingController phone,
String profileUrl});
String profileUrl,
Object? error});
}

/// @nodoc
Expand Down Expand Up @@ -84,6 +86,7 @@ class _$EditProfileViewStateCopyWithImpl<$Res,
Object? email = null,
Object? phone = null,
Object? profileUrl = null,
Object? error = freezed,
}) {
return _then(_value.copyWith(
saving: null == saving
Expand Down Expand Up @@ -138,6 +141,7 @@ class _$EditProfileViewStateCopyWithImpl<$Res,
? _value.profileUrl
: profileUrl // ignore: cast_nullable_to_non_nullable
as String,
error: freezed == error ? _value.error : error,
) as $Val);
}
}
Expand All @@ -163,7 +167,8 @@ abstract class _$$EditProfileViewStateImplCopyWith<$Res>
TextEditingController lastName,
TextEditingController email,
TextEditingController phone,
String profileUrl});
String profileUrl,
Object? error});
}

/// @nodoc
Expand All @@ -190,6 +195,7 @@ class __$$EditProfileViewStateImplCopyWithImpl<$Res>
Object? email = null,
Object? phone = null,
Object? profileUrl = null,
Object? error = freezed,
}) {
return _then(_$EditProfileViewStateImpl(
saving: null == saving
Expand Down Expand Up @@ -244,6 +250,7 @@ class __$$EditProfileViewStateImplCopyWithImpl<$Res>
? _value.profileUrl
: profileUrl // ignore: cast_nullable_to_non_nullable
as String,
error: freezed == error ? _value.error : error,
));
}
}
Expand All @@ -264,7 +271,8 @@ class _$EditProfileViewStateImpl implements _EditProfileViewState {
required this.lastName,
required this.email,
required this.phone,
required this.profileUrl});
required this.profileUrl,
this.error});

@override
@JsonKey()
Expand Down Expand Up @@ -300,10 +308,12 @@ class _$EditProfileViewStateImpl implements _EditProfileViewState {
final TextEditingController phone;
@override
final String profileUrl;
@override
final Object? error;

@override
String toString() {
return 'EditProfileViewState(saving: $saving, saved: $saved, allowSave: $allowSave, enablePhone: $enablePhone, enableEmail: $enableEmail, accountDeleted: $accountDeleted, uploadingImage: $uploadingImage, deletingAccount: $deletingAccount, firstName: $firstName, lastName: $lastName, email: $email, phone: $phone, profileUrl: $profileUrl)';
return 'EditProfileViewState(saving: $saving, saved: $saved, allowSave: $allowSave, enablePhone: $enablePhone, enableEmail: $enableEmail, accountDeleted: $accountDeleted, uploadingImage: $uploadingImage, deletingAccount: $deletingAccount, firstName: $firstName, lastName: $lastName, email: $email, phone: $phone, profileUrl: $profileUrl, error: $error)';
}

@override
Expand Down Expand Up @@ -332,7 +342,8 @@ class _$EditProfileViewStateImpl implements _EditProfileViewState {
(identical(other.email, email) || other.email == email) &&
(identical(other.phone, phone) || other.phone == phone) &&
(identical(other.profileUrl, profileUrl) ||
other.profileUrl == profileUrl));
other.profileUrl == profileUrl) &&
const DeepCollectionEquality().equals(other.error, error));
}

@override
Expand All @@ -350,7 +361,8 @@ class _$EditProfileViewStateImpl implements _EditProfileViewState {
lastName,
email,
phone,
profileUrl);
profileUrl,
const DeepCollectionEquality().hash(error));

@JsonKey(ignore: true)
@override
Expand All @@ -375,7 +387,8 @@ abstract class _EditProfileViewState implements EditProfileViewState {
required final TextEditingController lastName,
required final TextEditingController email,
required final TextEditingController phone,
required final String profileUrl}) = _$EditProfileViewStateImpl;
required final String profileUrl,
final Object? error}) = _$EditProfileViewStateImpl;

@override
bool get saving;
Expand Down Expand Up @@ -404,6 +417,8 @@ abstract class _EditProfileViewState implements EditProfileViewState {
@override
String get profileUrl;
@override
Object? get error;
@override
@JsonKey(ignore: true)
_$$EditProfileViewStateImplCopyWith<_$EditProfileViewStateImpl>
get copyWith => throw _privateConstructorUsedError;
Expand Down
Loading

0 comments on commit 96a878b

Please sign in to comment.