Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-pratik-k committed Nov 25, 2024
1 parent f755098 commit f3e37e4
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 53 deletions.
16 changes: 11 additions & 5 deletions app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ PODS:
- Flutter
- Toast
- google_sign_in_ios (0.0.1):
- AppAuth (>= 1.7.4)
- Flutter
- FlutterMacOS
- GoogleSignIn (~> 7.0)
- GoogleSignIn (~> 7.1)
- GTMSessionFetcher (>= 3.4.0)
- GoogleSignIn (7.1.0):
- AppAuth (< 2.0, >= 1.7.3)
- GTMAppAuth (< 5.0, >= 4.1.1)
Expand All @@ -43,7 +45,11 @@ PODS:
- GTMAppAuth (4.1.1):
- AppAuth/Core (~> 1.7)
- GTMSessionFetcher/Core (< 4.0, >= 3.3)
- GTMSessionFetcher (3.5.0):
- GTMSessionFetcher/Full (= 3.5.0)
- GTMSessionFetcher/Core (3.5.0)
- GTMSessionFetcher/Full (3.5.0):
- GTMSessionFetcher/Core
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
Expand Down Expand Up @@ -146,21 +152,21 @@ SPEC CHECKSUMS:
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_local_notifications: df98d66e515e1ca797af436137b4459b160ad8c9
fluttertoast: e9a18c7be5413da53898f660530c56f35edfba9c
google_sign_in_ios: 989eea5abe94af62050782714daf920be883d4a2
google_sign_in_ios: 07375bfbf2620bc93a602c0e27160d6afc6ead38
GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
photo_manager: ff695c7a1dd5bc379974953a2b5c0a293f7c4c8a
share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
url_launcher_ios: 6116280ddcfe98ab8820085d8d76ae7449447586
video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
webview_flutter_wkwebview: 0982481e3d9c78fd5c6f62a002fcd24fc791f1e4

