From 96c2ff3f396030bc66c7c12f101e0de66a216999 Mon Sep 17 00:00:00 2001 From: devmirza121 Date: Tue, 12 Apr 2022 12:37:07 +0300 Subject: [PATCH] CMA #67 & #65 fixed 1.0 --- lib/models/profile/document.dart | 3 ++ lib/pages/settings/define_license_page.dart | 41 ++++++++++++--------- lib/pages/user/complete_profile_page.dart | 2 +- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/lib/models/profile/document.dart b/lib/models/profile/document.dart index da082b3..0876cb0 100644 --- a/lib/models/profile/document.dart +++ b/lib/models/profile/document.dart @@ -47,6 +47,7 @@ class DocumentData { this.isActive, this.document, this.fileExt, + this.documentName, }); int? id; @@ -58,6 +59,7 @@ class DocumentData { bool? isActive; String? document; String? fileExt; + String? documentName; factory DocumentData.fromJson(Map json) => DocumentData( id: json["id"] == null ? null : json["id"], @@ -69,6 +71,7 @@ class DocumentData { isActive: json["isActive"] == null ? null : json["isActive"], document: null, fileExt: null, + documentName: json["documentName"] == null ? null : json["documentName"], ); Map toJson() => { diff --git a/lib/pages/settings/define_license_page.dart b/lib/pages/settings/define_license_page.dart index 9b41b2d..9407bf4 100644 --- a/lib/pages/settings/define_license_page.dart +++ b/lib/pages/settings/define_license_page.dart @@ -12,6 +12,7 @@ import 'package:file_picker/file_picker.dart'; import 'package:flutter/material.dart'; import 'package:car_provider_app/extensions/int_extensions.dart'; + class DefineLicensePage extends StatefulWidget { @override State createState() => _DefineLicensePageState(); @@ -76,22 +77,28 @@ class _DefineLicensePageState extends State { ? Text("Something went wrong") : ListView.separated( itemBuilder: (context, index) { - return Row( + return Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Flexible( - child: TxtField( - hint: "Select Attachment", - value: document?.data![index].documentUrl ?? "", - isNeedClickAll: true, - maxLines: 2, - ), + Text(document?.data![index].documentName ?? ""), + Row( + children: [ + Flexible( + child: TxtField( + hint: "Select Attachment", + value: document?.data![index].documentUrl ?? "", + isNeedClickAll: true, + maxLines: 2, + ), + ), + IconButton( + onPressed: () { + selectFile(index); + }, + icon: Icon(Icons.insert_link_rounded), + ) + ], ), - IconButton( - onPressed: () { - selectFile(index); - }, - icon: Icon(Icons.insert_link_rounded), - ) ], ); }, @@ -115,17 +122,15 @@ class _DefineLicensePageState extends State { File file = File(result.files.single.path ?? ""); int sizeInBytes = file.lengthSync(); // double sizeInMb = sizeInBytes / (1024 * 1024); - if (sizeInBytes > 1000){ + if (sizeInBytes > 1000) { Utils.showToast("File is larger then 1KB"); - }else{ + } else { document!.data![index].document = convertFileToBase64(file); document!.data![index].fileExt = checkFileExt(file.path); setState(() { document!.data![index].documentUrl = result.files.single.path ?? ""; }); } - - } else { // User canceled the picker } diff --git a/lib/pages/user/complete_profile_page.dart b/lib/pages/user/complete_profile_page.dart index 1696daa..04b1bd9 100644 --- a/lib/pages/user/complete_profile_page.dart +++ b/lib/pages/user/complete_profile_page.dart @@ -165,7 +165,7 @@ class _CompleteProfilePageState extends State { RegisterUser user = await UserApiClent().basicComplete(widget.user.data?.userId ?? "", firstName!, lastName!, email!, password!); Utils.hideLoading(context); if (user.messageStatus == 1) { - Utils.showToast("Successfully Registered, Please login once"); + Utils.showToast("Thank you for registration, your request submitted by admin for verification, for more information you can contact the 11223344"); pop(context); // navigateReplaceWithName(context, AppRoutes.dashboard,arguments: user); } else {