Variable type of MediaFile.type changed to MediaType
This commit is contained in:
parent
d015b9e20d
commit
6cf4776aac
@ -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":"2023-01-01 10:09:14.777712","version":"3.3.10"}
|
{"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 17:14:11.502400","version":"3.3.10"}
|
@ -42,3 +42,7 @@
|
|||||||
|
|
||||||
* The problem at collectGallery function has solved
|
* The problem at collectGallery function has solved
|
||||||
|
|
||||||
|
## 0.1.1
|
||||||
|
|
||||||
|
* Variable type of MediaFile.type changed to MediaType
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ GalleryPicker returns MediaFile list. You can reach out features below.
|
|||||||
|
|
||||||
[✔] Medium
|
[✔] Medium
|
||||||
[✔] Id
|
[✔] Id
|
||||||
[✔] MediumType
|
[✔] MediaType
|
||||||
[✔] Thumbnail
|
[✔] Thumbnail
|
||||||
[✔] Check with thumbnailFailed if fetching thumbnail fails
|
[✔] Check with thumbnailFailed if fetching thumbnail fails
|
||||||
[✔] Check with fileFailed if getting file fails
|
[✔] Check with fileFailed if getting file fails
|
||||||
|
@ -141,7 +141,7 @@ packages:
|
|||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "0.1.0"
|
version: "0.1.1"
|
||||||
get:
|
get:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -10,20 +10,27 @@ enum MediaType { image, video }
|
|||||||
|
|
||||||
class MediaFile {
|
class MediaFile {
|
||||||
late Medium medium;
|
late Medium medium;
|
||||||
MediumType? type;
|
late MediaType type;
|
||||||
Uint8List? thumbnail;
|
Uint8List? thumbnail;
|
||||||
Uint8List? data;
|
Uint8List? data;
|
||||||
late String id;
|
late String id;
|
||||||
bool thumbnailFailed = false;
|
bool thumbnailFailed = false;
|
||||||
File? file;
|
File? file;
|
||||||
|
|
||||||
|
bool get isVideo => type == MediaType.video;
|
||||||
|
bool get isImage => type == MediaType.image;
|
||||||
|
|
||||||
MediaFile({required this.medium}) {
|
MediaFile({required this.medium}) {
|
||||||
type = medium.mediumType;
|
type = medium.mediumType == MediumType.video
|
||||||
|
? MediaType.video
|
||||||
|
: MediaType.image;
|
||||||
id = medium.id;
|
id = medium.id;
|
||||||
}
|
}
|
||||||
MediaFile.file(
|
MediaFile.file({required this.id, required this.file, required this.type}) {
|
||||||
{required this.id, required this.file, required MediaType type}) {
|
medium = Medium(
|
||||||
this.type = type == MediaType.image ? MediumType.image : MediumType.video;
|
id: id,
|
||||||
medium = Medium(id: id);
|
mediumType:
|
||||||
|
type == MediaType.image ? MediumType.image : MediumType.video);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Uint8List?> getThumbnail() async {
|
Future<Uint8List?> getThumbnail() async {
|
||||||
|
@ -10,7 +10,7 @@ class MediaProvider extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return media.type == photo_gallery.MediumType.image
|
return media.isImage
|
||||||
? PhotoProvider(
|
? PhotoProvider(
|
||||||
media: media,
|
media: media,
|
||||||
width: width,
|
width: width,
|
||||||
|
@ -23,7 +23,7 @@ class ThumbnailMedia extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
if (media.thumbnailFailed && onErrorBuilder == null)
|
if (media.thumbnailFailed && onErrorBuilder == null)
|
||||||
Icon(
|
Icon(
|
||||||
media.type == MediumType.image
|
media.isImage
|
||||||
? Icons.image_not_supported
|
? Icons.image_not_supported
|
||||||
: Icons.videocam_off_rounded,
|
: Icons.videocam_off_rounded,
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
@ -44,9 +44,7 @@ class ThumbnailMedia extends StatelessWidget {
|
|||||||
bottom: 10,
|
bottom: 10,
|
||||||
left: 10,
|
left: 10,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
media.medium.mediumType == MediumType.video
|
media.isVideo ? Icons.video_camera_back : null,
|
||||||
? Icons.video_camera_back
|
|
||||||
: null,
|
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
size: 20,
|
size: 20,
|
||||||
)),
|
)),
|
||||||
|
@ -52,7 +52,7 @@ class ThumbnailMediaFile extends StatelessWidget {
|
|||||||
Container(
|
Container(
|
||||||
color: adjustFailedBgColor(),
|
color: adjustFailedBgColor(),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
file.type == MediumType.image
|
file.isImage
|
||||||
? Icons.image_not_supported
|
? Icons.image_not_supported
|
||||||
: Icons.videocam_off_rounded,
|
: Icons.videocam_off_rounded,
|
||||||
size: 50,
|
size: 50,
|
||||||
@ -75,9 +75,7 @@ class ThumbnailMediaFile extends StatelessWidget {
|
|||||||
bottom: 10,
|
bottom: 10,
|
||||||
left: 10,
|
left: 10,
|
||||||
child: Icon(
|
child: Icon(
|
||||||
file.medium.mediumType == MediumType.video
|
file.isVideo ? Icons.video_camera_back : null,
|
||||||
? Icons.video_camera_back
|
|
||||||
: null,
|
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
size: 20,
|
size: 20,
|
||||||
)),
|
)),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
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.1.0
|
version: 0.1.1
|
||||||
homepage: https://github.com/FlutterWay/gallery_picker
|
homepage: https://github.com/FlutterWay/gallery_picker
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user