PODFILE CHECKSUM: 4c438addb11b6da45ed7ae408823d68256222460
Expand Down
34 changes: 14 additions & 20 deletions app/lib/ui/flow/home/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,26 +106,20 @@ class _HomeScreenState extends ConsumerState<HomeScreen> {
Widget _transferButton(BuildContext context) {
return Consumer(
builder: (context, ref, child) {
final showTransferButton = ref.watch(
homeViewStateNotifier.select((value) => value.showTransfer),
);
return Visibility(
visible: showTransferButton,
child: Padding(
padding: const EdgeInsets.only(right: 8.0),
child: ActionButton(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
size: 36,
backgroundColor: context.colorScheme.containerNormal,
onPressed: () async {
await TransferRoute().push(context);
_notifier.loadMedias();
},
icon: Icon(
CupertinoIcons.arrow_up_arrow_down,
color: context.colorScheme.textSecondary,
size: 18,
),
return Padding(
padding: const EdgeInsets.only(right: 8.0),
child: ActionButton(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
size: 36,
backgroundColor: context.colorScheme.containerNormal,
onPressed: () async {
await TransferRoute().push(context);
_notifier.loadMedias();
},
icon: Icon(
CupertinoIcons.arrow_up_arrow_down,
color: context.colorScheme.textSecondary,
size: 18,
),
),
);
Expand Down
3 changes: 0 additions & 3 deletions app/lib/ui/flow/home/home_screen_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ class HomeViewStateNotifier extends StateNotifier<HomeViewState>
..._googleDriveProcessRepo.deleteQueue,
..._googleDriveProcessRepo.downloadQueue,
],
showTransfer: _googleDriveProcessRepo.uploadQueue.isNotEmpty ||
_googleDriveProcessRepo.downloadQueue.isNotEmpty,
);
}

Expand Down Expand Up @@ -375,7 +373,6 @@ class HomeViewState with _$HomeViewState {
@Default(false) bool hasLocalMediaAccess,
@Default(false) bool loading,
GoogleSignInAccount? googleAccount,
@Default(false) bool showTransfer,
String? lastLocalMediaId,
@Default({}) Map<DateTime, List<AppMedia>> medias,
@Default([]) List<AppMedia> selectedMedias,
Expand Down
25 changes: 1 addition & 24 deletions app/lib/ui/flow/home/home_screen_view_model.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ mixin _$HomeViewState {
bool get hasLocalMediaAccess => throw _privateConstructorUsedError;
bool get loading => throw _privateConstructorUsedError;
GoogleSignInAccount? get googleAccount => throw _privateConstructorUsedError;
bool get showTransfer => throw _privateConstructorUsedError;
String? get lastLocalMediaId => throw _privateConstructorUsedError;
Map<DateTime, List<AppMedia>> get medias =>
throw _privateConstructorUsedError;
Expand All @@ -45,7 +44,6 @@ abstract class $HomeViewStateCopyWith<$Res> {
bool hasLocalMediaAccess,
bool loading,
GoogleSignInAccount? googleAccount,
bool showTransfer,
String? lastLocalMediaId,
Map<DateTime, List<AppMedia>> medias,
List<AppMedia> selectedMedias,
Expand All @@ -71,7 +69,6 @@ class _$HomeViewStateCopyWithImpl<$Res, $Val extends HomeViewState>
Object? hasLocalMediaAccess = null,
Object? loading = null,
Object? googleAccount = freezed,
Object? showTransfer = null,
Object? lastLocalMediaId = freezed,
Object? medias = null,
Object? selectedMedias = null,
Expand All @@ -91,10 +88,6 @@ class _$HomeViewStateCopyWithImpl<$Res, $Val extends HomeViewState>
? _value.googleAccount
: googleAccount // ignore: cast_nullable_to_non_nullable
as GoogleSignInAccount?,
showTransfer: null == showTransfer
? _value.showTransfer
: showTransfer // ignore: cast_nullable_to_non_nullable
as bool,
lastLocalMediaId: freezed == lastLocalMediaId
? _value.lastLocalMediaId
: lastLocalMediaId // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -128,7 +121,6 @@ abstract class _$$HomeViewStateImplCopyWith<$Res>
bool hasLocalMediaAccess,
bool loading,
GoogleSignInAccount? googleAccount,
bool showTransfer,
String? lastLocalMediaId,
Map<DateTime, List<AppMedia>> medias,
List<AppMedia> selectedMedias,
Expand All @@ -152,7 +144,6 @@ class __$$HomeViewStateImplCopyWithImpl<$Res>
Object? hasLocalMediaAccess = null,
Object? loading = null,
Object? googleAccount = freezed,
Object? showTransfer = null,
Object? lastLocalMediaId = freezed,
Object? medias = null,
Object? selectedMedias = null,
Expand All @@ -172,10 +163,6 @@ class __$$HomeViewStateImplCopyWithImpl<$Res>
? _value.googleAccount
: googleAccount // ignore: cast_nullable_to_non_nullable
as GoogleSignInAccount?,
showTransfer: null == showTransfer
? _value.showTransfer
: showTransfer // ignore: cast_nullable_to_non_nullable
as bool,
lastLocalMediaId: freezed == lastLocalMediaId
? _value.lastLocalMediaId
: lastLocalMediaId // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -204,7 +191,6 @@ class _$HomeViewStateImpl implements _HomeViewState {
this.hasLocalMediaAccess = false,
this.loading = false,
this.googleAccount,
this.showTransfer = false,
this.lastLocalMediaId,
final Map<DateTime, List<AppMedia>> medias = const {},
final List<AppMedia> selectedMedias = const [],
Expand All @@ -224,9 +210,6 @@ class _$HomeViewStateImpl implements _HomeViewState {
@override
final GoogleSignInAccount? googleAccount;
@override
@JsonKey()
final bool showTransfer;
@override
final String? lastLocalMediaId;
final Map<DateTime, List<AppMedia>> _medias;
@override
Expand Down Expand Up @@ -257,7 +240,7 @@ class _$HomeViewStateImpl implements _HomeViewState {

@override
String toString() {
return 'HomeViewState(error: $error, hasLocalMediaAccess: $hasLocalMediaAccess, loading: $loading, googleAccount: $googleAccount, showTransfer: $showTransfer, lastLocalMediaId: $lastLocalMediaId, medias: $medias, selectedMedias: $selectedMedias, mediaProcesses: $mediaProcesses)';
return 'HomeViewState(error: $error, hasLocalMediaAccess: $hasLocalMediaAccess, loading: $loading, googleAccount: $googleAccount, lastLocalMediaId: $lastLocalMediaId, medias: $medias, selectedMedias: $selectedMedias, mediaProcesses: $mediaProcesses)';
}

@override
Expand All @@ -271,8 +254,6 @@ class _$HomeViewStateImpl implements _HomeViewState {
(identical(other.loading, loading) || other.loading == loading) &&
(identical(other.googleAccount, googleAccount) ||
other.googleAccount == googleAccount) &&
(identical(other.showTransfer, showTransfer) ||
other.showTransfer == showTransfer) &&
(identical(other.lastLocalMediaId, lastLocalMediaId) ||
other.lastLocalMediaId == lastLocalMediaId) &&
const DeepCollectionEquality().equals(other._medias, _medias) &&
Expand All @@ -289,7 +270,6 @@ class _$HomeViewStateImpl implements _HomeViewState {
hasLocalMediaAccess,
loading,
googleAccount,
showTransfer,
lastLocalMediaId,
const DeepCollectionEquality().hash(_medias),
const DeepCollectionEquality().hash(_selectedMedias),
Expand All @@ -310,7 +290,6 @@ abstract class _HomeViewState implements HomeViewState {
final bool hasLocalMediaAccess,
final bool loading,
final GoogleSignInAccount? googleAccount,
final bool showTransfer,
final String? lastLocalMediaId,
final Map<DateTime, List<AppMedia>> medias,
final List<AppMedia> selectedMedias,
Expand All @@ -325,8 +304,6 @@ abstract class _HomeViewState implements HomeViewState {
@override
GoogleSignInAccount? get googleAccount;
@override
bool get showTransfer;
@override
String? get lastLocalMediaId;
@override
Map<DateTime, List<AppMedia>> get medias;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class MediaPreviewStateNotifier extends StateNotifier<MediaPreviewState> {

Future<void> deleteMediaFromGoogleDrive(String? id) async {
try {
await _googleDriveService.deleteMedia(id!);
await _googleDriveService.deleteMedia(id:id!);
} catch (error) {
state = state.copyWith(error: error);
}
Expand Down

0 comments on commit f3e37e4

Please sign in to comment.