Skip to content

Commit

Permalink
Enhancement home view (#20)
Browse files Browse the repository at this point in the history
* Show media list from different sources

* Enhancement home view
  • Loading branch information
cp-pratik-k authored Mar 6, 2024
1 parent a12d018 commit dfc751b
Show file tree
Hide file tree
Showing 39 changed files with 1,600 additions and 1,396 deletions.
270 changes: 216 additions & 54 deletions .idea/libraries/Dart_Packages.xml

Large diffs are not rendered by default.

17 changes: 13 additions & 4 deletions .idea/libraries/Flutter_Plugins.xml

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

59 changes: 42 additions & 17 deletions app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ PODS:
- AppAuth/Core (1.6.2)
- AppAuth/ExternalUserAgent (1.6.2):
- AppAuth/Core
- Firebase/CoreOnly (10.18.0):
- FirebaseCore (= 10.18.0)
- firebase_core (2.24.2):
- Firebase/CoreOnly (= 10.18.0)
- Firebase/CoreOnly (10.20.0):
- FirebaseCore (= 10.20.0)
- firebase_core (2.25.5):
- Firebase/CoreOnly (= 10.20.0)
- Flutter
- FirebaseCore (10.18.0):
- FirebaseCore (10.20.0):
- FirebaseCoreInternal (~> 10.0)
- GoogleUtilities/Environment (~> 7.12)
- GoogleUtilities/Logger (~> 7.12)
- FirebaseCoreInternal (10.20.0):
- FirebaseCoreInternal (10.22.0):
- "GoogleUtilities/NSData+zlib (~> 7.8)"
- Flutter (1.0.0)
- fluttertoast (0.0.2):
Expand All @@ -28,37 +28,53 @@ PODS:
- AppAuth (~> 1.5)
- GTMAppAuth (< 3.0, >= 1.3)
- GTMSessionFetcher/Core (< 4.0, >= 1.1)
- GoogleUtilities/Environment (7.12.0):
- GoogleUtilities/Environment (7.13.0):
- GoogleUtilities/Privacy
- PromisesObjC (< 3.0, >= 1.2)
- GoogleUtilities/Logger (7.12.0):
- GoogleUtilities/Logger (7.13.0):
- GoogleUtilities/Environment
- "GoogleUtilities/NSData+zlib (7.12.0)"
- GoogleUtilities/Privacy
- "GoogleUtilities/NSData+zlib (7.13.0)":
- GoogleUtilities/Privacy
- GoogleUtilities/Privacy (7.13.0)
- GTMAppAuth (2.0.0):
- AppAuth/Core (~> 1.6)
- GTMSessionFetcher/Core (< 4.0, >= 1.5)
- GTMSessionFetcher/Core (3.3.1)
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- permission_handler_apple (9.3.0):
- Flutter
- photo_manager (2.0.0):
- Flutter
- FlutterMacOS
- PromisesObjC (2.3.1)
- PromisesObjC (2.4.0)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sqflite (0.0.3):
- Flutter
- FlutterMacOS
- Toast (4.1.0)
- video_player_avfoundation (0.0.1):
- Flutter
- FlutterMacOS

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`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/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`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)

SPEC REPOS:
trunk:
Expand All @@ -84,32 +100,41 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/google_sign_in_ios/darwin"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
photo_manager:
:path: ".symlinks/plugins/photo_manager/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite:
:path: ".symlinks/plugins/sqflite/darwin"
video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/darwin"

SPEC CHECKSUMS:
AppAuth: 3bb1d1cd9340bd09f5ed189fb00b1cc28e1e8570
Firebase: 414ad272f8d02dfbf12662a9d43f4bba9bec2a06
firebase_core: 0af4a2b24f62071f9bf283691c0ee41556dcb3f5
FirebaseCore: 2322423314d92f946219c8791674d2f3345b598f
FirebaseCoreInternal: efeeb171ac02d623bdaefe121539939821e10811
Firebase: 10c8cb12fb7ad2ae0c09ffc86cd9c1ab392a0031
firebase_core: c8628c7ce80f79439149549052bff22f6784fbf5
FirebaseCore: 28045c1560a2600d284b9c45a904fe322dc890b6
FirebaseCoreInternal: bca337352024b18424a61e478460547d46c4c753
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
google_sign_in_ios: 1bfaf6607b44cd1b24c4d4bc39719870440f9ce1
google_sign_in_ios: 989eea5abe94af62050782714daf920be883d4a2
GoogleSignIn: b232380cf495a429b8095d3178a8d5855b42e842
GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34
GoogleUtilities: d053d902a8edaa9904e1bd00c37535385b8ed152
GTMAppAuth: 99fb010047ba3973b7026e45393f51f27ab965ae
GTMSessionFetcher: 8a1b34ad97ebe6f909fb8b9b77fba99943007556
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
permission_handler_apple: 036b856153a2b1f61f21030ff725f3e6fece2b78
photo_manager: 4f6810b7dfc4feb03b461ac1a70dacf91fba7604
PromisesObjC: c50d2056b5253dadbd6c2bea79b0674bd5a52fa4
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
Toast: ec33c32b8688982cecc6348adeae667c1b9938da
video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579

PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796

Expand Down
39 changes: 39 additions & 0 deletions app/lib/components/resume_detector.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import 'package:flutter/cupertino.dart';
import 'package:visibility_detector/visibility_detector.dart';

class ResumeDetector extends StatefulWidget {
final Function() onResume;
final Widget child;

const ResumeDetector({
super.key,
required this.onResume,
required this.child,
});

@override
State<ResumeDetector> createState() => _ResumeDetectorState();
}

class _ResumeDetectorState extends State<ResumeDetector> {
final Key _key = UniqueKey();

var _lastNotifiedTime = DateTime.now();

@override
Widget build(BuildContext context) {
return VisibilityDetector(
key: _key,
child: widget.child,
onVisibilityChanged: (info) {
if (info.visibleFraction == 1) {
if (DateTime.now().difference(_lastNotifiedTime).inMilliseconds >
1000) {
widget.onResume();
_lastNotifiedTime = DateTime.now();
}
}
},
);
}
}
8 changes: 4 additions & 4 deletions app/lib/domain/assets/assets_paths.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
class Assets {
static Images images = Images();
static PathImages images = PathImages();
}

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

Icons get icons => Icons();
PathIcons get icons => PathIcons();
}

class Icons {
class PathIcons {
String get googlePhotos => 'assets/images/icons/google_photos.svg';
}
3 changes: 3 additions & 0 deletions app/lib/domain/extensions/date_extensions.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
extension DateTimeExtensions on DateTime {
DateTime get dateOnly => DateTime(year, month, day);
}
8 changes: 7 additions & 1 deletion app/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import 'dart:async';
import 'dart:io';
import 'package:cloud_gallery/firebase_options.dart';
import 'package:data/storage/provider/preferences_provider.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_displaymode/flutter_displaymode.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'ui/app.dart';

Future<void> main() async {

WidgetsFlutterBinding.ensureInitialized();

await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);

if (Platform.isAndroid) {
// Workaround for https://github.com/flutter/flutter/issues/35162
await FlutterDisplayMode.setHighRefreshRate();
}

final container = await _configureContainerWithAsyncDependency();

runApp(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ part of 'accounts_screen_view_model.dart';
T _$identity<T>(T value) => value;

final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');

/// @nodoc
mixin _$AccountsState {
Expand Down
Loading

0 comments on commit dfc751b

Please sign in to comment.