version 0.5.0

This commit is contained in:
worldwidee 2024-02-24 22:33:52 +03:00
parent 340fdf0e41
commit 34a7382193
15 changed files with 232 additions and 180 deletions

View File

@ -1,12 +1,13 @@
# This is a generated file; do not edit or check into version control. # This is a generated file; do not edit or check into version control.
device_info_plus=C:\\Users\\MrWorldwide\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\device_info_plus-9.0.2\\ device_info_plus=C:\\Users\\yazil\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\device_info_plus-9.1.2\\
permission_handler=C:\\Users\\MrWorldwide\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler-10.4.3\\ permission_handler=C:\\Users\\yazil\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler-11.3.0\\
permission_handler_android=C:\\Users\\MrWorldwide\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler_android-10.3.2\\ permission_handler_android=C:\\Users\\yazil\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler_android-12.0.5\\
permission_handler_apple=C:\\Users\\MrWorldwide\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler_apple-9.1.4\\ permission_handler_apple=C:\\Users\\yazil\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler_apple-9.4.0\\
permission_handler_windows=C:\\Users\\MrWorldwide\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler_windows-0.1.3\\ permission_handler_html=C:\\Users\\yazil\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler_html-0.1.1\\
photo_gallery=C:\\Users\\MrWorldwide\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\photo_gallery-1.2.2\\ permission_handler_windows=C:\\Users\\yazil\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\permission_handler_windows-0.2.1\\
video_player=C:\\Users\\MrWorldwide\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\video_player-2.7.0\\ photo_gallery=C:\\Users\\yazil\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\photo_gallery-2.1.1\\
video_player_android=C:\\Users\\MrWorldwide\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\video_player_android-2.4.4\\ video_player=C:\\Users\\yazil\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\video_player-2.8.2\\
video_player_avfoundation=C:\\Users\\MrWorldwide\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\video_player_avfoundation-2.4.3\\ video_player_android=C:\\Users\\yazil\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\video_player_android-2.4.4\\
video_player_web=C:\\Users\\MrWorldwide\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\video_player_web-2.0.16\\ video_player_avfoundation=C:\\Users\\yazil\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\video_player_avfoundation-2.5.6\\
video_thumbnail=C:\\Users\\MrWorldwide\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\video_thumbnail-0.5.3\\ video_player_web=C:\\Users\\yazil\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\video_player_web-2.0.16\\
video_thumbnail=C:\\Users\\yazil\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\video_thumbnail-0.5.3\\

View File

