photo yo pick image/video
image picker, multi picker
support ios icloud
support video
use flutter as ui
if you want to build custom ui, you just need api to make custom ui. to use photo_manager to pick image/video or download the library to custom ui.
install
dependencies:
photo: $latest_version
import
import 'package:photo/photo.dart';
import 'package:photo_manager/photo_manager.dart';
use
void _pickimage() async {
list<assetentity> imglist = await photopicker.pickasset(
context: context,
// buildcontext requied
/// the following are optional parameters.
themecolor: colors.green,
// the title color and bottom color
padding: 1.0,
// item padding
dividercolor: colors.grey,
// divider color
disablecolor: colors.grey.shade300,
// the check box disable color
itemradio: 0.88,
// the content item radio
maxselected: 8,
// max picker image count
provider: i18nprovider.chinese,
// i18n provider ,default is chinese. , you can custom i18nprovider or use enprovider()
rowcount: 5,
// item row count
textcolor: colors.white,
// text color
thumbsize: 150,
// preview thumb size , default is 64
sortdelegate: sortdelegate.common,
// default is common ,or you make custom delegate to sort your gallery
checkboxbuilderdelegate: defaultcheckboxbuilderdelegate(
activecolor: colors.white,
unselectedcolor: colors.white,
), // default is defaultcheckboxbuilderdelegate ,or you make custom delegate to create checkbox
loadingdelegate:
this, // if you want to build custom loading widget,extends loadingdelegate [see example/lib/main.dart]
picktype: type, // all/image/video
);
whole example
you can see main.dart
about android
glide
android native use glide to create image thumb bytes, version is 4.8.0.
if your other android library use the library, and version is not same, then you need edit your android project’s build.gradle.
rootproject.allprojects {
subprojects {
project.configurations.all {
resolutionstrategy.eachdependency { details ->
if (details.requested.group == 'com.github.bumptech.glide'
&& details.requested.name.contains('glide')) {
details.useversion "4.8.0"
}
}
}
}
}
if you use the proguard
about ios
because the album is a privacy privilege, you need user permission to access it. you must to modify the info.plist
file in runner project.
like next
<key>nsphotolibraryusagedescription</key>
<string>app need your agree, can visit your album</string>
xcode like image
build error
if you build error like include of non-modular header inside framework module, see #10 or so
Comments are closed.