Skip to content

Commit

Permalink
Improve deshboard flow
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-pratik-k committed Feb 27, 2024
1 parent 831bca0 commit 4d73ede
Show file tree
Hide file tree
Showing 34 changed files with 1,134 additions and 386 deletions.
56 changes: 56 additions & 0 deletions .idea/libraries/Dart_Packages.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions .idea/libraries/Flutter_Plugins.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ android {
applicationId "com.canopas.cloud_gallery"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
Binary file modified app/assets/images/app_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion app/assets/locales/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@

"common_get_started":"Get Started",
"common_done": "Done",
"common_local": "Local",

"google_drive_title": "Google Drive",

"no_internet_connection_error": "No internet connection! Please check your network and try again.",
"something_went_wrong_error": "Something went wrong! Please try again later.",

"on_board_description":"Effortlessly move, share, and organize your photos and videos in a breeze. Access all your clouds in one friendly place. Your moments, your way, simplified for you! 🚀",
"back_up_on_google_drive_text":"Back up on Google Drive"
"back_up_on_google_drive_text":"Back up on Google Drive",

"cant_find_media_title": "Can't find your photos or videos",
"ask_for_media_permission_message": "Please give us permission to access your local media, so you can load and enjoy all your favorite photos and videos effortlessly.",
"load_local_media_button_text": "Load local media"
}
16 changes: 16 additions & 0 deletions app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ PODS:
- FirebaseCoreInternal (10.20.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- Flutter (1.0.0)
- fluttertoast (0.0.2):
- Flutter
- Toast
- google_sign_in_ios (0.0.1):
- Flutter
- FlutterMacOS
Expand All @@ -34,18 +37,23 @@ PODS:
- AppAuth/Core (~> 1.6)
- GTMSessionFetcher/Core (< 4.0, >= 1.5)
- GTMSessionFetcher/Core (3.3.1)
- permission_handler_apple (9.3.0):
- Flutter
- photo_manager (2.0.0):
- Flutter
- FlutterMacOS
- PromisesObjC (2.3.1)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- Toast (4.1.0)

DEPENDENCIES:
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- Flutter (from `Flutter`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- photo_manager (from `.symlinks/plugins/photo_manager/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)

Expand All @@ -60,14 +68,19 @@ SPEC REPOS:
- GTMAppAuth
- GTMSessionFetcher
- PromisesObjC
- Toast

EXTERNAL SOURCES:
firebase_core:
:path: ".symlinks/plugins/firebase_core/ios"
Flutter:
:path: Flutter
fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios"
google_sign_in_ios:
:path: ".symlinks/plugins/google_sign_in_ios/darwin"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
photo_manager:
:path: ".symlinks/plugins/photo_manager/ios"
shared_preferences_foundation:
Expand All @@ -80,14 +93,17 @@ SPEC CHECKSUMS:
FirebaseCore: 2322423314d92f946219c8791674d2f3345b598f
FirebaseCoreInternal: efeeb171ac02d623bdaefe121539939821e10811
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
google_sign_in_ios: 1bfaf6607b44cd1b24c4d4bc39719870440f9ce1
GoogleSignIn: b232380cf495a429b8095d3178a8d5855b42e842
GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
GTMAppAuth: 99fb010047ba3973b7026e45393f51f27ab965ae
GTMSessionFetcher: 8a1b34ad97ebe6f909fb8b9b77fba99943007556
permission_handler_apple: 036b856153a2b1f61f21030ff725f3e6fece2b78
photo_manager: 4f6810b7dfc4feb03b461ac1a70dacf91fba7604
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
Toast: ec33c32b8688982cecc6348adeae667c1b9938da

PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796

Expand Down
2 changes: 1 addition & 1 deletion app/lib/components/action_sheet.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:cloud_gallery/domain/extensions/context_extensions.dart';
import 'package:style/extensions/context_extensions.dart';
import 'package:flutter/cupertino.dart';
import 'package:style/animations/on_tap_scale.dart';
import 'package:style/text/app_text_style.dart';
Expand Down
2 changes: 1 addition & 1 deletion app/lib/components/app_sheet.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:cloud_gallery/domain/extensions/context_extensions.dart';
import 'package:flutter/material.dart';
import 'package:style/extensions/context_extensions.dart';

Future<T?> showAppSheet<T>(
{required BuildContext context, required Widget child}) {
Expand Down
86 changes: 86 additions & 0 deletions app/lib/components/snack_bar.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import 'dart:io';
import 'package:cloud_gallery/domain/extensions/app_error_extensions.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:style/extensions/context_extensions.dart';
import 'package:style/text/app_text_style.dart';

void showErrorSnackBar({required BuildContext context, required Object error}) {
final message = error.l10nMessage(context);
showSnackBar(
context: context,
text: message,
icon: Icon(
Icons.warning_amber_rounded,
color: context.colorScheme.alert,
));
}

final _toast = FToast();

void showSnackBar({
required BuildContext context,
required String text,
Widget? icon,
Duration duration = const Duration(seconds: 4),
}) {
if (Platform.isIOS || Platform.isMacOS) {
_toast.init(context);
_toast.removeCustomToast();
_toast.showToast(
fadeDuration: const Duration(milliseconds: 100),
toastDuration: duration,
child: Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: context.colorScheme.containerNormalOnSurface,
borderRadius: BorderRadius.circular(12),
),
child: Row(
children: [
if (icon != null) icon,
if (icon != null) const SizedBox(width: 10),
Flexible(
child: Text(
text,
style: AppTextStyles.body2.copyWith(
color: context.colorScheme.textPrimary,
),
overflow: TextOverflow.visible,
),
),
],
),
),
gravity: ToastGravity.TOP,
);
} else {
final snackBar = SnackBar(
elevation: 0,
margin: const EdgeInsets.all(16),
content: Row(
children: [
if (icon != null) icon,
if (icon != null) const SizedBox(width: 10),
Flexible(
child: Text(
text,
style: AppTextStyles.body2.copyWith(
color: context.colorScheme.textPrimary,
),
overflow: TextOverflow.visible,
),
),
],
),
backgroundColor: context.colorScheme.containerNormalOnSurface,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
behavior: SnackBarBehavior.floating,
duration: duration,
);
ScaffoldMessenger.of(context).removeCurrentSnackBar();
ScaffoldMessenger.of(context).showSnackBar(snackBar);
}
}
23 changes: 15 additions & 8 deletions app/lib/domain/extensions/app_error_extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,22 @@ import 'package:data/errors/app_error.dart';
import 'package:data/errors/l10n_error_codes.dart';
import 'package:flutter/cupertino.dart';

extension AppErrorExtensions on AppError {
extension AppErrorExtensions on Object {
String l10nMessage(BuildContext context) {
switch (l10nCode) {
case AppErrorL10nCodes.noInternetConnection:
return context.l10n.no_internet_connection_error;
case AppErrorL10nCodes.somethingWentWrongError:
return context.l10n.something_went_wrong_error;
default:
return message ?? context.l10n.something_went_wrong_error;
if (this is AppError) {
switch ((this as AppError).l10nCode) {
case AppErrorL10nCodes.noInternetConnection:
return context.l10n.no_internet_connection_error;
case AppErrorL10nCodes.somethingWentWrongError:
return context.l10n.something_went_wrong_error;
default:
return (this as AppError).message ??
context.l10n.something_went_wrong_error;
}
} else if (this is String) {
return this as String;
} else {
return context.l10n.something_went_wrong_error;
}
}
}
15 changes: 0 additions & 15 deletions app/lib/domain/extensions/context_extensions.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:style/theme/theme.dart';

extension BuildContextExtensions on BuildContext {
AppLocalizations get l10n => AppLocalizations.of(this);

EdgeInsets get systemPadding => MediaQuery.of(this).padding;

Size get mediaQuerySize => MediaQuery.of(this).size;

AppColorScheme get colorScheme => appColorSchemeOf(this);

Brightness get brightness => MediaQuery.of(this).platformBrightness;

bool get isDarkMode => brightness == Brightness.dark;

FocusScopeNode get focusScope => FocusScope.of(this);

bool get use24Hour => MediaQuery.of(this).alwaysUse24HourFormat;
}
1 change: 1 addition & 0 deletions app/lib/ui/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:style/extensions/context_extensions.dart';
import 'package:style/theme/theme.dart';
import 'package:style/theme/app_theme_builder.dart';
import 'package:data/storage/app_preferences.dart';
Expand Down
12 changes: 6 additions & 6 deletions app/lib/ui/flow/home/components/image_item.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:cloud_gallery/domain/extensions/context_extensions.dart';
import 'package:flutter/cupertino.dart';
import 'package:style/animations/on_tap_scale.dart';
import 'package:style/animations/parallex_effect.dart';
import 'package:style/extensions/context_extensions.dart';

class ImageItem extends StatefulWidget {
final VoidCallback? onTap;
Expand Down Expand Up @@ -89,18 +89,18 @@ class ItemSelector extends StatelessWidget {
Align(
alignment: Alignment.bottomRight,
child: Container(
padding: const EdgeInsets.all(4),
padding: const EdgeInsets.all(2),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: context.colorScheme.surface,
border: Border.all(
color: CupertinoColors.systemGreen,
color: const Color(0xff808080),
),
),
child: const Icon(
child: const Icon(
CupertinoIcons.checkmark_alt,
color: CupertinoColors.systemGreen,
size: 18,
color: Color(0xff808080),
size: 16,
),
),
),
Expand Down
Loading

0 comments on commit 4d73ede

Please sign in to comment.