Merge branch 'main' into temp
This commit is contained in:
@@ -120,7 +120,7 @@ class _SideMenuState extends State<SideMenu> {
|
||||
height: 80.h,
|
||||
decoration: ShapeDecoration(
|
||||
image: DecorationImage(
|
||||
image: NetworkImage(ProfileObj!.data == null
|
||||
image: NetworkImage(ProfileObj == null
|
||||
? ""
|
||||
: ProfileObj!.data!.profilePhoto ?? ""),
|
||||
fit: BoxFit.fill,
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide FormData;
|
||||
import 'package:traderscircuit/Utils/text.dart';
|
||||
import 'package:traderscircuit/controller/contact_us_controller.dart';
|
||||
import 'package:traderscircuit/view_model/ContactUsApi/contact_us_api.dart';
|
||||
|
||||
import '../../../Utils/Common/commonBotton.dart';
|
||||
import 'ticket_confirmed_bottom_sheet.dart';
|
||||
import '../../../model/ContactUsModel/ticket_details_model.dart';
|
||||
|
||||
class CancelTicketBottomSheet {
|
||||
bottomSheet(
|
||||
BuildContext context,
|
||||
int id,
|
||||
) {
|
||||
ContactUsController contactUsController = Get.put(ContactUsController());
|
||||
return showModalBottomSheet(
|
||||
useSafeArea: true,
|
||||
isScrollControlled: true,
|
||||
@@ -65,7 +70,42 @@ class CancelTicketBottomSheet {
|
||||
child: kycBtn(
|
||||
text: "Yes",
|
||||
onTap: () {
|
||||
Get.back();
|
||||
ContactUsApi()
|
||||
.updateTicketStatusApi(FormData.fromMap({
|
||||
"ticket_xid": id,
|
||||
"status": 2,
|
||||
}))
|
||||
.then((value) {
|
||||
Get.back();
|
||||
contactUsController.isDetailsLoading.value =
|
||||
true;
|
||||
contactUsController
|
||||
.contactUsDetailsChatContent
|
||||
.clear();
|
||||
ContactUsApi()
|
||||
.getContactUsDetailsData(id.toString())
|
||||
.then((value) {
|
||||
contactUsController.ticketDetailsModel =
|
||||
TicketDetailsModel.fromJson(value.data);
|
||||
for (var a in contactUsController
|
||||
.ticketDetailsModel!
|
||||
.data![0]
|
||||
.ticketResponses!) {
|
||||
contactUsController
|
||||
.contactUsDetailsChatContent
|
||||
.add({
|
||||
"initial_name": "TS",
|
||||
"date": contactUsController
|
||||
.formatedDateTimeMethod(
|
||||
a.createdAt!),
|
||||
"content": a.response,
|
||||
});
|
||||
}
|
||||
contactUsController.isTicketClosed = true;
|
||||
contactUsController.isDetailsLoading.value =
|
||||
false;
|
||||
});
|
||||
});
|
||||
},
|
||||
bgClr: const Color(0xFF6C0000),
|
||||
borderClr: const Color(0xFF9A0000),
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide FormData;
|
||||
import 'package:traderscircuit/Utils/dialogs.dart';
|
||||
import 'package:traderscircuit/Utils/image_preview_screen.dart';
|
||||
import 'package:traderscircuit/controller/contact_us_controller.dart';
|
||||
import 'package:traderscircuit/model/ContactUsModel/ticket_details_model.dart';
|
||||
import 'package:traderscircuit/view_model/ContactUsApi/contact_us_api.dart';
|
||||
|
||||
import '../../../Utils/Common/CommonAppbar.dart';
|
||||
import '../../../Utils/Common/CustomTextFormField.dart';
|
||||
import '../../../Utils/Common/FilePicker.dart';
|
||||
import '../../../Utils/Common/commonBotton.dart';
|
||||
import '../../../Utils/text.dart';
|
||||
import '../../onBoarding/splashScreen1.dart';
|
||||
@@ -24,366 +28,568 @@ class ContactUsDetailsScreen extends StatefulWidget {
|
||||
class _ContactUsDetailsScreenState extends State<ContactUsDetailsScreen> {
|
||||
ContactUsController contactUsController = Get.put(ContactUsController());
|
||||
TextEditingController queriesTextController = TextEditingController();
|
||||
String id = Get.arguments["id"];
|
||||
@override
|
||||
void initState() {
|
||||
contactUsController.isDetailsLoading.value = true;
|
||||
contactUsController.isTicketClosed = false;
|
||||
contactUsController.contactUsDetailsChatContent.clear();
|
||||
ContactUsApi().getContactUsDetailsData(id).then((value) {
|
||||
contactUsController.ticketDetailsModel =
|
||||
TicketDetailsModel.fromJson(value.data);
|
||||
for (var a in contactUsController
|
||||
.ticketDetailsModel!.data![0].ticketResponses!) {
|
||||
contactUsController.contactUsDetailsChatContent.add({
|
||||
"initial_name": "TS",
|
||||
"date": contactUsController.formatedDateTimeMethod(a.createdAt!),
|
||||
"content": a.response,
|
||||
});
|
||||
}
|
||||
contactUsController.isDetailsLoading.value = false;
|
||||
});
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final GlobalKey<FormState> queriesForm = GlobalKey<FormState>();
|
||||
return Obx(
|
||||
() => Form(
|
||||
key: queriesForm,
|
||||
child: Scaffold(
|
||||
appBar: CommonAppbar(
|
||||
height: 75,
|
||||
titleTxt: "",
|
||||
customActionWidget: text16W400(""),
|
||||
),
|
||||
backgroundColor: Colors.black,
|
||||
extendBody: true,
|
||||
body: Stack(
|
||||
children: [
|
||||
const CommonBlurLeft(),
|
||||
const CommonBlurRight(),
|
||||
Stack(children: [
|
||||
SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 18, vertical: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
//physics: const NeverScrollableScrollPhysics(),
|
||||
children: [
|
||||
text25W600("Contact Us"),
|
||||
const Gap(20),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
() => WillPopScope(
|
||||
onWillPop: () async {
|
||||
contactUsController.isTicketClosed
|
||||
? Get.back(result: true)
|
||||
: Get.back();
|
||||
return false;
|
||||
},
|
||||
child: Form(
|
||||
key: queriesForm,
|
||||
child: Scaffold(
|
||||
appBar: CommonAppbar(
|
||||
height: 75,
|
||||
titleTxt: "",
|
||||
customActionWidget: text16W400(""),
|
||||
),
|
||||
backgroundColor: Colors.black,
|
||||
extendBody: true,
|
||||
body: Stack(
|
||||
children: [
|
||||
const CommonBlurLeft(),
|
||||
const CommonBlurRight(),
|
||||
contactUsController.isDetailsLoading.value
|
||||
? const Center(
|
||||
child:
|
||||
CircularProgressIndicator(color: Color(0xFF9A0000)),
|
||||
)
|
||||
: Stack(children: [
|
||||
SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 18, vertical: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
//physics: const NeverScrollableScrollPhysics(),
|
||||
children: [
|
||||
text22W600("#18663765"),
|
||||
const Gap(10),
|
||||
text16W500(
|
||||
"RESOLVED",
|
||||
clr: const Color(0xFF34C759),
|
||||
),
|
||||
],
|
||||
),
|
||||
text16W400("16 Feb 2024, 11 : 35 PM"),
|
||||
],
|
||||
),
|
||||
const Gap(15),
|
||||
const Divider(
|
||||
thickness: 1,
|
||||
color: Color(0xFF242424),
|
||||
),
|
||||
const Gap(20),
|
||||
text16W600("Ticket Category"),
|
||||
const Gap(10),
|
||||
text16W400(
|
||||
"It is a long established fact that a reader It is a long established fact that a reader It is a long established fact that a reader"),
|
||||
contactUsController
|
||||
.attachmentPathNameDetailsList.isEmpty
|
||||
? const SizedBox()
|
||||
: const Gap(15),
|
||||
contactUsController
|
||||
.attachmentPathNameDetailsList.isEmpty
|
||||
? const SizedBox()
|
||||
: ListView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: contactUsController
|
||||
.attachmentPathNameDetailsList.length,
|
||||
itemBuilder: (ctx, index) {
|
||||
return Container(
|
||||
width: 1.sw,
|
||||
height: 42.h,
|
||||
margin: const EdgeInsets.symmetric(
|
||||
vertical: 6,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF0C0C0C),
|
||||
borderRadius:
|
||||
BorderRadius.circular(4),
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: const Color(0xFF3A3A3A))),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
text25W600("Contact Us"),
|
||||
const Gap(20),
|
||||
Row(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Gap(6),
|
||||
SvgPicture.asset(
|
||||
"assets/images/svg/attachment_pin.svg"),
|
||||
const Gap(6),
|
||||
Container(
|
||||
width: 0.7.sw,
|
||||
child: FittedBox(
|
||||
child: text12W400(
|
||||
contactUsController
|
||||
.attachmentPathNameDetailsList[
|
||||
index]),
|
||||
),
|
||||
),
|
||||
],
|
||||
text22W600(
|
||||
"#${contactUsController.ticketDetailsModel!.data![0].uniqueTicketId}"),
|
||||
const Gap(10),
|
||||
text16W500(
|
||||
contactUsController
|
||||
.ticketDetailsModel!
|
||||
.data![0]
|
||||
.status ==
|
||||
1
|
||||
? "OPEN"
|
||||
: contactUsController
|
||||
.ticketDetailsModel!
|
||||
.data![0]
|
||||
.status ==
|
||||
2
|
||||
? "CLOSED"
|
||||
: "RESOLVED",
|
||||
clr: contactUsController
|
||||
.ticketDetailsModel!
|
||||
.data![0]
|
||||
.status ==
|
||||
1
|
||||
? const Color(0xFFFFAD31)
|
||||
: contactUsController
|
||||
.ticketDetailsModel!
|
||||
.data![0]
|
||||
.status ==
|
||||
2
|
||||
? const Color(0xFF95CCFF)
|
||||
: const Color(0xFF34C759),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
contactUsController
|
||||
.attachmentPathNameDetailsList
|
||||
.removeAt(index);
|
||||
contactUsController
|
||||
.attachmentFileDetailsList
|
||||
.removeAt(index);
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(
|
||||
right: 20),
|
||||
child: SvgPicture.asset(
|
||||
"assets/images/svg/cross_cancel.svg",
|
||||
color:
|
||||
const Color(0xFF818181),
|
||||
width: 10,
|
||||
height: 10,
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
contactUsController
|
||||
.contactUsDetailsChatContent.isEmpty
|
||||
? const SizedBox()
|
||||
: const Gap(18),
|
||||
ListView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: contactUsController
|
||||
.contactUsDetailsChatContent.length +
|
||||
1,
|
||||
itemBuilder: (ctx, index) {
|
||||
return index ==
|
||||
contactUsController
|
||||
.contactUsDetailsChatContent.length
|
||||
? Container(
|
||||
margin: EdgeInsets.only(top: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.end,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Stack(
|
||||
text16W400(contactUsController
|
||||
.formatedDateTimeMethod(
|
||||
contactUsController
|
||||
.ticketDetailsModel!
|
||||
.data![0]
|
||||
.createdAt!)),
|
||||
],
|
||||
),
|
||||
const Gap(15),
|
||||
const Divider(
|
||||
thickness: 1,
|
||||
color: Color(0xFF242424),
|
||||
),
|
||||
const Gap(20),
|
||||
text16W600(contactUsController
|
||||
.ticketDetailsModel!
|
||||
.data![0]
|
||||
.ticketCategory!
|
||||
.name!),
|
||||
const Gap(10),
|
||||
text16W400(contactUsController
|
||||
.ticketDetailsModel!
|
||||
.data![0]
|
||||
.description!),
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: contactUsController
|
||||
.ticketDetailsModel!
|
||||
.data![0]
|
||||
.ticketFiles!
|
||||
.length,
|
||||
itemBuilder: (ctx, index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
Get.to(const ImagePreviewScreen(),
|
||||
arguments: {
|
||||
"image": contactUsController
|
||||
.ticketDetailsModel!
|
||||
.data![0]
|
||||
.ticketFiles![index]
|
||||
.file,
|
||||
});
|
||||
},
|
||||
child: Container(
|
||||
width: 1.sw,
|
||||
height: 42.h,
|
||||
margin: const EdgeInsets.symmetric(
|
||||
vertical: 6,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF0C0C0C),
|
||||
borderRadius:
|
||||
BorderRadius.circular(4),
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: const Color(
|
||||
0xFF3A3A3A))),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
CustomTextFormField3(
|
||||
texttype:
|
||||
TextInputType.multiline,
|
||||
hintText:
|
||||
"Enter some text...",
|
||||
textEditingController:
|
||||
queriesTextController,
|
||||
maxlines: 8,
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Enter your Content';
|
||||
} else if (value
|
||||
.toString()
|
||||
.length <
|
||||
30) {
|
||||
return 'Content should be minimum 30 characters';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(
|
||||
200),
|
||||
Row(
|
||||
children: [
|
||||
const Gap(6),
|
||||
SvgPicture.asset(
|
||||
"assets/images/svg/attachment_pin.svg"),
|
||||
const Gap(6),
|
||||
text12W400(
|
||||
"Attachment ${index + 1}"),
|
||||
],
|
||||
),
|
||||
Positioned(
|
||||
bottom: 15,
|
||||
left: 37,
|
||||
right: 37,
|
||||
child: SizedBox(
|
||||
width: 200.w,
|
||||
child: kycBtn(
|
||||
text: "Close Ticket",
|
||||
onTap: () {
|
||||
CancelTicketBottomSheet()
|
||||
.bottomSheet(
|
||||
context);
|
||||
},
|
||||
bgClr: const Color(
|
||||
0xFF111313),
|
||||
borderClr: const Color(
|
||||
0xFF990000),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
contactUsController
|
||||
.attachmentPathNameDetailsList
|
||||
.length >=
|
||||
3
|
||||
? const SizedBox()
|
||||
: const Gap(10),
|
||||
contactUsController
|
||||
.attachmentPathNameDetailsList
|
||||
.length >=
|
||||
3
|
||||
? const SizedBox()
|
||||
: InkWell(
|
||||
onTap: () async {
|
||||
var result =
|
||||
await FilePickerMethod()
|
||||
.pickFile();
|
||||
if (result != null) {
|
||||
contactUsController
|
||||
.attachmentPathNameDetailsList
|
||||
.clear();
|
||||
|
||||
for (var a in result) {
|
||||
contactUsController
|
||||
.attachmentFileDetailsList
|
||||
.add(a);
|
||||
}
|
||||
|
||||
for (var a
|
||||
in contactUsController
|
||||
.attachmentFileDetailsList) {
|
||||
contactUsController
|
||||
.attachmentPathNameDetailsList
|
||||
.add(FilePickerMethod()
|
||||
.extractFileName(
|
||||
a?.path ??
|
||||
''));
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.end,
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
"assets/images/svg/attachment_pin.svg"),
|
||||
const Gap(6),
|
||||
text12W400(
|
||||
"Add Attachment (Max 32MB / Optional)"),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Gap(20),
|
||||
Padding(
|
||||
padding:
|
||||
),
|
||||
);
|
||||
}),
|
||||
contactUsController
|
||||
.attachmentPathNameDetailsList.isEmpty
|
||||
? const SizedBox()
|
||||
: const Gap(15),
|
||||
contactUsController
|
||||
.attachmentPathNameDetailsList.isEmpty
|
||||
? const SizedBox()
|
||||
: ListView.builder(
|
||||
physics:
|
||||
const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: contactUsController
|
||||
.attachmentPathNameDetailsList
|
||||
.length,
|
||||
itemBuilder: (ctx, index) {
|
||||
return Container(
|
||||
width: 1.sw,
|
||||
height: 42.h,
|
||||
margin:
|
||||
const EdgeInsets.symmetric(
|
||||
// horizontal: 10,
|
||||
vertical: 20),
|
||||
child: SizedBox(
|
||||
width: Get.width,
|
||||
child: kycBtn(
|
||||
text: "Submit",
|
||||
onTap: () {
|
||||
final isValid = queriesForm
|
||||
.currentState
|
||||
?.validate();
|
||||
|
||||
if (isValid!) {
|
||||
contactUsController
|
||||
.contactUsDetailsChatContent
|
||||
.add({
|
||||
"initial_name": "AM",
|
||||
"date":
|
||||
"16 Feb 2024, 11 : 35PM",
|
||||
"content":
|
||||
queriesTextController
|
||||
.text,
|
||||
});
|
||||
queriesTextController
|
||||
.clear();
|
||||
}
|
||||
},
|
||||
bgClr:
|
||||
const Color(0xFF6C0000),
|
||||
borderClr:
|
||||
const Color(0xFF990000),
|
||||
),
|
||||
vertical: 6,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
width: 1.sw,
|
||||
margin: const EdgeInsets.symmetric(
|
||||
vertical: 5,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF0C0C0C),
|
||||
borderRadius:
|
||||
BorderRadius.circular(8),
|
||||
gradient: LinearGradient(
|
||||
begin:
|
||||
const Alignment(0.98, -0.21),
|
||||
end: const Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.03999999910593033),
|
||||
Colors.white.withOpacity(
|
||||
0.05999999865889549)
|
||||
],
|
||||
),
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color:
|
||||
const Color(0xFF3A3A3A))),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
const Color(0xFF0C0C0C),
|
||||
borderRadius:
|
||||
BorderRadius.circular(4),
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: const Color(
|
||||
0xFF3A3A3A))),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 18,
|
||||
backgroundColor:
|
||||
Colors.white,
|
||||
child: Center(
|
||||
child: text16W600(
|
||||
contactUsController
|
||||
.contactUsDetailsChatContent[
|
||||
index]
|
||||
["initial_name"],
|
||||
clr: const Color(
|
||||
0xFF535353)),
|
||||
),
|
||||
),
|
||||
text14W500(
|
||||
contactUsController
|
||||
.contactUsDetailsChatContent[
|
||||
index]["date"],
|
||||
Row(
|
||||
children: [
|
||||
const Gap(6),
|
||||
SvgPicture.asset(
|
||||
"assets/images/svg/attachment_pin.svg"),
|
||||
const Gap(6),
|
||||
Container(
|
||||
width: 0.7.sw,
|
||||
child: FittedBox(
|
||||
child: text12W400(
|
||||
contactUsController
|
||||
.attachmentPathNameDetailsList[
|
||||
index]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
contactUsController
|
||||
.attachmentPathNameDetailsList
|
||||
.removeAt(index);
|
||||
contactUsController
|
||||
.attachmentFileDetailsList
|
||||
.removeAt(index);
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets
|
||||
.only(right: 20),
|
||||
child: SvgPicture.asset(
|
||||
"assets/images/svg/cross_cancel.svg",
|
||||
color: const Color(
|
||||
0xFF818181),
|
||||
width: 10,
|
||||
height: 10,
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
const Gap(18),
|
||||
text16W400(
|
||||
);
|
||||
}),
|
||||
contactUsController
|
||||
.contactUsDetailsChatContent.isEmpty
|
||||
? const SizedBox()
|
||||
: const Gap(18),
|
||||
ListView.builder(
|
||||
physics:
|
||||
const NeverScrollableScrollPhysics(),
|
||||
shrinkWrap: true,
|
||||
itemCount: contactUsController
|
||||
.contactUsDetailsChatContent
|
||||
.length +
|
||||
1,
|
||||
itemBuilder: (ctx, index) {
|
||||
return index ==
|
||||
contactUsController
|
||||
.contactUsDetailsChatContent[
|
||||
index]["content"],
|
||||
)
|
||||
],
|
||||
),
|
||||
));
|
||||
}),
|
||||
]),
|
||||
),
|
||||
)
|
||||
]),
|
||||
],
|
||||
.contactUsDetailsChatContent
|
||||
.length
|
||||
? (contactUsController
|
||||
.ticketDetailsModel!
|
||||
.data![0]
|
||||
.status ==
|
||||
2 ||
|
||||
contactUsController
|
||||
.ticketDetailsModel!
|
||||
.data![0]
|
||||
.status ==
|
||||
3)
|
||||
? SizedBox()
|
||||
: Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 20),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.end,
|
||||
mainAxisSize:
|
||||
MainAxisSize.min,
|
||||
children: [
|
||||
Stack(
|
||||
children: [
|
||||
CustomTextFormField3(
|
||||
texttype:
|
||||
TextInputType
|
||||
.multiline,
|
||||
hintText:
|
||||
"Enter some text...",
|
||||
textEditingController:
|
||||
queriesTextController,
|
||||
maxlines: 8,
|
||||
validator:
|
||||
(value) {
|
||||
if (value
|
||||
.isEmpty) {
|
||||
return 'Enter your Content';
|
||||
} else if (value
|
||||
.toString()
|
||||
.length <
|
||||
30) {
|
||||
return 'Content should be minimum 30 characters';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(
|
||||
200),
|
||||
],
|
||||
),
|
||||
Positioned(
|
||||
bottom: 15,
|
||||
left: 37,
|
||||
right: 37,
|
||||
child: SizedBox(
|
||||
width: 200.w,
|
||||
child: kycBtn(
|
||||
text:
|
||||
"Close Ticket",
|
||||
onTap: () {
|
||||
CancelTicketBottomSheet()
|
||||
.bottomSheet(
|
||||
context,
|
||||
contactUsController
|
||||
.ticketDetailsModel!
|
||||
.data![
|
||||
0]
|
||||
.id!,
|
||||
);
|
||||
},
|
||||
bgClr: const Color(
|
||||
0xFF111313),
|
||||
borderClr:
|
||||
const Color(
|
||||
0xFF990000),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
// contactUsController
|
||||
// .attachmentPathNameDetailsList
|
||||
// .length >=
|
||||
// 3
|
||||
// ? const SizedBox()
|
||||
// : const Gap(10),
|
||||
// contactUsController
|
||||
// .attachmentPathNameDetailsList
|
||||
// .length >=
|
||||
// 3
|
||||
// ? const SizedBox()
|
||||
// : InkWell(
|
||||
// onTap: () async {
|
||||
// var result =
|
||||
// await FilePickerMethod()
|
||||
// .pickFile();
|
||||
// if (result !=
|
||||
// null) {
|
||||
// contactUsController
|
||||
// .attachmentPathNameDetailsList
|
||||
// .clear();
|
||||
|
||||
// for (var a
|
||||
// in result) {
|
||||
// contactUsController
|
||||
// .attachmentFileDetailsList
|
||||
// .add(a);
|
||||
// }
|
||||
|
||||
// for (var a
|
||||
// in contactUsController
|
||||
// .attachmentFileDetailsList) {
|
||||
// contactUsController
|
||||
// .attachmentPathNameDetailsList
|
||||
// .add(FilePickerMethod().extractFileName(
|
||||
// a?.path ??
|
||||
// ''));
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// child: Row(
|
||||
// mainAxisAlignment:
|
||||
// MainAxisAlignment
|
||||
// .end,
|
||||
// children: [
|
||||
// SvgPicture.asset(
|
||||
// "assets/images/svg/attachment_pin.svg"),
|
||||
// const Gap(6),
|
||||
// text12W400(
|
||||
// "Add Attachment (Max 32MB / Optional)"),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
const Gap(20),
|
||||
Padding(
|
||||
padding: const EdgeInsets
|
||||
.symmetric(
|
||||
// horizontal: 10,
|
||||
vertical: 20),
|
||||
child: SizedBox(
|
||||
width: Get.width,
|
||||
child: kycBtn(
|
||||
text: "Submit",
|
||||
onTap: () {
|
||||
if (queriesTextController
|
||||
.text
|
||||
.isEmpty) {
|
||||
utils.showToast(
|
||||
"Text is required");
|
||||
} else {
|
||||
ContactUsApi()
|
||||
.addTicketMessageApi(
|
||||
FormData
|
||||
.fromMap({
|
||||
"description":
|
||||
queriesTextController
|
||||
.text,
|
||||
"ticket_xid":
|
||||
contactUsController
|
||||
.ticketDetailsModel!
|
||||
.data![0]
|
||||
.id
|
||||
}))
|
||||
.then(
|
||||
(value) {
|
||||
Map<String,
|
||||
dynamic>
|
||||
responseData =
|
||||
Map<String,
|
||||
dynamic>.from(value.data);
|
||||
utils.showToast(
|
||||
responseData[
|
||||
"message"]);
|
||||
contactUsController
|
||||
.contactUsDetailsChatContent
|
||||
.add({
|
||||
"initial_name":
|
||||
"TS",
|
||||
"date": contactUsController.formatedDateTimeMethod(
|
||||
responseData["data"]
|
||||
[
|
||||
"created_at"]),
|
||||
"content":
|
||||
responseData["data"]
|
||||
[
|
||||
"response"],
|
||||
});
|
||||
queriesTextController
|
||||
.clear();
|
||||
});
|
||||
}
|
||||
},
|
||||
bgClr: const Color(
|
||||
0xFF6C0000),
|
||||
borderClr:
|
||||
const Color(
|
||||
0xFF990000),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
width: 1.sw,
|
||||
margin:
|
||||
const EdgeInsets.symmetric(
|
||||
vertical: 5,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
const Color(0xFF0C0C0C),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
8),
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(
|
||||
0.98, -0.21),
|
||||
end: const Alignment(
|
||||
-0.98, 0.21),
|
||||
colors: [
|
||||
Colors.white.withOpacity(
|
||||
0.03999999910593033),
|
||||
Colors.white.withOpacity(
|
||||
0.05999999865889549)
|
||||
],
|
||||
),
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: const Color(
|
||||
0xFF3A3A3A))),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(
|
||||
12.0),
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment
|
||||
.start,
|
||||
mainAxisSize:
|
||||
MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.spaceBetween,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 18,
|
||||
backgroundColor:
|
||||
Colors.white,
|
||||
child: Center(
|
||||
child: text16W600(
|
||||
contactUsController
|
||||
.contactUsDetailsChatContent[
|
||||
index]
|
||||
[
|
||||
"initial_name"],
|
||||
clr: const Color(
|
||||
0xFF535353)),
|
||||
),
|
||||
),
|
||||
text14W500(
|
||||
contactUsController
|
||||
.contactUsDetailsChatContent[
|
||||
index]["date"],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Gap(18),
|
||||
text16W400(
|
||||
contactUsController
|
||||
.contactUsDetailsChatContent[
|
||||
index]["content"],
|
||||
)
|
||||
],
|
||||
),
|
||||
));
|
||||
}),
|
||||
]),
|
||||
),
|
||||
)
|
||||
]),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,798 +1,168 @@
|
||||
import 'dart:developer';
|
||||
import 'dart:ffi';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:traderscircuit/controller/contact_us_controller.dart';
|
||||
import 'package:traderscircuit/model/ContactUsModel/contact_us_cat_model.dart';
|
||||
import 'package:traderscircuit/model/ContactUsModel/contact_us_model.dart'
|
||||
as ContactModel;
|
||||
import 'package:traderscircuit/model/ContactUsModel/contact_us_model.dart';
|
||||
import 'package:traderscircuit/resources/routes/route_name.dart';
|
||||
import 'package:traderscircuit/view_model/ContactUsApi/contact_us_api.dart';
|
||||
import '../../../Utils/Common/CommonAppbar.dart';
|
||||
import '../../../Utils/Common/commonBotton.dart';
|
||||
import '../../../Utils/text.dart';
|
||||
import '../../onBoarding/splashScreen1.dart';
|
||||
import 'create_ticket_bottom_sheet.dart';
|
||||
|
||||
class ContactUsMainScreen extends StatefulWidget {
|
||||
const ContactUsMainScreen({super.key});
|
||||
|
||||
@override
|
||||
State<ContactUsMainScreen> createState() => _ContactUsMainScreenState();
|
||||
}
|
||||
|
||||
Map<int, List<ContactModel.Data>> status1Map = {};
|
||||
Map<int, List<ContactModel.Data>> status2Map = {};
|
||||
Map<int, List<ContactModel.Data>> status3Map = {};
|
||||
|
||||
class _ContactUsMainScreenState extends State<ContactUsMainScreen> {
|
||||
ContactUsController contactUsController = Get.put(ContactUsController());
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
contactUsController.isLoading.value == true;
|
||||
ContactUsApi().getContactUsCategoriesData().then((value) {
|
||||
contactUsController.contactCatModel =
|
||||
ContactUsCatModel.fromJson(value.data);
|
||||
|
||||
ContactUsApi().getContactUsData().then((value) {
|
||||
contactUsController.contactModel = ContactUsModel.fromJson(value.data);
|
||||
contactUsController.isLoading.value = false;
|
||||
log(contactUsController.isLoading.value.toString());
|
||||
status1Map.clear();
|
||||
status2Map.clear();
|
||||
status3Map.clear();
|
||||
// Iterate over the data and categorize them based on their status
|
||||
for (var item in contactUsController.contactModel!.data!) {
|
||||
if (item.status == 1) {
|
||||
status1Map.putIfAbsent(item.status!, () => []).add(item);
|
||||
} else if (item.status == 2) {
|
||||
status2Map.putIfAbsent(item.status!, () => []).add(item);
|
||||
} else if (item.status == 3) {
|
||||
status3Map.putIfAbsent(item.status!, () => []).add(item);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
status1Map.clear();
|
||||
status2Map.clear();
|
||||
status3Map.clear();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Obx(() => DefaultTabController(
|
||||
length: 4,
|
||||
child: Scaffold(
|
||||
appBar: CommonAppbar(
|
||||
height: 75,
|
||||
titleTxt: "",
|
||||
customActionWidget: text16W400(""),
|
||||
),
|
||||
backgroundColor: Colors.black,
|
||||
extendBody: true,
|
||||
bottomNavigationBar: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 17, vertical: 40),
|
||||
child: SizedBox(
|
||||
width: Get.width,
|
||||
child: kycBtn(
|
||||
text: "Create Ticket",
|
||||
onTap: () {
|
||||
contactUsController.attachmentFileList.clear();
|
||||
contactUsController.attachmentPathNameList.clear();
|
||||
CreateTicketBottomSheet().bottomSheet(context);
|
||||
},
|
||||
bgClr: const Color(0xFF6C0000),
|
||||
borderClr: const Color(0xFF990000),
|
||||
),
|
||||
),
|
||||
),
|
||||
body: Stack(
|
||||
children: [
|
||||
const CommonBlurLeft(),
|
||||
const CommonBlurRight(),
|
||||
Stack(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16, vertical: 16),
|
||||
child: contactUsController.isLoading.value
|
||||
? Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.redAccent,
|
||||
))
|
||||
: contactUsController.contactModel.data!.isEmpty
|
||||
? Text("No Data Available")
|
||||
: ListView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
children: [
|
||||
text25W600("Contact Us"),
|
||||
const Gap(20),
|
||||
text16W400("Hi Afrid"),
|
||||
text16W400("We are here to help you Us"),
|
||||
const Gap(12),
|
||||
TabBar(
|
||||
tabAlignment: TabAlignment.start,
|
||||
labelStyle: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontFamily: "hiragino",
|
||||
),
|
||||
isScrollable: true,
|
||||
labelColor: Colors.white,
|
||||
unselectedLabelColor:
|
||||
const Color(0xFF464646),
|
||||
indicatorColor: const Color(0xFF6C0000),
|
||||
indicatorSize: TabBarIndicatorSize.tab,
|
||||
unselectedLabelStyle: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
fontFamily: "hiragino",
|
||||
),
|
||||
tabs: [
|
||||
Tab(
|
||||
text:
|
||||
"All Tickets (${contactUsController.contactModel.data!.length.toString()})"),
|
||||
Tab(
|
||||
text:
|
||||
"Open Tickets (${status1Map.values.expand((list) => list).length.toString()})"),
|
||||
Tab(
|
||||
text:
|
||||
"Closed (${status2Map.values.expand((list) => list).length.toString()})"),
|
||||
Tab(
|
||||
text:
|
||||
"Resolved (${status3Map.values.expand((list) => list).length.toString()})"),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 0.5.sh,
|
||||
child: TabBarView(children: [
|
||||
ListView.builder(
|
||||
itemCount: contactUsController
|
||||
.contactModel.data!.length,
|
||||
itemBuilder: (ctx, index) {
|
||||
return ticketCardWidget(
|
||||
index, "ALL");
|
||||
}),
|
||||
ListView.builder(
|
||||
itemCount: status1Map.values
|
||||
.expand((list) => list)
|
||||
.length,
|
||||
itemBuilder: (ctx, index) {
|
||||
return ticketCardWidget(
|
||||
index, "OPEN");
|
||||
}),
|
||||
ListView.builder(
|
||||
itemCount: status2Map.values
|
||||
.expand((list) => list)
|
||||
.length,
|
||||
itemBuilder: (ctx, index) {
|
||||
return ticketCardWidget(
|
||||
index, "CLOSED");
|
||||
}),
|
||||
ListView.builder(
|
||||
itemCount: status3Map.values
|
||||
.expand((list) => list)
|
||||
.length,
|
||||
itemBuilder: (ctx, index) {
|
||||
return ticketCardWidget(
|
||||
index, "RESOLVED");
|
||||
}),
|
||||
]),
|
||||
)
|
||||
],
|
||||
)),
|
||||
]),
|
||||
],
|
||||
),
|
||||
),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Widget ticketCardWidget(index, type) {
|
||||
ContactUsController contactUsController = Get.put(ContactUsController());
|
||||
return contactUsController.contactModel.data!.elementAt(index).status != 0 &&
|
||||
type == "ALL"
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
contactUsController.attachmentFileDetailsList.clear();
|
||||
contactUsController.attachmentPathNameDetailsList.clear();
|
||||
Get.toNamed(RouteName.contactUsMainDetails);
|
||||
},
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
height: 190,
|
||||
margin: EdgeInsets.only(bottom: 18, top: index == 0 ? 15 : 0),
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.98, -0.21),
|
||||
end: const Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.03999999910593033),
|
||||
Colors.white.withOpacity(0.05999999865889549)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(width: 1, color: Color(0xFF393939)),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 15,
|
||||
horizontal: 10,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
text16W600(contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.uniqueTicketId
|
||||
.toString()),
|
||||
Row(
|
||||
children: [
|
||||
text16W500(
|
||||
contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.status ==
|
||||
1
|
||||
? "Open"
|
||||
: contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.status ==
|
||||
2
|
||||
? "Closed"
|
||||
: "Resolved",
|
||||
clr: contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.status ==
|
||||
1
|
||||
? const Color(0xFFFFAD31)
|
||||
: contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.status ==
|
||||
2
|
||||
? const Color(0xFF95CCFF)
|
||||
: const Color(0xFF34C759)),
|
||||
const Gap(8),
|
||||
CircleAvatar(
|
||||
radius: 10,
|
||||
backgroundColor: contactUsController
|
||||
.contactModel.data!
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
contactUsController.attachmentFileDetailsList.clear();
|
||||
contactUsController.attachmentPathNameDetailsList.clear();
|
||||
|
||||
var result = await Get.toNamed(RouteName.contactUsMainDetails,
|
||||
arguments: {
|
||||
"id": contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.id
|
||||
.toString()
|
||||
});
|
||||
|
||||
if (result != null && result) {
|
||||
contactUsController.isLoading.value = true;
|
||||
ContactUsApi().getContactUsData().then((value) {
|
||||
contactUsController.allC.value = 0;
|
||||
contactUsController.openC.value = 0;
|
||||
contactUsController.closeC.value = 0;
|
||||
contactUsController.resolvedC.value = 0;
|
||||
|
||||
contactUsController.contactModel =
|
||||
ContactUsModel.fromJson(value.data);
|
||||
for (var a in contactUsController.contactModel.data!) {
|
||||
if (a.status == 1) {
|
||||
contactUsController.openC.value += 1;
|
||||
contactUsController.allC.value += 1;
|
||||
} else if (a.status == 2) {
|
||||
contactUsController.closeC.value += 1;
|
||||
contactUsController.allC.value += 1;
|
||||
} else if (a.status == 3) {
|
||||
contactUsController.resolvedC.value += 1;
|
||||
contactUsController.allC.value += 1;
|
||||
}
|
||||
}
|
||||
|
||||
contactUsController.isLoading.value = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
height: 195,
|
||||
margin: EdgeInsets.only(bottom: 18, top: index == 0 ? 15 : 0),
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.98, -0.21),
|
||||
end: const Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.03999999910593033),
|
||||
Colors.white.withOpacity(0.05999999865889549)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(width: 1, color: Color(0xFF393939)),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 15,
|
||||
horizontal: 10,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
text16W600(contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.uniqueTicketId
|
||||
.toString()),
|
||||
Row(
|
||||
children: [
|
||||
text16W500(
|
||||
contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.status ==
|
||||
1
|
||||
? "Open"
|
||||
: contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.status ==
|
||||
1
|
||||
? const Color(0xFFFFAD31)
|
||||
: contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.status ==
|
||||
2
|
||||
? const Color(0xFF95CCFF)
|
||||
: const Color(0xFF34C759),
|
||||
child: const Center(
|
||||
child: Icon(
|
||||
Icons.check_rounded,
|
||||
size: 15,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Gap(10),
|
||||
text16W600(contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.createdAt
|
||||
.toString()),
|
||||
const Gap(5),
|
||||
text16W400(contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.ticketCategory!
|
||||
.name
|
||||
.toString()),
|
||||
const Gap(22),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
),
|
||||
width: Get.width,
|
||||
height: 50,
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.black.withOpacity(0.03999999910593033),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(
|
||||
width: 1, color: Color(0xFF393939)),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: text16W400(
|
||||
contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.description
|
||||
.toString(),
|
||||
clr: const Color(0xFF9E9E9E),
|
||||
textOver: TextOverflow.ellipsis),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: type == "OPEN"
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
contactUsController.attachmentFileDetailsList.clear();
|
||||
contactUsController.attachmentPathNameDetailsList.clear();
|
||||
Get.toNamed(RouteName.contactUsMainDetails);
|
||||
},
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
height: 190,
|
||||
margin: EdgeInsets.only(bottom: 18, top: index == 0 ? 15 : 0),
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.98, -0.21),
|
||||
end: const Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.03999999910593033),
|
||||
Colors.white.withOpacity(0.05999999865889549)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(width: 1, color: Color(0xFF393939)),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 15,
|
||||
horizontal: 10,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
text16W600(status1Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.ticketCategoryXid
|
||||
.toString()),
|
||||
Row(
|
||||
children: [
|
||||
text16W500(
|
||||
status1Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"1"
|
||||
? "OPEN"
|
||||
: "Open",
|
||||
clr: status1Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"1"
|
||||
? const Color(0xFFFFAD31)
|
||||
: status1Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"2"
|
||||
? const Color(0xFF95CCFF)
|
||||
: const Color(0xFF34C759)),
|
||||
const Gap(8),
|
||||
CircleAvatar(
|
||||
radius: 10,
|
||||
backgroundColor: status1Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"1"
|
||||
? const Color(0xFFFFAD31)
|
||||
: status1Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"2"
|
||||
? const Color(0xFF95CCFF)
|
||||
: const Color(0xFF34C759),
|
||||
child: const Center(
|
||||
child: Icon(
|
||||
Icons.check_rounded,
|
||||
size: 15,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Gap(10),
|
||||
text16W600(status1Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.createdAt
|
||||
.toString()),
|
||||
const Gap(5),
|
||||
text16W400(status1Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.ticketCategory!
|
||||
.name
|
||||
.toString()),
|
||||
const Gap(22),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
),
|
||||
width: Get.width,
|
||||
height: 50,
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.black.withOpacity(0.03999999910593033),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(
|
||||
width: 1, color: Color(0xFF393939)),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: text16W400(
|
||||
status1Map.values
|
||||
.expand((list) => list)
|
||||
2
|
||||
? "Closed"
|
||||
: "Resolved",
|
||||
clr: contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.status ==
|
||||
1
|
||||
? const Color(0xFFFFAD31)
|
||||
: contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.status ==
|
||||
2
|
||||
? const Color(0xFF95CCFF)
|
||||
: const Color(0xFF34C759)),
|
||||
const Gap(8),
|
||||
CircleAvatar(
|
||||
radius: 10,
|
||||
backgroundColor: contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.description
|
||||
.toString(),
|
||||
clr: const Color(0xFF9E9E9E),
|
||||
textOver: TextOverflow.ellipsis),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: type == "CLOSED"
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
contactUsController.attachmentFileDetailsList.clear();
|
||||
contactUsController.attachmentPathNameDetailsList.clear();
|
||||
Get.toNamed(RouteName.contactUsMainDetails);
|
||||
},
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
height: 190,
|
||||
margin:
|
||||
EdgeInsets.only(bottom: 18, top: index == 0 ? 15 : 0),
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.98, -0.21),
|
||||
end: const Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.03999999910593033),
|
||||
Colors.white.withOpacity(0.05999999865889549)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(
|
||||
width: 1, color: Color(0xFF393939)),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 15,
|
||||
horizontal: 10,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
text16W600(status2Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.ticketCategoryXid
|
||||
.toString()),
|
||||
Row(
|
||||
children: [
|
||||
text16W500(
|
||||
status2Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"2"
|
||||
? "CLOSED"
|
||||
: "Closed",
|
||||
clr: status2Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"1"
|
||||
? const Color(0xFFFFAD31)
|
||||
: status2Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"2"
|
||||
? const Color(0xFF95CCFF)
|
||||
: const Color(0xFF34C759)),
|
||||
const Gap(8),
|
||||
CircleAvatar(
|
||||
radius: 10,
|
||||
backgroundColor: status2Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"1"
|
||||
? const Color(0xFFFFAD31)
|
||||
: status2Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"2"
|
||||
? const Color(0xFF95CCFF)
|
||||
: const Color(0xFF34C759),
|
||||
child: const Center(
|
||||
child: Icon(
|
||||
Icons.check_rounded,
|
||||
size: 15,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Gap(10),
|
||||
text16W600(status2Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.createdAt
|
||||
.toString()),
|
||||
const Gap(5),
|
||||
text16W400(status2Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.ticketCategory!
|
||||
.name
|
||||
.toString()),
|
||||
const Gap(22),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
),
|
||||
width: Get.width,
|
||||
height: 50,
|
||||
decoration: ShapeDecoration(
|
||||
color:
|
||||
Colors.black.withOpacity(0.03999999910593033),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(
|
||||
width: 1, color: Color(0xFF393939)),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: text16W400(
|
||||
status2Map.values
|
||||
.expand((list) => list)
|
||||
.status ==
|
||||
1
|
||||
? const Color(0xFFFFAD31)
|
||||
: contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.description
|
||||
.toString(),
|
||||
clr: const Color(0xFF9E9E9E),
|
||||
textOver: TextOverflow.ellipsis),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: type == "RESOLVED"
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
contactUsController.attachmentFileDetailsList.clear();
|
||||
contactUsController.attachmentPathNameDetailsList
|
||||
.clear();
|
||||
Get.toNamed(RouteName.contactUsMainDetails);
|
||||
},
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
height: 190,
|
||||
margin: EdgeInsets.only(
|
||||
bottom: 18, top: index == 0 ? 15 : 0),
|
||||
decoration: ShapeDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: const Alignment(0.98, -0.21),
|
||||
end: const Alignment(-0.98, 0.21),
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.03999999910593033),
|
||||
Colors.white.withOpacity(0.05999999865889549)
|
||||
],
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(
|
||||
width: 1, color: Color(0xFF393939)),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 15,
|
||||
horizontal: 10,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
text16W600(status3Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.ticketCategoryXid
|
||||
.toString()),
|
||||
Row(
|
||||
children: [
|
||||
text16W500(
|
||||
status3Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"3"
|
||||
? "RESOLVED"
|
||||
: "Resolved",
|
||||
clr: status3Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"1"
|
||||
? const Color(0xFFFFAD31)
|
||||
: status3Map.values
|
||||
.expand(
|
||||
(list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"2"
|
||||
? const Color(0xFF95CCFF)
|
||||
: const Color(0xFF34C759)),
|
||||
const Gap(8),
|
||||
CircleAvatar(
|
||||
radius: 10,
|
||||
backgroundColor: status3Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"1"
|
||||
? const Color(0xFFFFAD31)
|
||||
: status3Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.status
|
||||
.toString() ==
|
||||
"2"
|
||||
? const Color(0xFF95CCFF)
|
||||
: const Color(0xFF34C759),
|
||||
child: const Center(
|
||||
child: Icon(
|
||||
Icons.check_rounded,
|
||||
size: 15,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Gap(10),
|
||||
text16W600(status3Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.createdAt
|
||||
.toString()),
|
||||
const Gap(5),
|
||||
text16W400(status3Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.ticketCategory!
|
||||
.name
|
||||
.toString()),
|
||||
const Gap(22),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
),
|
||||
width: Get.width,
|
||||
height: 50,
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.black
|
||||
.withOpacity(0.03999999910593033),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(
|
||||
width: 1, color: Color(0xFF393939)),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: text16W400(
|
||||
status3Map.values
|
||||
.expand((list) => list)
|
||||
.elementAt(index)
|
||||
.description
|
||||
.toString(),
|
||||
clr: const Color(0xFF9E9E9E),
|
||||
textOver: TextOverflow.ellipsis),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
.status ==
|
||||
2
|
||||
? const Color(0xFF95CCFF)
|
||||
: const Color(0xFF34C759),
|
||||
child: const Center(
|
||||
child: Icon(
|
||||
Icons.check_rounded,
|
||||
size: 15,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
)
|
||||
: SizedBox();
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
const Gap(10),
|
||||
text16W600(contactUsController.formatedDateTimeMethod(
|
||||
contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.createdAt
|
||||
.toString())),
|
||||
const Gap(5),
|
||||
text16W400(contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.ticketCategory!
|
||||
.name
|
||||
.toString()),
|
||||
const Gap(22),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
),
|
||||
width: Get.width,
|
||||
height: 50,
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.black.withOpacity(0.03999999910593033),
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(width: 1, color: Color(0xFF393939)),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: text16W400(
|
||||
contactUsController.contactModel.data!
|
||||
.elementAt(index)
|
||||
.description
|
||||
.toString(),
|
||||
clr: const Color(0xFF9E9E9E),
|
||||
textOver: TextOverflow.ellipsis),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<dynamic> dataL = [
|
||||
{
|
||||
"id": "#13569412",
|
||||
"date": "16 Feb 2024, 11 : 35PM",
|
||||
"category": "Account Management",
|
||||
"desc":
|
||||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500. Lorem Ipsum has been the industry's standard dummy text ever since the 1500",
|
||||
"type": "OPEN"
|
||||
},
|
||||
{
|
||||
"id": "#13569412",
|
||||
"date": "16 Feb 2024, 11 : 35PM",
|
||||
"category": "Technical Support",
|
||||
"desc":
|
||||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500. Lorem Ipsum has been the industry's standard dummy text ever since the 1500",
|
||||
"type": "CLOSED"
|
||||
},
|
||||
{
|
||||
"id": "#13569412",
|
||||
"date": "16 Feb 2024, 11 : 35PM",
|
||||
"category": "Feedback and Suggestions",
|
||||
"desc":
|
||||
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500. Lorem Ipsum has been the industry's standard dummy text ever since the 1500",
|
||||
"type": "RESOLVED"
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -8,7 +10,6 @@ import 'package:get/get.dart' hide MultipartFile, FormData;
|
||||
import 'package:traderscircuit/Utils/base_manager.dart';
|
||||
import 'package:traderscircuit/Utils/text.dart';
|
||||
import 'package:traderscircuit/Utils/utils.dart';
|
||||
import 'package:traderscircuit/resources/routes/route_name.dart';
|
||||
import 'package:traderscircuit/view_model/ContactUsApi/contact_us_api.dart';
|
||||
|
||||
import '../../../Utils/Common/CustomTextFormField.dart';
|
||||
@@ -16,6 +17,7 @@ import '../../../Utils/Common/FilePicker.dart';
|
||||
import '../../../Utils/Common/commonBotton.dart';
|
||||
import '../../../Utils/Common/custom_drop_down.dart';
|
||||
import '../../../controller/contact_us_controller.dart';
|
||||
import '../../../model/ContactUsModel/contact_us_model.dart';
|
||||
import 'ticket_confirmed_bottom_sheet.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
@@ -65,6 +67,15 @@ class CreateTicketBottomSheet {
|
||||
|
||||
final isValid = _addTicketform.currentState?.validate();
|
||||
if (isValid!) {
|
||||
for (var item in contactUsController.contactCatModel.data!) {
|
||||
log(item.name!);
|
||||
log(contactUsController.selectedValue.toString());
|
||||
if (item.name == contactUsController.selectedValue.toString()) {
|
||||
ticketid = item.id;
|
||||
break; // Stop loop once match is found
|
||||
}
|
||||
}
|
||||
|
||||
Utils.loader();
|
||||
FormData formdata = FormData.fromMap({
|
||||
"description": descriptionController.text,
|
||||
@@ -74,9 +85,35 @@ class CreateTicketBottomSheet {
|
||||
|
||||
final resp = await ContactUsApi().addTicketApi(formdata);
|
||||
if (resp.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(resp.data);
|
||||
int id = responseData["data"]["unique_ticket_id"];
|
||||
Get.back();
|
||||
contactUsController.isLoading.value = true;
|
||||
contactUsController.allC.value = 0;
|
||||
contactUsController.openC.value = 0;
|
||||
contactUsController.closeC.value = 0;
|
||||
contactUsController.resolvedC.value = 0;
|
||||
contactUsController.selectedValue.value = "";
|
||||
ContactUsApi().getContactUsData().then((value) {
|
||||
contactUsController.contactModel =
|
||||
ContactUsModel.fromJson(value.data);
|
||||
for (var a in contactUsController.contactModel.data!) {
|
||||
if (a.status == 1) {
|
||||
contactUsController.openC.value += 1;
|
||||
contactUsController.allC.value += 1;
|
||||
} else if (a.status == 2) {
|
||||
contactUsController.closeC.value += 1;
|
||||
contactUsController.allC.value += 1;
|
||||
} else if (a.status == 3) {
|
||||
contactUsController.resolvedC.value += 1;
|
||||
contactUsController.allC.value += 1;
|
||||
}
|
||||
}
|
||||
contactUsController.isLoading.value = false;
|
||||
});
|
||||
print("success");
|
||||
TicketConfirmedBottomSheet().bottomSheet(context);
|
||||
TicketConfirmedBottomSheet().bottomSheet(context, id);
|
||||
} else if (resp.status == ResponseStatus.PRIVATE) {
|
||||
Get.back();
|
||||
List? message = resp.data['message'];
|
||||
@@ -107,177 +144,182 @@ class CreateTicketBottomSheet {
|
||||
),
|
||||
builder: (BuildContext context) {
|
||||
return Obx(
|
||||
() => Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 20),
|
||||
child: Wrap(
|
||||
children: [
|
||||
Form(
|
||||
key: _addTicketform,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: SvgPicture.asset(
|
||||
"assets/images/svg/cross_cancel.svg")),
|
||||
],
|
||||
),
|
||||
const Gap(16),
|
||||
text18W600("Raise a Ticket"),
|
||||
const Gap(20),
|
||||
CustomDropDownWidget(
|
||||
header: "Choose your query",
|
||||
listData: namesList,
|
||||
title: "",
|
||||
),
|
||||
const Gap(14),
|
||||
Stack(
|
||||
children: [
|
||||
CustomTextFormField3(
|
||||
texttype: TextInputType.multiline,
|
||||
hintText: "Description (min 30 characters)",
|
||||
textEditingController: descriptionController,
|
||||
maxlines: 8,
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Enter your description';
|
||||
} else if (value.toString().length < 30) {
|
||||
return 'Description should be minimum 30 characters';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(150),
|
||||
],
|
||||
),
|
||||
contactUsController.attachmentPathNameList.isEmpty
|
||||
? const SizedBox()
|
||||
: Positioned(
|
||||
bottom: 8,
|
||||
left: 9,
|
||||
right: 9,
|
||||
child: SizedBox(
|
||||
width: 1.sw,
|
||||
height: 37.h,
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: contactUsController
|
||||
.attachmentPathNameList.length,
|
||||
itemBuilder: (ctx, index) {
|
||||
return Container(
|
||||
width: 210.w,
|
||||
height: 37.h,
|
||||
margin:
|
||||
const EdgeInsets.only(right: 5),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: const Color(
|
||||
0xFF3A3A3A))),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Gap(6),
|
||||
SvgPicture.asset(
|
||||
"assets/images/svg/attachment_pin.svg"),
|
||||
const Gap(6),
|
||||
SizedBox(
|
||||
width: 120,
|
||||
child: FittedBox(
|
||||
child: text12W400(
|
||||
contactUsController
|
||||
.attachmentPathNameList[
|
||||
index]))),
|
||||
const Gap(15),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
contactUsController
|
||||
.attachmentPathNameList
|
||||
.removeAt(index);
|
||||
contactUsController
|
||||
.attachmentFileList
|
||||
.removeAt(index);
|
||||
},
|
||||
child: SvgPicture.asset(
|
||||
"assets/images/svg/cross_cancel.svg",
|
||||
color: const Color(
|
||||
0xFF818181),
|
||||
width: 8,
|
||||
height: 8,
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
))
|
||||
],
|
||||
),
|
||||
contactUsController.attachmentPathNameList.length >= 3
|
||||
? const SizedBox()
|
||||
: const Gap(10),
|
||||
contactUsController.attachmentPathNameList.length >= 3
|
||||
? const SizedBox()
|
||||
: InkWell(
|
||||
onTap: () async {
|
||||
var result =
|
||||
await FilePickerMethod().pickFile();
|
||||
if (result != null) {
|
||||
contactUsController.attachmentPathNameList
|
||||
.clear();
|
||||
|
||||
for (var a in result) {
|
||||
contactUsController.attachmentFileList
|
||||
.add(a);
|
||||
}
|
||||
|
||||
for (var a in contactUsController
|
||||
.attachmentFileList) {
|
||||
contactUsController.attachmentPathNameList
|
||||
.add(FilePickerMethod()
|
||||
.extractFileName(a?.path ?? ''));
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
"assets/images/svg/attachment_pin.svg"),
|
||||
const Gap(5),
|
||||
text12W400(
|
||||
"Add Attachment (Max 3 files of 2MB each / Optional)"),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Gap(20),
|
||||
SizedBox(
|
||||
width: Get.width,
|
||||
child: kycBtn(
|
||||
text: "Create Ticket",
|
||||
onTap: () {
|
||||
Get.back();
|
||||
// TicketConfirmedBottomSheet().bottomSheet(context);
|
||||
_addTicket();
|
||||
},
|
||||
bgClr: const Color(0xFF6C0000),
|
||||
borderClr: const Color(0xFF990000),
|
||||
() => Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: MediaQuery.of(context).viewInsets.bottom),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 20),
|
||||
child: Wrap(
|
||||
children: [
|
||||
Form(
|
||||
key: _addTicketform,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: SvgPicture.asset(
|
||||
"assets/images/svg/cross_cancel.svg")),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Gap(30),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
const Gap(16),
|
||||
text18W600("Raise a Ticket"),
|
||||
const Gap(20),
|
||||
CustomDropDownWidget(
|
||||
header: "Choose your query",
|
||||
listData: namesList,
|
||||
title: "",
|
||||
type: "ticket",
|
||||
),
|
||||
const Gap(14),
|
||||
Stack(
|
||||
children: [
|
||||
CustomTextFormField3(
|
||||
texttype: TextInputType.multiline,
|
||||
hintText: "Description (min 30 characters)",
|
||||
textEditingController: descriptionController,
|
||||
maxlines: 8,
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Enter your description';
|
||||
} else if (value.toString().length < 30) {
|
||||
return 'Description should be minimum 30 characters';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(150),
|
||||
],
|
||||
),
|
||||
contactUsController.attachmentPathNameList.isEmpty
|
||||
? const SizedBox()
|
||||
: Positioned(
|
||||
bottom: 8,
|
||||
left: 9,
|
||||
right: 9,
|
||||
child: SizedBox(
|
||||
width: 1.sw,
|
||||
height: 37.h,
|
||||
child: ListView.builder(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: contactUsController
|
||||
.attachmentPathNameList.length,
|
||||
itemBuilder: (ctx, index) {
|
||||
return Container(
|
||||
width: 210.w,
|
||||
height: 37.h,
|
||||
margin: const EdgeInsets.only(
|
||||
right: 5),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius:
|
||||
BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: const Color(
|
||||
0xFF3A3A3A))),
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Gap(6),
|
||||
SvgPicture.asset(
|
||||
"assets/images/svg/attachment_pin.svg"),
|
||||
const Gap(6),
|
||||
SizedBox(
|
||||
width: 120,
|
||||
child: FittedBox(
|
||||
child: text12W400(
|
||||
contactUsController
|
||||
.attachmentPathNameList[
|
||||
index]))),
|
||||
const Gap(15),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
contactUsController
|
||||
.attachmentPathNameList
|
||||
.removeAt(index);
|
||||
contactUsController
|
||||
.attachmentFileList
|
||||
.removeAt(index);
|
||||
},
|
||||
child: SvgPicture.asset(
|
||||
"assets/images/svg/cross_cancel.svg",
|
||||
color: const Color(
|
||||
0xFF818181),
|
||||
width: 8,
|
||||
height: 8,
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
))
|
||||
],
|
||||
),
|
||||
contactUsController.attachmentPathNameList.length >= 3
|
||||
? const SizedBox()
|
||||
: const Gap(10),
|
||||
contactUsController.attachmentPathNameList.length >= 3
|
||||
? const SizedBox()
|
||||
: InkWell(
|
||||
onTap: () async {
|
||||
var result =
|
||||
await FilePickerMethod().pickFile();
|
||||
if (result != null) {
|
||||
contactUsController.attachmentPathNameList
|
||||
.clear();
|
||||
|
||||
for (var a in result) {
|
||||
contactUsController.attachmentFileList
|
||||
.add(a);
|
||||
}
|
||||
|
||||
for (var a in contactUsController
|
||||
.attachmentFileList) {
|
||||
contactUsController.attachmentPathNameList
|
||||
.add(FilePickerMethod()
|
||||
.extractFileName(a?.path ?? ''));
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
SvgPicture.asset(
|
||||
"assets/images/svg/attachment_pin.svg"),
|
||||
const Gap(5),
|
||||
text12W400(
|
||||
"Add Attachment (Max 3 files of 2MB each / Optional)"),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Gap(20),
|
||||
SizedBox(
|
||||
width: Get.width,
|
||||
child: kycBtn(
|
||||
text: "Create Ticket",
|
||||
onTap: () {
|
||||
Get.back();
|
||||
// TicketConfirmedBottomSheet().bottomSheet(context);
|
||||
_addTicket();
|
||||
},
|
||||
bgClr: const Color(0xFF6C0000),
|
||||
borderClr: const Color(0xFF990000),
|
||||
),
|
||||
),
|
||||
const Gap(30),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -11,6 +11,7 @@ import '../../../Utils/Common/commonBotton.dart';
|
||||
class TicketConfirmedBottomSheet {
|
||||
bottomSheet(
|
||||
BuildContext context,
|
||||
int id,
|
||||
) {
|
||||
return showModalBottomSheet(
|
||||
useSafeArea: true,
|
||||
@@ -52,7 +53,7 @@ class TicketConfirmedBottomSheet {
|
||||
height: 140,
|
||||
),
|
||||
const Gap(10),
|
||||
text18W600("#18663765"),
|
||||
text18W600("#$id"),
|
||||
const Gap(8),
|
||||
text18W400(
|
||||
"Your ticket has been created successfully. our support team will get back to you in 24-48 business hours.",
|
||||
|
||||
@@ -44,7 +44,6 @@ class _MyProfileScreenState extends State<MyProfileScreen> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
myfuture = GetProfile().GetProfileAPI().then((value) {
|
||||
profileModel = ProfileModel.fromJson(value.data);
|
||||
fullNameController.text = ProfileObj!.data!.userName ?? "User";
|
||||
@@ -113,7 +112,7 @@ class _MyProfileScreenState extends State<MyProfileScreen> {
|
||||
} else {
|
||||
if (editProfileImage.profilePicPath.value.isEmpty) {
|
||||
imageFile = await Helper.networkImageToMultipartFile(
|
||||
"${ProfileObj!.data!.profilePhoto ?? ""}",
|
||||
ProfileObj!.data!.profilePhoto ?? "",
|
||||
);
|
||||
} else {
|
||||
imageFile = await MultipartFile.fromFile(
|
||||
@@ -280,33 +279,38 @@ class _MyProfileScreenState extends State<MyProfileScreen> {
|
||||
)),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet().showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
print("File path is $result");
|
||||
editProfileImage.profilePicPath
|
||||
.value = result;
|
||||
},
|
||||
);
|
||||
},
|
||||
child: CircleAvatar(
|
||||
radius: 20.r,
|
||||
backgroundColor:
|
||||
const Color(0xFF5A5A5A),
|
||||
child: Icon(
|
||||
Icons.camera_alt_outlined,
|
||||
size: 20.sp,
|
||||
color: Colors.white,
|
||||
!isEdit.value
|
||||
? SizedBox()
|
||||
: Positioned(
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
ImageUploadBottomSheet()
|
||||
.showModal(
|
||||
context,
|
||||
false,
|
||||
(result) {
|
||||
print(
|
||||
"File path is $result");
|
||||
editProfileImage
|
||||
.profilePicPath
|
||||
.value = result;
|
||||
},
|
||||
);
|
||||
},
|
||||
child: CircleAvatar(
|
||||
radius: 20.r,
|
||||
backgroundColor:
|
||||
const Color(0xFF5A5A5A),
|
||||
child: Icon(
|
||||
Icons.camera_alt_outlined,
|
||||
size: 20.sp,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -202,6 +202,7 @@ class _UpdateRiskProfileState extends State<UpdateRiskProfile> {
|
||||
header: headerText,
|
||||
listData: dropHeader[index][tilte]!,
|
||||
title: tilte,
|
||||
type: "risk",
|
||||
),
|
||||
SizedBox(
|
||||
height: 35.h,
|
||||
|
||||
@@ -71,15 +71,16 @@ class _VerifyOTPState extends State<VerifyOTP> {
|
||||
// ProfileApi().GetProfileApi().then(
|
||||
// (value) {
|
||||
|
||||
isSecuredAccess == 0
|
||||
? Get.toNamed(RouteName.secureaccess)
|
||||
: isProfileUpdated == 0
|
||||
? Get.toNamed(RouteName.adddetails)
|
||||
: isKycUpdated == 0
|
||||
? Get.toNamed(RouteName.kyc)
|
||||
: isriskProfileUpdated == 0
|
||||
? Get.toNamed(RouteName.updateriskprofile)
|
||||
: Get.toNamed(RouteName.mainscreen);
|
||||
// isSecuredAccess == 0
|
||||
// ? Get.toNamed(RouteName.secureaccess)
|
||||
// :
|
||||
isProfileUpdated == 0
|
||||
? Get.toNamed(RouteName.adddetails)
|
||||
: isKycUpdated == 0
|
||||
? Get.toNamed(RouteName.kyc)
|
||||
: isriskProfileUpdated == 0
|
||||
? Get.toNamed(RouteName.updateriskprofile)
|
||||
: Get.toNamed(RouteName.mainscreen);
|
||||
|
||||
// Get.toNamed(RouteName.mainscreen);
|
||||
// },
|
||||
|
||||
Reference in New Issue
Block a user