Jira fixes for announcements & attachments

merge-requests/87/head
haroon amjad 3 years ago
parent 01a37d253e
commit c7dca3c377

@ -20,7 +20,7 @@ class DateUtil {
}
static DateTime convertSimpleStringDateToDate(String date) {
return DateFormat("MM/dd/yyyy hh:mm:ss a").parse(date);
return DateFormat("MM/dd/yyyy hh:mm:ss aaa").parse(date);
}
static DateTime convertSimpleStringDateToDateddMMyyyy(String date) {

@ -22,6 +22,7 @@ import 'package:mohem_flutter_app/widgets/button/default_button.dart';
import 'package:mohem_flutter_app/widgets/button/simple_button.dart';
import 'package:mohem_flutter_app/widgets/circular_avatar.dart';
import 'package:mohem_flutter_app/widgets/dialogs/confirm_dialog.dart';
import 'package:mohem_flutter_app/widgets/image_picker.dart';
import 'package:mohem_flutter_app/widgets/input_widget.dart';
class RequestSubmitScreenParams {
@ -48,6 +49,7 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
List<GetApprovesList> approverList = [];
List<File> attachmentFiles = [];
List<String> attachments = [];
@override
void initState() {
@ -72,16 +74,16 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
Utils.showLoading(context);
List<Map<String, dynamic>> list = [];
if (attachmentFiles.isNotEmpty) {
attachmentFiles.asMap().forEach((index, value) async {
String type = value.path.split('.').last;
String name = value.path.split('/').last;
List<int> fileContent = await value.readAsBytes();
String encodedFile = base64Encode(fileContent);
attachments.asMap().forEach((index, value) async {
String type = attachmentFiles[index].path.split('.').last;
String name = attachmentFiles[index].path.split('/').last;
// List<int> fileContent = await value.readAsBytes();
// String encodedFile = base64Encode(fileContent);
list.add(AttachmentModel(
attachmentID: index,
pFILECONTENTTYPE: type,
pFILENAME: name,
pFILEDATA: encodedFile,
pFILEDATA: value,
pTRANSACTIONID: params!.transactionId,
).toJson());
});
@ -261,12 +263,18 @@ class _RequestSubmitScreenState extends State<RequestSubmitScreen> {
title.toText16().expanded,
6.width,
SimpleButton(LocaleKeys.add.tr(), () async {
FilePickerResult? result = await FilePicker.platform.pickFiles(allowMultiple: true);
if (result != null) {
attachmentFiles = attachmentFiles + result.paths.map((path) => File(path!)).toList();
attachmentFiles = attachmentFiles.toSet().toList();
setState(() {});
}
ImageOptions.showImageOptionsNew(context, false, (String image, File file) {
setState(() {
attachmentFiles.add(file);
attachments.add(image);
Navigator.of(context).pop();
});
});
// if (result != null) {
// attachmentFiles = attachmentFiles + result.paths.map((path) => File(path!)).toList();
// attachmentFiles = attachmentFiles.toSet().toList();
// setState(() {});
// }
}, fontSize: 14),
],
),

@ -95,7 +95,7 @@ class _AnnouncementsState extends State<Announcements> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(AppState().isArabic(context) ? _foundAnnouncements[index].titleAR! : getAnnouncementsObject[index].titleEN!).toText13(),
(AppState().isArabic(context) ? _foundAnnouncements[index].titleAR! : _foundAnnouncements[index].titleEN!).toText13(),
8.height,
_foundAnnouncements[index].created!.toText10(color: MyColors.grey98Color)
],

@ -528,7 +528,7 @@ class _WorkListScreenState extends State<WorkListScreen> {
10.height,
Row(
children: [
DateUtil.formatDateToDate(DateUtil.convertSimpleStringDateToDate(workData.bEGINDATE!), false).toText10(color: MyColors.lightTextColor).expanded,
DateUtil.formatDateToDate(DateUtil.convertSimpleStringDateToDateddMMyyyy(workData.bEGINDATE!), false).toText10(color: MyColors.lightTextColor).expanded,
RotatedBox(quarterTurns: AppState().isArabic(context) ? 2 : 4, child: SvgPicture.asset("assets/images/arrow_next.svg", color: MyColors.darkIconColor)),
],
),

Loading…
Cancel
Save