|
|
|
|
@ -211,57 +211,57 @@ class _VerifyArrivalViewState extends State<VerifyArrivalView> {
|
|
|
|
|
}
|
|
|
|
|
Future<File?> onFilePicker() async {
|
|
|
|
|
|
|
|
|
|
ImageSource? source = await showModalBottomSheet<ImageSource>(
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
Widget listCard({required String icon, required String label, required VoidCallback onTap}) {
|
|
|
|
|
return GestureDetector(
|
|
|
|
|
onTap: onTap,
|
|
|
|
|
child: Container(
|
|
|
|
|
constraints: BoxConstraints(minWidth: 111.toScreenWidth, minHeight: 111.toScreenHeight),
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12.toScreenWidth, vertical: 12.toScreenHeight),
|
|
|
|
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), border: Border.all(width: 1, color: AppColor.white70)),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
icon.toSvgAsset(),
|
|
|
|
|
24.height,
|
|
|
|
|
label.bodyText2(context).custom(color: AppColor.black20),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
|
child: Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
listCard(
|
|
|
|
|
icon: 'camera_icon',
|
|
|
|
|
label: '${context.translation.open}\n${context.translation.camera}',
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.of(context).pop(ImageSource.camera);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
20.width,
|
|
|
|
|
listCard(
|
|
|
|
|
icon: 'gallery_icon',
|
|
|
|
|
label: '${context.translation.open}\n${context.translation.gallery}',
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.of(context).pop(ImageSource.gallery);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
if (source == null) return null;
|
|
|
|
|
// ImageSource? source = await showModalBottomSheet<ImageSource>(
|
|
|
|
|
// context: context,
|
|
|
|
|
// builder: (BuildContext context) {
|
|
|
|
|
// Widget listCard({required String icon, required String label, required VoidCallback onTap}) {
|
|
|
|
|
// return GestureDetector(
|
|
|
|
|
// onTap: onTap,
|
|
|
|
|
// child: Container(
|
|
|
|
|
// constraints: BoxConstraints(minWidth: 111.toScreenWidth, minHeight: 111.toScreenHeight),
|
|
|
|
|
// padding: EdgeInsets.symmetric(horizontal: 12.toScreenWidth, vertical: 12.toScreenHeight),
|
|
|
|
|
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), border: Border.all(width: 1, color: AppColor.white70)),
|
|
|
|
|
// child: Column(
|
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// icon.toSvgAsset(),
|
|
|
|
|
// 24.height,
|
|
|
|
|
// label.bodyText2(context).custom(color: AppColor.black20),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// return Container(
|
|
|
|
|
// padding: const EdgeInsets.all(16.0),
|
|
|
|
|
// child: Row(
|
|
|
|
|
// // mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// listCard(
|
|
|
|
|
// icon: 'camera_icon',
|
|
|
|
|
// label: '${context.translation.open}\n${context.translation.camera}',
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// Navigator.of(context).pop(ImageSource.camera);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// 20.width,
|
|
|
|
|
// listCard(
|
|
|
|
|
// icon: 'gallery_icon',
|
|
|
|
|
// label: '${context.translation.open}\n${context.translation.gallery}',
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// Navigator.of(context).pop(ImageSource.gallery);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// },
|
|
|
|
|
// );
|
|
|
|
|
// if (source == null) return null;
|
|
|
|
|
File ?fileImage;
|
|
|
|
|
final pickedFile = await ImagePicker().pickImage(source: source, imageQuality: 70, maxWidth: 800, maxHeight: 800);
|
|
|
|
|
final pickedFile = await ImagePicker().pickImage(source: ImageSource.camera, imageQuality: 70, maxWidth: 800, maxHeight: 800);
|
|
|
|
|
|
|
|
|
|
if (pickedFile != null) {
|
|
|
|
|
fileImage = File(pickedFile.path);
|
|
|
|
|
|