|
|
|
|
@ -392,7 +392,7 @@ class _AttachmentPickerState extends State<AttachmentPicker> {
|
|
|
|
|
);
|
|
|
|
|
if (result != null) {
|
|
|
|
|
for (var path in result.paths) {
|
|
|
|
|
widget.attachment.add(GenericAttachmentModel(id: 0,name: File(path!).path));
|
|
|
|
|
widget.attachment.add(GenericAttachmentModel(id: 0, name: File(path!).path));
|
|
|
|
|
}
|
|
|
|
|
if (widget.onChange != null) {
|
|
|
|
|
widget.onChange!(widget.attachment);
|
|
|
|
|
@ -444,7 +444,7 @@ class _AttachmentPickerState extends State<AttachmentPicker> {
|
|
|
|
|
|
|
|
|
|
if (pickedFile != null) {
|
|
|
|
|
File fileImage = File(pickedFile.path);
|
|
|
|
|
widget.attachment.add(GenericAttachmentModel(id: 0,name: fileImage.path));
|
|
|
|
|
widget.attachment.add(GenericAttachmentModel(id: 0, name: fileImage.path));
|
|
|
|
|
if (widget.onChange != null) {
|
|
|
|
|
widget.onChange!(widget.attachment);
|
|
|
|
|
}
|
|
|
|
|
@ -484,29 +484,41 @@ class _AttachmentPickerState extends State<AttachmentPicker> {
|
|
|
|
|
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)),
|
|
|
|
|
return Container(
|
|
|
|
|
padding: const EdgeInsets.all(12),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
|
border: Border.all(color: const Color(0xffF1F1F1), width: 1),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
icon.toSvgAsset(),
|
|
|
|
|
24.height,
|
|
|
|
|
label.bodyText2(context).custom(color: AppColor.black20),
|
|
|
|
|
],
|
|
|
|
|
icon.toSvgAsset(color: const Color(0xff7D859A), width: 36, height: 36),
|
|
|
|
|
// Icon(iconData, color: const Color(0xff7D859A), size: 36),
|
|
|
|
|
Text(
|
|
|
|
|
label,
|
|
|
|
|
style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w500),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
).onPress(onTap);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
return SafeArea(
|
|
|
|
|
top: false,
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
"Attach File".heading4(context),
|
|
|
|
|
12.height,
|
|
|
|
|
GridView(
|
|
|
|
|
padding: const EdgeInsets.all(0),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 1, crossAxisSpacing: 12, mainAxisSpacing: 12),
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
listCard(
|
|
|
|
|
icon: 'camera_icon',
|
|
|
|
|
@ -532,6 +544,38 @@ class _AttachmentPickerState extends State<AttachmentPicker> {
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
// 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);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// listCard(
|
|
|
|
|
// icon: 'gallery_icon',
|
|
|
|
|
// label: '${context.translation.open}\n${context.translation.gallery}',
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// Navigator.of(context).pop(ImageSource.gallery);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// listCard(
|
|
|
|
|
// icon: 'file_icon',
|
|
|
|
|
// label: '${context.translation.open}\n${context.translation.files}',
|
|
|
|
|
// onTap: () async {
|
|
|
|
|
// await fromFilePicker();
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
],
|
|
|
|
|
).paddingAll(16),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|