-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Show media list from different sources * Enhancement home view
- Loading branch information
1 parent
a12d018
commit dfc751b
Showing
39 changed files
with
1,600 additions
and
1,396 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
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,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(); | ||
} | ||
} | ||
}, | ||
); | ||
} | ||
} |
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,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'; | ||
} |
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,3 @@ | ||
extension DateTimeExtensions on DateTime { | ||
DateTime get dateOnly => DateTime(year, month, day); | ||
} |
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
Oops, something went wrong.