Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

home view improvement #14

Merged
merged 7 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
286 changes: 266 additions & 20 deletions .idea/libraries/Dart_Packages.xml

Large diffs are not rendered by default.

15 changes: 13 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.
6 changes: 6 additions & 0 deletions app/assets/images/icons/google_photos.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 10 additions & 5 deletions app/assets/locales/app_en.arb
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"app_name": "Cloud Gallery",

"common_get_started":"Get Started",

"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! 🚀"
"user_google_sign_in_account_not_found_error": "You haven't signed in with Google account yet. Please sign in with Google account and try again.",
"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",
"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"
}
24 changes: 20 additions & 4 deletions app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ PODS:
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.12)
- GoogleUtilities/Logger (~> 7.12)
- FirebaseCoreInternal (10.19.0):
- 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 @@ -33,19 +36,24 @@ PODS:
- GTMAppAuth (2.0.0):
- AppAuth/Core (~> 1.6)
- GTMSessionFetcher/Core (< 4.0, >= 1.5)
- GTMSessionFetcher/Core (3.2.0)
- 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 @@ -78,16 +91,19 @@ SPEC CHECKSUMS:
Firebase: 414ad272f8d02dfbf12662a9d43f4bba9bec2a06
firebase_core: 0af4a2b24f62071f9bf283691c0ee41556dcb3f5
FirebaseCore: 2322423314d92f946219c8791674d2f3345b598f
FirebaseCoreInternal: b444828ea7cfd594fca83046b95db98a2be4f290
FirebaseCoreInternal: efeeb171ac02d623bdaefe121539939821e10811
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
google_sign_in_ios: 1bfaf6607b44cd1b24c4d4bc39719870440f9ce1
GoogleSignIn: b232380cf495a429b8095d3178a8d5855b42e842
GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
GTMAppAuth: 99fb010047ba3973b7026e45393f51f27ab965ae
GTMSessionFetcher: 41b9ef0b4c08a6db4b7eb51a21ae5183ec99a2c8
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/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
331C8080294A63A400263BE5 = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
44 changes: 44 additions & 0 deletions app/lib/components/action_sheet.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
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';

class AppSheetAction extends StatelessWidget {
final String title;
final Widget? icon;
final bool enable;
final void Function() onPressed;

const AppSheetAction({
super.key,
required this.title,
this.icon,
required this.onPressed,
this.enable = true,
});

@override
Widget build(BuildContext context) {
return OnTapScale(
onTap: onPressed,
child: SizedBox(
height: 45,
width: double.infinity,
child: Row(
children: [
icon ?? const SizedBox(),
if (icon != null) const SizedBox(width: 16),
Text(
title,
style: AppTextStyles.subtitle2.copyWith(
color: enable
? context.colorScheme.textPrimary
: context.colorScheme.textDisabled,
),
),
],
),
),
);
}
}
29 changes: 29 additions & 0 deletions app/lib/components/app_sheet.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import 'package:flutter/material.dart';
import 'package:style/extensions/context_extensions.dart';

Future<T?> showAppSheet<T>(
{required BuildContext context, required Widget child}) {
return showModalBottomSheet(
backgroundColor: context.colorScheme.containerNormalOnSurface,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(22),
),
context: context,
builder: (context) {
return Container(
width: context.mediaQuerySize.width,
decoration: BoxDecoration(
color: context.colorScheme.containerNormalOnSurface,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(22),
topRight: Radius.circular(22),
),
),
padding: const EdgeInsets.all(16),
child: SafeArea(
child: child,
),
);
},
);
}
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ class Assets {

class Images {
String get appIcon => 'assets/images/app_logo.png';

Icons get icons => Icons();
}

class Icons {
String get googlePhotos => 'assets/images/icons/google_photos.svg';
}
26 changes: 26 additions & 0 deletions app/lib/domain/extensions/app_error_extensions.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'package:cloud_gallery/domain/extensions/context_extensions.dart';
import 'package:data/errors/app_error.dart';
import 'package:data/errors/l10n_error_codes.dart';
import 'package:flutter/cupertino.dart';

extension AppErrorExtensions on Object {
String l10nMessage(BuildContext context) {
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;
case AppErrorL10nCodes.googleSignInUserNotFoundError:
return context.l10n.user_google_sign_in_account_not_found_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;
}
}
}
6 changes: 6 additions & 0 deletions app/lib/domain/extensions/context_extensions.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

extension BuildContextExtensions on BuildContext {
AppLocalizations get l10n => AppLocalizations.of(this);
}
7 changes: 7 additions & 0 deletions app/lib/domain/extensions/widget_extensions.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'package:flutter/widgets.dart';

void runPostFrame(Function() block) {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
block();
});
}
17 changes: 0 additions & 17 deletions app/lib/extensions/app_error_extensions.dart

This file was deleted.

Loading
Loading