From d015b9e20d608d11458e54ea1e8db8f110f2fed3 Mon Sep 17 00:00:00 2001 From: Furkan Date: Sun, 1 Jan 2023 10:09:43 +0300 Subject: [PATCH] The problem at collectGallery function has solved --- .flutter-plugins-dependencies | 2 +- CHANGELOG.md | 4 ++++ example/pubspec.lock | 2 +- lib/models/gallery_album.dart | 8 ++++++-- lib/user_widgets/album_media_view.dart | 3 +-- pubspec.yaml | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index d4747b1..4c25fd7 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"permission_handler_apple","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler_apple-9.0.7\\\\","native_build":true,"dependencies":[]},{"name":"photo_gallery","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\photo_gallery-1.1.1\\\\","native_build":true,"dependencies":[]},{"name":"video_player_avfoundation","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\video_player_avfoundation-2.3.8\\\\","native_build":true,"dependencies":[]},{"name":"video_thumbnail","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\video_thumbnail-0.5.3\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"permission_handler_android","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler_android-10.2.0\\\\","native_build":true,"dependencies":[]},{"name":"photo_gallery","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\photo_gallery-1.1.1\\\\","native_build":true,"dependencies":[]},{"name":"video_player_android","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\video_player_android-2.3.10\\\\","native_build":true,"dependencies":[]},{"name":"video_thumbnail","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\video_thumbnail-0.5.3\\\\","native_build":true,"dependencies":[]}],"macos":[],"linux":[],"windows":[{"name":"permission_handler_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler_windows-0.1.2\\\\","native_build":true,"dependencies":[]}],"web":[{"name":"video_player_web","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\video_player_web-2.0.13\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_windows","dependencies":[]},{"name":"photo_gallery","dependencies":[]},{"name":"video_player","dependencies":["video_player_android","video_player_avfoundation","video_player_web"]},{"name":"video_player_android","dependencies":[]},{"name":"video_player_avfoundation","dependencies":[]},{"name":"video_player_web","dependencies":[]},{"name":"video_thumbnail","dependencies":[]}],"date_created":"2022-12-31 16:57:23.047798","version":"3.3.10"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"permission_handler_apple","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler_apple-9.0.7\\\\","native_build":true,"dependencies":[]},{"name":"photo_gallery","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\photo_gallery-1.1.1\\\\","native_build":true,"dependencies":[]},{"name":"video_player_avfoundation","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\video_player_avfoundation-2.3.8\\\\","native_build":true,"dependencies":[]},{"name":"video_thumbnail","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\video_thumbnail-0.5.3\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"permission_handler_android","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler_android-10.2.0\\\\","native_build":true,"dependencies":[]},{"name":"photo_gallery","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\photo_gallery-1.1.1\\\\","native_build":true,"dependencies":[]},{"name":"video_player_android","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\video_player_android-2.3.10\\\\","native_build":true,"dependencies":[]},{"name":"video_thumbnail","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\video_thumbnail-0.5.3\\\\","native_build":true,"dependencies":[]}],"macos":[],"linux":[],"windows":[{"name":"permission_handler_windows","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\permission_handler_windows-0.1.2\\\\","native_build":true,"dependencies":[]}],"web":[{"name":"video_player_web","path":"C:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\video_player_web-2.0.13\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_windows","dependencies":[]},{"name":"photo_gallery","dependencies":[]},{"name":"video_player","dependencies":["video_player_android","video_player_avfoundation","video_player_web"]},{"name":"video_player_android","dependencies":[]},{"name":"video_player_avfoundation","dependencies":[]},{"name":"video_player_web","dependencies":[]},{"name":"video_thumbnail","dependencies":[]}],"date_created":"2023-01-01 10:09:14.777712","version":"3.3.10"} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f92502..8e883de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,3 +38,7 @@ * The widget called AlbumMediasView has changed to AlbumMediaView +## 0.1.0 + +* The problem at collectGallery function has solved + diff --git a/example/pubspec.lock b/example/pubspec.lock index 91d3426..5d2befd 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -141,7 +141,7 @@ packages: path: ".." relative: true source: path - version: "0.0.8" + version: "0.1.0" get: dependency: transitive description: diff --git a/lib/models/gallery_album.dart b/lib/models/gallery_album.dart index 751b007..ec9b523 100644 --- a/lib/models/gallery_album.dart +++ b/lib/models/gallery_album.dart @@ -82,7 +82,9 @@ class GalleryAlbum { dateCategories.expand((element) => element.files).toList(); String getDateCategory(Medium mediaFile) { - Config config = Get.find().config; + Config config = GetInstance().isRegistered() + ? Get.find().config + : Config(); if (daysBetween(mediaFile.lastDate!) <= 3) { return config.recent; } else if (daysBetween(mediaFile.lastDate!) > 3 && @@ -153,7 +155,9 @@ class DateCategory { DateCategory({required this.files, required this.name}); int getIndexOfCategory() { - Config config = Get.find().config; + Config config = GetInstance().isRegistered() + ? Get.find().config + : Config(); int index = [ config.recent, config.lastWeek, diff --git a/lib/user_widgets/album_media_view.dart b/lib/user_widgets/album_media_view.dart index a0369d6..74c038b 100644 --- a/lib/user_widgets/album_media_view.dart +++ b/lib/user_widgets/album_media_view.dart @@ -5,8 +5,7 @@ import 'date_category_view.dart'; // ignore: must_be_immutable class AlbumMediaView extends StatelessWidget { final TextStyle? textStyle; - const AlbumMediaView( - {super.key, required this.galleryAlbum, this.textStyle}); + const AlbumMediaView({super.key, required this.galleryAlbum, this.textStyle}); final GalleryAlbum galleryAlbum; @override Widget build(BuildContext context) { diff --git a/pubspec.yaml b/pubspec.yaml index 8739af2..54f4219 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: gallery_picker description: Gallery Picker is a flutter package that will allow you to pick media file(s), manage and navigate inside your gallery with modern tools and views. -version: 0.0.8 +version: 0.1.0 homepage: https://github.com/FlutterWay/gallery_picker environment: