dialogImageSelect function
void
dialogImageSelect(
- BuildContext ctx,
- ValueNotifier<
File?> photo, { - void next()?,
- num? size,
- num? paddingChild,
- num? wirePadding,
Implementation
void dialogImageSelect(
BuildContext ctx,
ValueNotifier<File?> photo, {
void Function()? next,
num? size,
num? paddingChild,
num? wirePadding,
}) {
showDialogCustom(
context: ctx,
location: Location.bottom,
offsetHandle: fromBottom,
style: StyleText.one(size: size),
builder: (_) => DialogListSelect(
paddingChild: paddingChild,
wirePadding: wirePadding,
children: [
NameFunction("从相册选择", () async {
var file = await ImagePicker().getImage(source: ImageSource.gallery);
if (file != null) photo.value = File(file.path);
if (next != null) next();
}),
NameFunction("拍摄", () async {
var file = await ImagePicker().getImage(source: ImageSource.camera);
if (file != null) photo.value = File(file.path);
if (next != null) next();
}),
],
),
);
}