-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* home view improvement * Implement upload media in google drive * Implement drive upload * Improve dashboard flow * Implement multi-selection done * get dependencies
- Loading branch information
1 parent
b6802dd
commit 7b48081
Showing
55 changed files
with
1,942 additions
and
228 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
), | ||
); | ||
}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.