improvements

design_3.0_task_module_new
Sikander Saleem 4 months ago
parent 0a38bdd9e1
commit 3181e666be

@ -12,7 +12,7 @@ extension BuildContextExtension on BuildContext {
List<String> get getIssues => [translation.reason1, translation.reason2, translation.reason3, translation.reason4, translation.reason5];
bool get isDark => Provider.of<SettingProvider>(this, listen: false).theme == "dark";
bool get isDark => Provider.of<SettingProvider>(this).theme == "dark";
bool get isAr => Provider.of<SettingProvider>(this).language == "ar";

@ -195,7 +195,7 @@ class _MultiFilesPickerState extends State<MultiFilesPicker> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
icon.toSvgAsset(),
label.bodyText2(context).custom(color: AppColor.black20),
Text(label, style: AppTextStyles.bodyText2).custom(color: AppColor.black20),
],
),
);
@ -223,99 +223,9 @@ class _MultiFilesPickerState extends State<MultiFilesPicker> {
],
),
title: "Attach File");
//
// showModalBottomSheet<ImageSource>(
// context: context,
// builder: (BuildContext context) {
// return;
// },
// );
// 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);
// },
// ),
// 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);
// },
// ),
// ],
// ),
// );
// },
// );
// ImageSource source = await showDialog(
// context: context,
// builder: (dialogContext) => CupertinoAlertDialog(
// actions: <Widget>[
// TextButton(
// child: Text(context.translation.pickFromCamera),
// onPressed: () {
// Navigator.of(dialogContext).pop(ImageSource.camera);
// },
// ),
// TextButton(
// child: Text(context.translation.pickFromGallery),
// onPressed: () {
// Navigator.of(dialogContext).pop(ImageSource.gallery);
// },
// ),
// TextButton(
// child: Text(context.translation.pickFromFiles),
// onPressed: () async {
// await fromFilePicker();
// Navigator.pop(context);
// },
// ),
// ],
// ),
// );
if (source == null) return;
final pickedFile = await ImagePicker().pickImage(source: source, imageQuality: 70, maxWidth: 800, maxHeight: 800);
if (pickedFile != null) {
File fileImage = File(pickedFile.path);
widget.files.add(fileImage);
@ -334,17 +244,11 @@ class AttachmentModel {
AttachmentModel(this.id, this.file);
factory AttachmentModel.fromJson(Map<String, dynamic> json) {
return AttachmentModel(
json['id'] ?? 0,
json['file'] != null ? File(json['file']) : null,
);
return AttachmentModel(json['id'] ?? 0, json['file'] != null ? File(json['file']) : null);
}
Map<String, dynamic> toJson() {
return {
'id': id,
'file': file?.path,
};
return {'id': id, 'file': file?.path};
}
}

Loading…
Cancel
Save