CMA #67 & #65 fixed 1.0

mirza_dev
devmirza121 4 years ago
parent b385dccefd
commit 96c2ff3f39

@ -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<String, dynamic> 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<String, dynamic> toJson() => {

@ -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<DefineLicensePage> createState() => _DefineLicensePageState();
@ -76,22 +77,28 @@ class _DefineLicensePageState extends State<DefineLicensePage> {
? 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<DefineLicensePage> {
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
}

@ -165,7 +165,7 @@ class _CompleteProfilePageState extends State<CompleteProfilePage> {
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 {

Loading…
Cancel
Save