@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.2\\\\","native_build":true,"dependencies":[]},{"name":"permission_handler_apple","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_apple-9.1.4\\\\","native_build":true,"dependencies":[]},{"name":"photo_gallery","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\photo_gallery-1.2.2\\\\","native_build":true,"dependencies":[]},{"name":"video_player_avfoundation","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\video_player_avfoundation-2.4.3\\\\","native_build":true,"dependencies":[]},{"name":"video_thumbnail","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\video_thumbnail-0.5.3\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"device_info_plus","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.2\\\\","native_build":true,"dependencies":[]},{"name":"permission_handler_android","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_android-10.3.2\\\\","native_build":true,"dependencies":[]},{"name":"photo_gallery","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\photo_gallery-1.2.2\\\\","native_build":true,"dependencies":[]},{"name":"video_player_android","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\video_player_android-2.4.4\\\\","native_build":true,"dependencies":[]},{"name":"video_thumbnail","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\video_thumbnail-0.5.3\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"device_info_plus","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.2\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.2\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"device_info_plus","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.2\\\\","native_build":false,"dependencies":[]},{"name":"permission_handler_windows","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_windows-0.1.3\\\\","native_build":true,"dependencies":[]}],"web":[{"name":"device_info_plus","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.2\\\\","dependencies":[]},{"name":"video_player_web","path":"C:\\\\Users\\\\MrWorldwide\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\video_player_web-2.0.16\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"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-07-15 17:18:37.480668","version":"3.10.5"} {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.2\\\\","native_build":true,"dependencies":[]},{"name":"permission_handler_apple","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_apple-9.4.0\\\\","native_build":true,"dependencies":[]},{"name":"photo_gallery","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\photo_gallery-2.1.1\\\\","native_build":true,"dependencies":[]},{"name":"video_player_avfoundation","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\video_player_avfoundation-2.5.6\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"video_thumbnail","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\video_thumbnail-0.5.3\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"device_info_plus","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.2\\\\","native_build":true,"dependencies":[]},{"name":"permission_handler_android","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_android-12.0.5\\\\","native_build":true,"dependencies":[]},{"name":"photo_gallery","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\photo_gallery-2.1.1\\\\","native_build":true,"dependencies":[]},{"name":"video_player_android","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\video_player_android-2.4.4\\\\","native_build":true,"dependencies":[]},{"name":"video_thumbnail","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\video_thumbnail-0.5.3\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"device_info_plus","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.2\\\\","native_build":true,"dependencies":[]},{"name":"video_player_avfoundation","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\video_player_avfoundation-2.5.6\\\\","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.2\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"device_info_plus","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.2\\\\","native_build":false,"dependencies":[]},{"name":"permission_handler_windows","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_windows-0.2.1\\\\","native_build":true,"dependencies":[]}],"web":[{"name":"device_info_plus","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.1.2\\\\","dependencies":[]},{"name":"permission_handler_html","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\permission_handler_html-0.1.1\\\\","dependencies":[]},{"name":"video_player_web","path":"C:\\\\Users\\\\yazil\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\video_player_web-2.0.16\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_html","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_html","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":"2024-02-24 22:30:01.592785","version":"3.19.0"}

View File

@ -174,4 +174,12 @@
* Fixed permission issue for android sdk 33 and above. * Fixed permission issue for android sdk 33 and above.
* https://github.com/FlutterWay/gallery_picker/issues/1 is fix * https://github.com/FlutterWay/gallery_picker/issues/1 is fix
## 0.5.0
* list named months has been removed from Config model because now it automatically adjusts itself according to the locale value. or you can give the locale yourself
* Locale parameter added to GalleryPicker's functions
* kotlin version upgraded
* version of packages upgraded

View File

@ -1,5 +1,5 @@
buildscript { buildscript {
ext.kotlin_version = '1.6.10' ext.kotlin_version = '1.9.0'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()

View File

@ -1,8 +1,8 @@
// ignore: depend_on_referenced_packages
import 'package:camera/camera.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// ignore: depend_on_referenced_packages // ignore: depend_on_referenced_packages
import 'package:gallery_picker/gallery_picker.dart'; import 'package:gallery_picker/gallery_picker.dart';
// ignore: depend_on_referenced_packages
import 'package:camera/camera.dart';
import 'package:gallery_picker_example/examples/multiple_medias.dart'; import 'package:gallery_picker_example/examples/multiple_medias.dart';
class WhatsappPickPhoto extends StatefulWidget { class WhatsappPickPhoto extends StatefulWidget {
@ -32,7 +32,7 @@ class _WhatsappPickPhotoState extends State<WhatsappPickPhoto> {
} }
Future<void> fetchMedias() async { Future<void> fetchMedias() async {
gallery = await GalleryPicker.initializeGallery; gallery = await GalleryPicker.initializeGallery();
setState(() {}); setState(() {});
} }

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// ignore: depend_on_referenced_packages // ignore: depend_on_referenced_packages
import 'package:gallery_picker/gallery_picker.dart'; import 'package:gallery_picker/gallery_picker.dart';
import 'examples/multiple_medias.dart'; import 'examples/multiple_medias.dart';
void main() { void main() {
@ -227,6 +228,7 @@ class _MyHomePageState extends State<MyHomePage> {
Future<void> getGalleryMedia() async { Future<void> getGalleryMedia() async {
// ignore: unused_local_variable // ignore: unused_local_variable
GalleryMedia? allmedia = await GalleryPicker.collectGallery; GalleryMedia? allmedia =
await GalleryPicker.collectGallery(locale: const Locale("tr"));
} }
} }

View File

@ -21,10 +21,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: bottom_sheet_scaffold name: bottom_sheet_scaffold
sha256: d34341831cf9ec8d42f28ca094a0362d7914f83e580d50405f340d24a1a37c9e sha256: "9bb9d4c8d3854b6e22c47c819b6e119e50dc4fbbec89e03a357888c1ced7b5bf"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.1.6" version: "0.1.9"
camera: camera:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -85,10 +85,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: collection name: collection
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.17.1" version: "1.18.0"
cross_file: cross_file:
dependency: transitive dependency: transitive
description: description:
@ -109,18 +109,18 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: cupertino_icons name: cupertino_icons
sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.5" version: "1.0.6"
device_info_plus: device_info_plus:
dependency: transitive dependency: transitive
description: description:
name: device_info_plus name: device_info_plus
sha256: "2c35b6d1682b028e42d07b3aee4b98fa62996c10bc12cb651ec856a80d6a761b" sha256: "77f757b789ff68e4eaf9c56d1752309bd9f7ad557cb105b938a7f8eb89e59110"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "9.0.2" version: "9.1.2"
device_info_plus_platform_interface: device_info_plus_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -190,15 +190,15 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "0.4.8" version: "0.4.9"
get: get:
dependency: transitive dependency: transitive
description: description:
name: get name: get
sha256: "2ba20a47c8f1f233bed775ba2dd0d3ac97b4cf32fc17731b3dfc672b06b0e92a" sha256: e4e7335ede17452b391ed3b2ede016545706c01a02292a6c97619705e7d2a85e
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.6.5" version: "4.6.6"
html: html:
dependency: transitive dependency: transitive
description: description:
@ -211,10 +211,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: intl name: intl
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.18.1" version: "0.19.0"
js: js:
dependency: transitive dependency: transitive
description: description:
@ -223,6 +223,30 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.6.7" version: "0.6.7"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
url: "https://pub.dev"
source: hosted
version: "2.0.1"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
url: "https://pub.dev"
source: hosted
version: "2.0.1"
lints: lints:
dependency: transitive dependency: transitive
description: description:
@ -235,90 +259,98 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.12.15" version: "0.12.16+1"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.2.0" version: "0.8.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.1" version: "1.11.0"
page_transition: page_transition:
dependency: transitive dependency: transitive
description: description:
name: page_transition name: page_transition
sha256: a7694bc120b7064a7f57c336914bb8885acf4f70bb3772c30c2fcfe6a85e43ff sha256: dee976b1f23de9bbef5cd512fe567e9f6278caee11f5eaca9a2115c19dc49ef6
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.9" version: "2.1.0"
path: path:
dependency: transitive dependency: transitive
description: description:
name: path name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.8.3" version: "1.9.0"
permission_handler: permission_handler:
dependency: transitive dependency: transitive
description: description:
name: permission_handler name: permission_handler
sha256: "63e5216aae014a72fe9579ccd027323395ce7a98271d9defa9d57320d001af81" sha256: "74e962b7fad7ff75959161bb2c0ad8fe7f2568ee82621c9c2660b751146bfe44"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.4.3" version: "11.3.0"
permission_handler_android: permission_handler_android:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_android name: permission_handler_android
sha256: c0c9754479a4c4b1c1f3862ddc11930c9b3f03bef2816bb4ea6eed1e13551d6f sha256: "1acac6bae58144b442f11e66621c062aead9c99841093c38f5bcdcc24c1c3474"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "10.3.2" version: "12.0.5"
permission_handler_apple: permission_handler_apple:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_apple name: permission_handler_apple
sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5" sha256: bdafc6db74253abb63907f4e357302e6bb786ab41465e8635f362ee71fd8707b
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "9.1.4" version: "9.4.0"
permission_handler_html:
dependency: transitive
description:
name: permission_handler_html
sha256: "54bf176b90f6eddd4ece307e2c06cf977fb3973719c35a93b85cc7093eb6070d"
url: "https://pub.dev"
source: hosted
version: "0.1.1"
permission_handler_platform_interface: permission_handler_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_platform_interface name: permission_handler_platform_interface
sha256: "7c6b1500385dd1d2ca61bb89e2488ca178e274a69144d26bbd65e33eae7c02a9" sha256: "23dfba8447c076ab5be3dee9ceb66aad345c4a648f0cac292c77b1eb0e800b78"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.11.3" version: "4.2.0"
permission_handler_windows: permission_handler_windows:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_windows name: permission_handler_windows
sha256: cc074aace208760f1eee6aa4fae766b45d947df85bc831cde77009cdb4720098 sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.1.3" version: "0.2.1"
photo_gallery: photo_gallery:
dependency: transitive dependency: transitive
description: description:
name: photo_gallery name: photo_gallery
sha256: f8daca29042710ba2836a0666f0d18b320e286b5843dcd68d6f1980a2de0c8b2 sha256: "711e25c7fcd0364665e5381819c68fbce2bd398c1411a61167b724c6d05bda35"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.2" version: "2.1.1"
plugin_platform_interface: plugin_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -344,26 +376,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: source_span name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.1" version: "1.10.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
name: stack_trace name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.11.0" version: "1.11.1"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
name: stream_channel name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
stream_transform: stream_transform:
dependency: transitive dependency: transitive
description: description:
@ -392,10 +424,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.5.1" version: "0.6.1"
transparent_image: transparent_image:
dependency: transitive dependency: transitive
description: description:
@ -416,10 +448,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: video_player name: video_player
sha256: "3fd106c74da32f336dc7feb65021da9b0207cb3124392935f1552834f7cce822" sha256: fbf28ce8bcfe709ad91b5789166c832cb7a684d14f571a81891858fefb5bb1c2
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.7.0" version: "2.8.2"
video_player_android: video_player_android:
dependency: transitive dependency: transitive
description: description:
@ -432,10 +464,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: video_player_avfoundation name: video_player_avfoundation
sha256: af308d08c672d5ff718c60127665249617c37a709cb8f0a18dd28a0360299b7c sha256: "309e3962795e761be010869bae65c0b0e45b5230c5cee1bec72197ca7db040ed"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.3" version: "2.5.6"
video_player_platform_interface: video_player_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -460,6 +492,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.5.3" version: "0.5.3"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
url: "https://pub.dev"
source: hosted
version: "13.0.0"
win32: win32:
dependency: transitive dependency: transitive
description: description:
@ -477,5 +517,5 @@ packages:
source: hosted source: hosted
version: "1.1.1" version: "1.1.1"
sdks: sdks:
dart: ">=3.0.0 <4.0.0" dart: ">=3.2.0 <4.0.0"
flutter: ">=3.3.0" flutter: ">=3.16.0"

View File

@ -9,11 +9,11 @@ import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:photo_gallery/photo_gallery.dart'; import 'package:photo_gallery/photo_gallery.dart';
import '/models/gallery_album.dart';
import '/models/medium.dart';
import '../models/config.dart'; import '../models/config.dart';
import '../models/gallery_media.dart'; import '../models/gallery_media.dart';
import '../models/media_file.dart'; import '../models/media_file.dart';
import '/models/gallery_album.dart';
import '/models/medium.dart';
import 'picker_listener.dart'; import 'picker_listener.dart';
class PhoneGalleryController extends GetxController { class PhoneGalleryController extends GetxController {
@ -206,8 +206,8 @@ class PhoneGalleryController extends GetxController {
return false; return false;
} }
Future<void> initializeAlbums() async { Future<void> initializeAlbums({Locale? locale}) async {
_media = await PhoneGalleryController.collectGallery; _media = await PhoneGalleryController.collectGallery(locale: locale);
if (_media != null) { if (_media != null) {
if (_extraRecentMedia != null) { if (_extraRecentMedia != null) {
GalleryAlbum? recentTmp = recent; GalleryAlbum? recentTmp = recent;
@ -220,15 +220,15 @@ class PhoneGalleryController extends GetxController {
_isInitialized = true; _isInitialized = true;
} else { } else {
permissionGranted = false; permissionGranted = false;
permissionListener(); permissionListener(locale: locale);
} }
update(); update();
} }
void permissionListener() { void permissionListener({Locale? locale}) {
Timer.periodic(const Duration(seconds: 1), (timer) async { Timer.periodic(const Duration(seconds: 1), (timer) async {
if (await isGranted()) { if (await isGranted()) {
initializeAlbums(); initializeAlbums(locale: locale);
timer.cancel(); timer.cancel();
} }
}); });
@ -252,7 +252,7 @@ class PhoneGalleryController extends GetxController {
(await Permission.photos.isGranted); (await Permission.photos.isGranted);
} }
static Future<GalleryMedia?> get collectGallery async { static Future<GalleryMedia?> collectGallery({Locale? locale}) async {
if (await promptPermissionSetting()) { if (await promptPermissionSetting()) {
List<GalleryAlbum> tempGalleryAlbums = []; List<GalleryAlbum> tempGalleryAlbums = [];
@ -262,13 +262,13 @@ class PhoneGalleryController extends GetxController {
await PhotoGallery.listAlbums(mediumType: MediumType.video); await PhotoGallery.listAlbums(mediumType: MediumType.video);
for (var photoAlbum in photoAlbums) { for (var photoAlbum in photoAlbums) {
GalleryAlbum entireGalleryAlbum = GalleryAlbum.album(photoAlbum); GalleryAlbum entireGalleryAlbum = GalleryAlbum.album(photoAlbum);
await entireGalleryAlbum.initialize(); await entireGalleryAlbum.initialize(locale: locale);
entireGalleryAlbum.setType = AlbumType.image; entireGalleryAlbum.setType = AlbumType.image;
if (videoAlbums.any((element) => element.id == photoAlbum.id)) { if (videoAlbums.any((element) => element.id == photoAlbum.id)) {
Album videoAlbum = Album videoAlbum =
videoAlbums.singleWhere((element) => element.id == photoAlbum.id); videoAlbums.singleWhere((element) => element.id == photoAlbum.id);
GalleryAlbum videoGalleryAlbum = GalleryAlbum.album(videoAlbum); GalleryAlbum videoGalleryAlbum = GalleryAlbum.album(videoAlbum);
await videoGalleryAlbum.initialize(); await videoGalleryAlbum.initialize(locale: locale);
DateTime? lastPhotoDate = entireGalleryAlbum.lastDate; DateTime? lastPhotoDate = entireGalleryAlbum.lastDate;
DateTime? lastVideoDate = videoGalleryAlbum.lastDate; DateTime? lastVideoDate = videoGalleryAlbum.lastDate;
@ -296,7 +296,7 @@ class PhoneGalleryController extends GetxController {
} }
} }
for (var file in videoGalleryAlbum.files) { for (var file in videoGalleryAlbum.files) {
entireGalleryAlbum.addFile(file); entireGalleryAlbum.addFile(file, locale: locale);
} }
entireGalleryAlbum.sort(); entireGalleryAlbum.sort();
entireGalleryAlbum.setType = AlbumType.mixed; entireGalleryAlbum.setType = AlbumType.mixed;
@ -306,7 +306,7 @@ class PhoneGalleryController extends GetxController {
} }
for (var videoAlbum in videoAlbums) { for (var videoAlbum in videoAlbums) {
GalleryAlbum galleryVideoAlbum = GalleryAlbum.album(videoAlbum); GalleryAlbum galleryVideoAlbum = GalleryAlbum.album(videoAlbum);
await galleryVideoAlbum.initialize(); await galleryVideoAlbum.initialize(locale: locale);
galleryVideoAlbum.setType = AlbumType.video; galleryVideoAlbum.setType = AlbumType.video;
tempGalleryAlbums.add(galleryVideoAlbum); tempGalleryAlbums.add(galleryVideoAlbum);
} }

View File

@ -1,36 +1,39 @@
library gallery_picker; library gallery_picker;
export 'models/config.dart';
export 'models/media_file.dart';
export 'models/mode.dart';
export 'models/medium.dart';
export 'models/gallery_media.dart';
export 'models/gallery_album.dart';
export 'package:page_transition/src/enum.dart';
export 'user_widgets/thumbnail_media.dart';
export 'user_widgets/album_categories_view.dart';
export 'user_widgets/album_media_view.dart';
export 'user_widgets/date_category_view.dart';
export 'user_widgets/thumbnail_album.dart';
export 'user_widgets/gallery_picker_builder.dart';
export 'user_widgets/photo_provider.dart';
export 'user_widgets/video_provider.dart';
export 'user_widgets/media_provider.dart';
export 'views/picker_scaffold.dart';
export 'package:bottom_sheet_scaffold/models/sheet_status.dart';
export 'package:bottom_sheet_scaffold/views/bottom_sheet_builder.dart';
export 'views/gallery_picker_view/gallery_picker_view.dart';
import 'package:bottom_sheet_scaffold/bottom_sheet_scaffold.dart'; import 'package:bottom_sheet_scaffold/bottom_sheet_scaffold.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gallery_picker/models/gallery_media.dart'; import 'package:gallery_picker/models/gallery_media.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:page_transition/page_transition.dart'; import 'package:page_transition/page_transition.dart';
import '../../controller/gallery_controller.dart'; import '../../controller/gallery_controller.dart';
import 'controller/picker_listener.dart'; import 'controller/picker_listener.dart';
import 'models/config.dart'; import 'models/config.dart';
import 'models/media_file.dart'; import 'models/media_file.dart';
import 'views/gallery_picker_view/gallery_picker_view.dart'; import 'views/gallery_picker_view/gallery_picker_view.dart';
export 'package:bottom_sheet_scaffold/models/sheet_status.dart';
export 'package:bottom_sheet_scaffold/views/bottom_sheet_builder.dart';
export 'package:page_transition/src/enum.dart';
export 'models/config.dart';
export 'models/gallery_album.dart';
export 'models/gallery_media.dart';
export 'models/media_file.dart';
export 'models/medium.dart';
export 'models/mode.dart';
export 'user_widgets/album_categories_view.dart';
export 'user_widgets/album_media_view.dart';
export 'user_widgets/date_category_view.dart';
export 'user_widgets/gallery_picker_builder.dart';
export 'user_widgets/media_provider.dart';
export 'user_widgets/photo_provider.dart';
export 'user_widgets/thumbnail_album.dart';
export 'user_widgets/thumbnail_media.dart';
export 'user_widgets/video_provider.dart';
export 'views/gallery_picker_view/gallery_picker_view.dart';
export 'views/picker_scaffold.dart';
class GalleryPicker { class GalleryPicker {
static Stream<List<MediaFile>> get listenSelectedFiles { static Stream<List<MediaFile>> get listenSelectedFiles {
var controller = Get.put(PickerListener()); var controller = Get.put(PickerListener());
@ -53,6 +56,7 @@ class GalleryPicker {
{Config? config, {Config? config,
bool startWithRecent = false, bool startWithRecent = false,
bool singleMedia = false, bool singleMedia = false,
Locale? locale,
PageTransitionType pageTransitionType = PageTransitionType.rightToLeft, PageTransitionType pageTransitionType = PageTransitionType.rightToLeft,
List<MediaFile>? initSelectedMedia, List<MediaFile>? initSelectedMedia,
List<MediaFile>? extraRecentMedia, List<MediaFile>? extraRecentMedia,
@ -67,6 +71,7 @@ class GalleryPicker {
media = mediaTmp; media = mediaTmp;
}, },
config: config, config: config,
locale: locale,
singleMedia: singleMedia, singleMedia: singleMedia,
initSelectedMedia: initSelectedMedia, initSelectedMedia: initSelectedMedia,
extraRecentMedia: extraRecentMedia, extraRecentMedia: extraRecentMedia,
@ -81,6 +86,7 @@ class GalleryPicker {
multipleMediaBuilder, multipleMediaBuilder,
Widget Function(String tag, MediaFile media, BuildContext context)? Widget Function(String tag, MediaFile media, BuildContext context)?
heroBuilder, heroBuilder,
Locale? locale,
bool singleMedia = false, bool singleMedia = false,
PageTransitionType pageTransitionType = PageTransitionType.rightToLeft, PageTransitionType pageTransitionType = PageTransitionType.rightToLeft,
List<MediaFile>? initSelectedMedia, List<MediaFile>? initSelectedMedia,
@ -93,6 +99,7 @@ class GalleryPicker {
type: pageTransitionType, type: pageTransitionType,
child: GalleryPickerView( child: GalleryPickerView(
onSelect: (media) {}, onSelect: (media) {},
locale: locale,
multipleMediaBuilder: multipleMediaBuilder, multipleMediaBuilder: multipleMediaBuilder,
heroBuilder: heroBuilder, heroBuilder: heroBuilder,
singleMedia: singleMedia, singleMedia: singleMedia,
@ -123,13 +130,13 @@ class GalleryPicker {
return BottomSheetPanel.isCollapsed; return BottomSheetPanel.isCollapsed;
} }
static Future<GalleryMedia?> get collectGallery async { static Future<GalleryMedia?> collectGallery({Locale? locale}) async {
return await PhoneGalleryController.collectGallery; return await PhoneGalleryController.collectGallery(locale: locale);
} }
static Future<GalleryMedia?> get initializeGallery async { static Future<GalleryMedia?> initializeGallery({Locale? locale}) async {
final controller = Get.put(PhoneGalleryController()); final controller = Get.put(PhoneGalleryController());
await controller.initializeAlbums(); await controller.initializeAlbums(locale: locale);
return controller.media; return controller.media;
} }
} }

View File

@ -21,7 +21,6 @@ class Config {
lastWeek, lastWeek,
tapPhotoSelect, tapPhotoSelect,
selected; selected;
List<String> months;
Mode mode; Mode mode;
Config( Config(
@ -42,20 +41,6 @@ class Config {
this.lastWeek = "Last Week", this.lastWeek = "Last Week",
this.tapPhotoSelect = "Tap photo to select", this.tapPhotoSelect = "Tap photo to select",
this.selected = "Selected", this.selected = "Selected",
this.months = const [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
this.mode = Mode.light, this.mode = Mode.light,
Widget? selectIcon}) { Widget? selectIcon}) {
if (backgroundColor == null) { if (backgroundColor == null) {

View File

@ -1,8 +1,12 @@
import 'dart:io';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:intl/date_symbol_data_local.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:photo_gallery/photo_gallery.dart'; import 'package:photo_gallery/photo_gallery.dart';
import '../controller/gallery_controller.dart'; import '../controller/gallery_controller.dart';
import '/models/media_file.dart'; import '/models/media_file.dart';
import '/models/medium.dart'; import '/models/medium.dart';
@ -46,18 +50,21 @@ class GalleryAlbum {
} }
} }
Future<void> initialize() async { Future<void> initialize({Locale? locale}) async {
List<DateCategory> dateCategory = []; List<DateCategory> dateCategory = [];
for (var medium in sortAlbumMediaDates((await album.listMedia()).items)) { for (var medium in sortAlbumMediaDates((await album.listMedia()).items)) {
MediaFile mediaFile = MediaFile.medium(medium); MediaFile mediaFile = MediaFile.medium(medium);
String name = getDateCategory(mediaFile); String name = getDateCategory(mediaFile, locale: locale);
if (dateCategory.any((element) => element.name == name)) { if (dateCategory.any((element) => element.name == name)) {
dateCategory dateCategory
.singleWhere((element) => element.name == name) .singleWhere((element) => element.name == name)
.files .files
.add(mediaFile); .add(mediaFile);
} else { } else {
dateCategory.add(DateCategory(files: [mediaFile], name: name)); DateTime? lastDate = mediaFile.lastModified;
lastDate = lastDate ?? DateTime.now();
dateCategory.add(
DateCategory(files: [mediaFile], name: name, dateTime: lastDate));
} }
} }
dateCategories = dateCategory; dateCategories = dateCategory;
@ -82,22 +89,28 @@ class GalleryAlbum {
List<MediaFile> get files => List<MediaFile> get files =>
dateCategories.expand((element) => element.files).toList(); dateCategories.expand((element) => element.files).toList();
String getDateCategory(MediaFile media) { String getDateCategory(MediaFile media, {Locale? locale}) {
Config config = GetInstance().isRegistered<PhoneGalleryController>() Config config = GetInstance().isRegistered<PhoneGalleryController>()
? Get.find<PhoneGalleryController>().config ? Get.find<PhoneGalleryController>().config
: Config(); : Config();
DateTime? lastDate = media.lastModified; DateTime? lastDate = media.lastModified;
lastDate = lastDate ?? DateTime.now(); lastDate = lastDate ?? DateTime.now();
initializeDateFormatting();
String languageCode = locale != null
? (locale).languageCode
: Platform.localeName.split('_')[0];
if (daysBetween(lastDate) <= 3) { if (daysBetween(lastDate) <= 3) {
return config.recent; return config.recent;
} else if (daysBetween(lastDate) > 3 && daysBetween(lastDate) <= 7) { } else if (daysBetween(lastDate) > 3 && daysBetween(lastDate) <= 7) {
return config.lastWeek; return config.lastWeek;
} else if (daysBetween(lastDate) > 7 && daysBetween(lastDate) <= 31) { } else if (DateTime.now().month == lastDate.month) {
return config.lastMonth; return config.lastMonth;
} else if (daysBetween(lastDate) > 31 && daysBetween(lastDate) <= 365) { } else if (DateTime.now().year == lastDate.year) {
return DateFormat.MMMM().format(lastDate).toString(); String month = DateFormat.MMMM(languageCode).format(lastDate).toString();
return "$month ${lastDate.day}";
} else { } else {
return DateFormat.y().format(lastDate).toString(); String month = DateFormat.MMMM(languageCode).format(lastDate).toString();
return "$month ${lastDate.day}, ${lastDate.year}";
} }
} }
@ -120,8 +133,7 @@ class GalleryAlbum {
} }
sort() { sort() {
dateCategories.sort( dateCategories.sort((a, b) => b.dateTime.compareTo(a.dateTime));
(a, b) => a.getIndexOfCategory().compareTo(b.getIndexOfCategory()));
for (var category in dateCategories) { for (var category in dateCategories) {
category.files.sort((a, b) { category.files.sort((a, b) {
@ -136,15 +148,18 @@ class GalleryAlbum {
} }
} }
void addFile(MediaFile file) { void addFile(MediaFile file, {Locale? locale}) {
String name = getDateCategory(file); String name = getDateCategory(file, locale: locale);
if (dateCategories.any((element) => element.name == name)) { if (dateCategories.any((element) => element.name == name)) {
dateCategories dateCategories
.singleWhere((element) => element.name == name) .singleWhere((element) => element.name == name)
.files .files
.add(file); .add(file);
} else { } else {
dateCategories.add(DateCategory(files: [file], name: name)); DateTime? lastDate = file.lastModified;
lastDate = lastDate ?? DateTime.now();
dateCategories
.add(DateCategory(files: [file], name: name, dateTime: lastDate));
} }
} }
} }
@ -152,24 +167,9 @@ class GalleryAlbum {
class DateCategory { class DateCategory {
String name; String name;
List<MediaFile> files; List<MediaFile> files;
DateCategory({required this.files, required this.name}); DateTime dateTime;
DateCategory(
int getIndexOfCategory() { {required this.files, required this.name, required this.dateTime});
Config config = GetInstance().isRegistered<PhoneGalleryController>()
? Get.find<PhoneGalleryController>().config
: Config();
int index = [
config.recent,
config.lastWeek,
config.lastMonth,
...config.months
].indexOf(name);
if (index == -1) {
return 3000 - int.parse(name);
} else {
return index;
}
}
} }
enum AlbumType { video, image, mixed } enum AlbumType { video, image, mixed }

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '/models/gallery_album.dart';
import '../../../controller/gallery_controller.dart'; import '../../../controller/gallery_controller.dart';
import '/models/gallery_album.dart';
import 'date_category_view.dart'; import 'date_category_view.dart';
import 'selected_medias_view.dart'; import 'selected_medias_view.dart';
@ -50,16 +51,21 @@ class AlbumMediasView extends StatelessWidget {
int index = categoriesTmp int index = categoriesTmp
.indexWhere((element) => element.name == controller.config.recent); .indexWhere((element) => element.name == controller.config.recent);
if (index != -1) { if (index != -1) {
DateCategory category = DateCategory(files: [ DateCategory category = DateCategory(
...controller.extraRecentMedia!, files: [
...categoriesTmp[index].files ...controller.extraRecentMedia!,
], name: categoriesTmp[index].name); ...categoriesTmp[index].files,
],
name: categoriesTmp[index].name,
dateTime: categoriesTmp[index].dateTime);
categoriesTmp[index] = category; categoriesTmp[index] = category;
return categoriesTmp; return categoriesTmp;
} else { } else {
return [ return [
DateCategory( DateCategory(
files: controller.extraRecentMedia!, files: controller.extraRecentMedia!,
dateTime: controller.extraRecentMedia!.first.lastModified ??
DateTime.now(),
name: controller.config.recent), name: controller.config.recent),
...categoriesTmp ...categoriesTmp
]; ];

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gallery_picker/views/album_view/album_appbar.dart'; import 'package:gallery_picker/views/album_view/album_appbar.dart';
import '../../../controller/gallery_controller.dart'; import '../../../controller/gallery_controller.dart';
import '../../../models/gallery_album.dart'; import '../../../models/gallery_album.dart';
import 'album_medias_view.dart'; import 'album_medias_view.dart';
@ -17,7 +18,11 @@ class AlbumPage extends StatelessWidget {
required this.isBottomSheet}); required this.isBottomSheet});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return PopScope(
canPop: false,
onPopInvoked: (value) {
controller.backToPicker();
},
child: Scaffold( child: Scaffold(
backgroundColor: controller.config.backgroundColor, backgroundColor: controller.config.backgroundColor,
appBar: album != null appBar: album != null
@ -39,10 +44,6 @@ class AlbumPage extends StatelessWidget {
"No Album Found", "No Album Found",
style: controller.config.textStyle, style: controller.config.textStyle,
)), )),
), ));
onWillPop: () async {
controller.backToPicker();
return false;
});
} }
} }

View File

@ -21,6 +21,7 @@ class GalleryPickerView extends StatefulWidget {
multipleMediaBuilder; multipleMediaBuilder;
final bool startWithRecent; final bool startWithRecent;
final bool isBottomSheet; final bool isBottomSheet;
final Locale? locale;
final List<MediaFile>? initSelectedMedia; final List<MediaFile>? initSelectedMedia;
final List<MediaFile>? extraRecentMedia; final List<MediaFile>? extraRecentMedia;
final bool singleMedia; final bool singleMedia;
@ -33,6 +34,7 @@ class GalleryPickerView extends StatefulWidget {
this.singleMedia = false, this.singleMedia = false,
this.isBottomSheet = false, this.isBottomSheet = false,
this.heroBuilder, this.heroBuilder,
this.locale,
this.multipleMediaBuilder, this.multipleMediaBuilder,
this.startWithRecent = false}); this.startWithRecent = false});
@ -73,7 +75,7 @@ class _GalleryPickerState extends State<GalleryPickerView> {
} }
config = galleryController.config; config = galleryController.config;
if (!galleryController.isInitialized) { if (!galleryController.isInitialized) {
galleryController.initializeAlbums(); galleryController.initializeAlbums(locale: widget.locale);
} }
super.initState(); super.initState();
} }
@ -95,7 +97,13 @@ class _GalleryPickerState extends State<GalleryPickerView> {
controller: controller.pageController, controller: controller.pageController,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
children: [ children: [
WillPopScope( PopScope(
canPop: true,
onPopInvoked: (value) {
if (!widget.isBottomSheet) {
controller.disposeController();
}
},
child: Scaffold( child: Scaffold(
backgroundColor: config.backgroundColor, backgroundColor: config.backgroundColor,
appBar: PickerAppBar( appBar: PickerAppBar(
@ -210,13 +218,7 @@ class _GalleryPickerState extends State<GalleryPickerView> {
), ),
], ],
), ),
), )),
onWillPop: () async {
if (!widget.isBottomSheet) {
controller.disposeController();
}
return true;
}),
AlbumPage( AlbumPage(
album: controller.selectedAlbum, album: controller.selectedAlbum,
controller: controller, controller: controller,
@ -243,7 +245,7 @@ class _GalleryPickerState extends State<GalleryPickerView> {
extraRecentMedia: widget.extraRecentMedia, extraRecentMedia: widget.extraRecentMedia,
isRecent: widget.startWithRecent); isRecent: widget.startWithRecent);
if (!controller.isInitialized) { if (!controller.isInitialized) {
await controller.initializeAlbums(); await controller.initializeAlbums(locale: widget.locale);
} }
setState(() {}); setState(() {});
}, },

View File

@ -1,26 +1,26 @@
name: gallery_picker 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. 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.4.8 version: 0.5.0
homepage: https://github.com/FlutterWay/gallery_picker homepage: https://github.com/FlutterWay/gallery_picker
environment: environment:
sdk: '>=2.19.6 <4.0.0' sdk: '>=3.0.0 <4.0.0'
flutter: ">=1.17.0" flutter: ">=1.17.0"
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
cupertino_icons: ^1.0.5 cupertino_icons: ^1.0.6
photo_gallery: ^1.2.2 photo_gallery: ^2.1.1
permission_handler: ^10.4.3 permission_handler: ^11.3.0
transparent_image: ^2.0.1 transparent_image: ^2.0.1
video_player: ^2.7.0 video_player: ^2.8.2
device_info_plus: ^9.0.2 device_info_plus: ^9.1.2
get: ^4.6.5 get: ^4.6.6
video_thumbnail: ^0.5.3 video_thumbnail: ^0.5.3
intl: ^0.18.1 intl: ^0.19.0
page_transition: ^2.0.9 page_transition: ^2.1.0
bottom_sheet_scaffold: ^0.1.6 bottom_sheet_scaffold: ^0.1.9
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter