|
|
@ -12,17 +12,19 @@ import 'package:velocity_x/velocity_x.dart';
|
|
|
|
// Project imports:
|
|
|
|
// Project imports:
|
|
|
|
import 'package:akuCommunity/utils/headers.dart';
|
|
|
|
import 'package:akuCommunity/utils/headers.dart';
|
|
|
|
|
|
|
|
|
|
|
|
//TODO 图片大小限制
|
|
|
|
|
|
|
|
class BeeImagePicker {
|
|
|
|
class BeeImagePicker {
|
|
|
|
static Future<File> pick({
|
|
|
|
static Future<File> pick(
|
|
|
|
String title,
|
|
|
|
{String title, double maxWidth = 1000, double maxHeight = 1000}) async {
|
|
|
|
}) async {
|
|
|
|
|
|
|
|
PickedFile file = await Get.bottomSheet(CupertinoActionSheet(
|
|
|
|
PickedFile file = await Get.bottomSheet(CupertinoActionSheet(
|
|
|
|
title: title.text.isIntrinsic.make(),
|
|
|
|
title: title.text.isIntrinsic.make(),
|
|
|
|
actions: [
|
|
|
|
actions: [
|
|
|
|
CupertinoDialogAction(
|
|
|
|
CupertinoDialogAction(
|
|
|
|
onPressed: () async => Get.back(
|
|
|
|
onPressed: () async => Get.back(
|
|
|
|
result: await ImagePicker().getImage(source: ImageSource.gallery),
|
|
|
|
result: await ImagePicker().getImage(
|
|
|
|
|
|
|
|
source: ImageSource.gallery,
|
|
|
|
|
|
|
|
maxHeight: maxHeight,
|
|
|
|
|
|
|
|
maxWidth: maxWidth,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: [
|
|
|
|
child: [
|
|
|
|
Icon(CupertinoIcons.photo),
|
|
|
|
Icon(CupertinoIcons.photo),
|
|
|
@ -32,7 +34,11 @@ class BeeImagePicker {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
CupertinoDialogAction(
|
|
|
|
CupertinoDialogAction(
|
|
|
|
onPressed: () async => Get.back(
|
|
|
|
onPressed: () async => Get.back(
|
|
|
|
result: await ImagePicker().getImage(source: ImageSource.camera),
|
|
|
|
result: await ImagePicker().getImage(
|
|
|
|
|
|
|
|
source: ImageSource.camera,
|
|
|
|
|
|
|
|
maxHeight: maxHeight,
|
|
|
|
|
|
|
|
maxWidth: maxWidth,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: [
|
|
|
|
child: [
|
|
|
|
Icon(CupertinoIcons.camera),
|
|
|
|
Icon(CupertinoIcons.camera),
|
|
|
|