Merge branch 'main' into product
This commit is contained in:
@@ -85,18 +85,6 @@ class CommonAppbar extends StatelessWidget implements PreferredSizeWidget {
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
// if (calendarWidget == true)
|
||||
// InkWell(
|
||||
// onTap: onCustomActionPressed,
|
||||
// child: Padding(
|
||||
// padding: EdgeInsets.only(right: 14.w),
|
||||
// child: Icon(
|
||||
// Icons.calendar_month_outlined,
|
||||
// color: Color(0xFF3192D8),
|
||||
// size: 28,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
if (customActionWidget != null)
|
||||
InkWell(
|
||||
onTap: onCustomActionPressed,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:traderscircuit/controller/contact_us_controller.dart';
|
||||
@@ -8,14 +6,17 @@ import 'package:traderscircuit/controller/risk_profile_controller.dart';
|
||||
import '../text.dart';
|
||||
|
||||
class CustomDropDownWidget extends StatefulWidget {
|
||||
const CustomDropDownWidget(
|
||||
{super.key,
|
||||
required this.header,
|
||||
required this.title,
|
||||
required this.listData});
|
||||
const CustomDropDownWidget({
|
||||
super.key,
|
||||
required this.header,
|
||||
required this.title,
|
||||
required this.listData,
|
||||
required this.type,
|
||||
});
|
||||
final String header;
|
||||
final String title;
|
||||
final List<String> listData;
|
||||
final String type;
|
||||
|
||||
@override
|
||||
State<CustomDropDownWidget> createState() => _CustomDropDownWidgetState();
|
||||
@@ -27,6 +28,9 @@ class _CustomDropDownWidgetState extends State<CustomDropDownWidget> {
|
||||
RiskProfileController riskProfileController =
|
||||
Get.put(RiskProfileController());
|
||||
|
||||
RxBool onDropTap = false.obs;
|
||||
RxString selectedValue = "".obs;
|
||||
|
||||
void updateOrAddData(String key, String value) {
|
||||
bool keyExists = false;
|
||||
for (int i = 0; i < riskProfileController.selectedData.length; i++) {
|
||||
@@ -45,6 +49,22 @@ class _CustomDropDownWidgetState extends State<CustomDropDownWidget> {
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
if (widget.type == "risk") {
|
||||
for (int i = 0; i < riskProfileController.selectedData.length; i++) {
|
||||
Map<String, String> item = riskProfileController.selectedData[i];
|
||||
if (item.containsKey(widget.title)) {
|
||||
selectedValue.value =
|
||||
riskProfileController.selectedData[i][widget.title]!;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Obx(
|
||||
@@ -58,8 +78,7 @@ class _CustomDropDownWidgetState extends State<CustomDropDownWidget> {
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
contactUsController.onDropTap.value =
|
||||
!contactUsController.onDropTap.value;
|
||||
onDropTap.value = !onDropTap.value;
|
||||
},
|
||||
child: SizedBox(
|
||||
width: 398,
|
||||
@@ -90,7 +109,7 @@ class _CustomDropDownWidgetState extends State<CustomDropDownWidget> {
|
||||
],
|
||||
),
|
||||
border: Border(
|
||||
top: contactUsController.onDropTap.value
|
||||
top: onDropTap.value
|
||||
? const BorderSide(
|
||||
width: 0, color: Color(0xFF393939))
|
||||
: const BorderSide(
|
||||
@@ -115,9 +134,13 @@ class _CustomDropDownWidgetState extends State<CustomDropDownWidget> {
|
||||
left: 14,
|
||||
top: 16,
|
||||
child: Text(
|
||||
contactUsController.selectedValue.isNotEmpty
|
||||
? contactUsController.selectedValue.value
|
||||
: widget.header,
|
||||
widget.type == "risk"
|
||||
? (selectedValue.isNotEmpty
|
||||
? selectedValue.value
|
||||
: widget.header)
|
||||
: (contactUsController.selectedValue.isNotEmpty
|
||||
? contactUsController.selectedValue.value
|
||||
: widget.header),
|
||||
style: const TextStyle(
|
||||
color: Color(0xFFADADAD),
|
||||
fontSize: 16,
|
||||
@@ -130,7 +153,7 @@ class _CustomDropDownWidgetState extends State<CustomDropDownWidget> {
|
||||
Positioned(
|
||||
right: 14,
|
||||
top: 16,
|
||||
child: contactUsController.onDropTap.value
|
||||
child: onDropTap.value
|
||||
? const Icon(
|
||||
Icons.keyboard_arrow_up_rounded,
|
||||
color: Colors.white,
|
||||
@@ -143,7 +166,7 @@ class _CustomDropDownWidgetState extends State<CustomDropDownWidget> {
|
||||
),
|
||||
),
|
||||
),
|
||||
!contactUsController.onDropTap.value
|
||||
!onDropTap.value
|
||||
? const SizedBox()
|
||||
: Opacity(
|
||||
opacity: 0.50,
|
||||
@@ -174,10 +197,12 @@ class _CustomDropDownWidgetState extends State<CustomDropDownWidget> {
|
||||
itemBuilder: (context, index) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
contactUsController.selectedValue.value =
|
||||
widget.listData[index];
|
||||
contactUsController.onDropTap.value =
|
||||
!contactUsController.onDropTap.value;
|
||||
widget.type == "risk"
|
||||
? (selectedValue.value =
|
||||
widget.listData[index])
|
||||
: (contactUsController.selectedValue.value =
|
||||
widget.listData[index]);
|
||||
onDropTap.value = !onDropTap.value;
|
||||
updateOrAddData(
|
||||
widget.title, widget.listData[index]);
|
||||
},
|
||||
|
||||
@@ -58,4 +58,8 @@ class ApiUrls {
|
||||
static String contactuscategory = "${base}get-ticket-categories";
|
||||
static String addTicket = "${base}store-ticket";
|
||||
static String getcontactus = "${base}get-ticket-data";
|
||||
static String getcontactusDetails =
|
||||
"${base}get-detailed-ticket-data-with-chats/";
|
||||
static String sendMessage = "${base}send-message-to-admin";
|
||||
static String updateTicketStatusApi = "${base}update-ticket-status";
|
||||
}
|
||||
|
||||
56
lib/Utils/image_preview_screen.dart
Normal file
56
lib/Utils/image_preview_screen.dart
Normal file
@@ -0,0 +1,56 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:traderscircuit/Utils/text.dart';
|
||||
|
||||
import '../view/onBoarding/splashScreen1.dart';
|
||||
import 'Common/CommonAppBar.dart';
|
||||
|
||||
class ImagePreviewScreen extends StatefulWidget {
|
||||
const ImagePreviewScreen({super.key});
|
||||
|
||||
@override
|
||||
State<ImagePreviewScreen> createState() => _ImagePreviewScreenState();
|
||||
}
|
||||
|
||||
class _ImagePreviewScreenState extends State<ImagePreviewScreen> {
|
||||
String image = Get.arguments["image"];
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return 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,
|
||||
children: [
|
||||
text25W600("Image Preview"),
|
||||
const Gap(20),
|
||||
CachedNetworkImage(
|
||||
imageUrl: image,
|
||||
placeholder: (context, url) {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(
|
||||
color: Colors.redAccent,
|
||||
),
|
||||
);
|
||||
},
|
||||
)
|
||||
])))
|
||||
])
|
||||
]));
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,19 @@ import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:traderscircuit/model/ContactUsModel/contact_us_cat_model.dart';
|
||||
import 'package:traderscircuit/model/ContactUsModel/contact_us_model.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import '../model/ContactUsModel/ticket_details_model.dart';
|
||||
|
||||
class ContactUsController extends GetxController {
|
||||
RxBool isLoading = true.obs;
|
||||
bool isTicketClosed = false;
|
||||
RxBool isDetailsLoading = true.obs;
|
||||
TicketDetailsModel? ticketDetailsModel;
|
||||
RxInt allC = 0.obs;
|
||||
RxInt openC = 0.obs;
|
||||
RxInt closeC = 0.obs;
|
||||
RxInt resolvedC = 0.obs;
|
||||
//contact us page controller
|
||||
RxList<File?> attachmentFileList = [File("")].obs;
|
||||
RxList<String> attachmentPathNameList = [""].obs;
|
||||
@@ -18,9 +28,9 @@ class ContactUsController extends GetxController {
|
||||
ContactUsCatModel contactCatModel = ContactUsCatModel();
|
||||
ContactUsModel contactModel = ContactUsModel();
|
||||
|
||||
RxBool onDropTap = false.obs;
|
||||
RxString selectedValue = "".obs;
|
||||
|
||||
|
||||
RxInt allC = 0.obs;
|
||||
RxInt openC = 0.obs;
|
||||
RxInt closeC = 0.obs;
|
||||
@@ -46,15 +56,12 @@ when looking at its layout. The point of using Lorem Ipsum is that it has a more
|
||||
|
||||
using 'Content here, content here', making it look like readable English.
|
||||
|
||||
Regards,
|
||||
Centralised Service Desk
|
||||
String formatedDateTimeMethod(String originalDateTimeString) {
|
||||
DateTime dateTime = DateTime.parse(originalDateTimeString);
|
||||
|
||||
Traders Circuit""",
|
||||
},
|
||||
{
|
||||
"initial_name": "AM",
|
||||
"date": "16 Feb 2024, 11 : 35PM",
|
||||
"content": "Thank You.......",
|
||||
}
|
||||
].obs;
|
||||
|
||||
return DateFormat("dd MMM yyyy, hh:mm a").format(dateTime.toLocal());
|
||||
}
|
||||
|
||||
RxList<dynamic> contactUsDetailsChatContent = [].obs;
|
||||
}
|
||||
|
||||
210
lib/model/ContactUsModel/ticket_details_model.dart
Normal file
210
lib/model/ContactUsModel/ticket_details_model.dart
Normal file
@@ -0,0 +1,210 @@
|
||||
class TicketDetailsModel {
|
||||
String? status;
|
||||
int? statusCode;
|
||||
String? message;
|
||||
List<Data>? data;
|
||||
|
||||
TicketDetailsModel({this.status, this.statusCode, this.message, this.data});
|
||||
|
||||
TicketDetailsModel.fromJson(Map<String, dynamic> json) {
|
||||
status = json['status'];
|
||||
statusCode = json['status_code'];
|
||||
message = json['message'];
|
||||
if (json['data'] != null) {
|
||||
data = <Data>[];
|
||||
json['data'].forEach((v) {
|
||||
data!.add(Data.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['status'] = status;
|
||||
data['status_code'] = statusCode;
|
||||
data['message'] = message;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int? id;
|
||||
String? uniqueTicketId;
|
||||
int? iamPrincipalXid;
|
||||
int? ticketCategoryXid;
|
||||
String? description;
|
||||
int? status;
|
||||
int? isActive;
|
||||
String? createdAt;
|
||||
TicketCategory? ticketCategory;
|
||||
List<TicketFiles>? ticketFiles;
|
||||
List<TicketResponses>? ticketResponses;
|
||||
|
||||
Data(
|
||||
{this.id,
|
||||
this.uniqueTicketId,
|
||||
this.iamPrincipalXid,
|
||||
this.ticketCategoryXid,
|
||||
this.description,
|
||||
this.status,
|
||||
this.isActive,
|
||||
this.createdAt,
|
||||
this.ticketCategory,
|
||||
this.ticketFiles,
|
||||
this.ticketResponses});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
uniqueTicketId = json['unique_ticket_id'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
ticketCategoryXid = json['ticket_category_xid'];
|
||||
description = json['description'];
|
||||
status = json['status'];
|
||||
isActive = json['is_active'];
|
||||
createdAt = json['created_at'];
|
||||
ticketCategory = json['ticket_category'] != null
|
||||
? TicketCategory.fromJson(json['ticket_category'])
|
||||
: null;
|
||||
if (json['ticket_files'] != null) {
|
||||
ticketFiles = <TicketFiles>[];
|
||||
json['ticket_files'].forEach((v) {
|
||||
ticketFiles!.add(TicketFiles.fromJson(v));
|
||||
});
|
||||
}
|
||||
if (json['ticket_responses'] != null) {
|
||||
ticketResponses = <TicketResponses>[];
|
||||
json['ticket_responses'].forEach((v) {
|
||||
ticketResponses!.add(TicketResponses.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['unique_ticket_id'] = uniqueTicketId;
|
||||
data['iam_principal_xid'] = iamPrincipalXid;
|
||||
data['ticket_category_xid'] = ticketCategoryXid;
|
||||
data['description'] = description;
|
||||
data['status'] = status;
|
||||
data['is_active'] = isActive;
|
||||
data['created_at'] = createdAt;
|
||||
if (ticketCategory != null) {
|
||||
data['ticket_category'] = ticketCategory!.toJson();
|
||||
}
|
||||
if (ticketFiles != null) {
|
||||
data['ticket_files'] = ticketFiles!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
if (ticketResponses != null) {
|
||||
data['ticket_responses'] =
|
||||
ticketResponses!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class TicketResponses {
|
||||
int? id;
|
||||
int? iamPrincipalXid;
|
||||
int? ticketXid;
|
||||
int? isAdminResponse;
|
||||
String? response;
|
||||
String? createdAt;
|
||||
String? updatedAt;
|
||||
|
||||
TicketResponses(
|
||||
{this.id,
|
||||
this.iamPrincipalXid,
|
||||
this.ticketXid,
|
||||
this.isAdminResponse,
|
||||
this.response,
|
||||
this.createdAt,
|
||||
this.updatedAt});
|
||||
|
||||
TicketResponses.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
ticketXid = json['ticket_xid'];
|
||||
isAdminResponse = json['is_admin_response'];
|
||||
response = json['response'];
|
||||
createdAt = json['created_at'];
|
||||
updatedAt = json['updated_at'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['iam_principal_xid'] = iamPrincipalXid;
|
||||
data['ticket_xid'] = ticketXid;
|
||||
data['is_admin_response'] = isAdminResponse;
|
||||
data['response'] = response;
|
||||
data['created_at'] = createdAt;
|
||||
data['updated_at'] = updatedAt;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class TicketCategory {
|
||||
int? id;
|
||||
String? name;
|
||||
int? isActive;
|
||||
String? createdAt;
|
||||
|
||||
TicketCategory({this.id, this.name, this.isActive, this.createdAt});
|
||||
|
||||
TicketCategory.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
isActive = json['is_active'];
|
||||
createdAt = json['created_at'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['name'] = name;
|
||||
data['is_active'] = isActive;
|
||||
data['created_at'] = createdAt;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class TicketFiles {
|
||||
int? id;
|
||||
int? iamPrincipalXid;
|
||||
int? ticketXid;
|
||||
String? file;
|
||||
int? isActive;
|
||||
String? createdAt;
|
||||
|
||||
TicketFiles(
|
||||
{this.id,
|
||||
this.iamPrincipalXid,
|
||||
this.ticketXid,
|
||||
this.file,
|
||||
this.isActive,
|
||||
this.createdAt});
|
||||
|
||||
TicketFiles.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
iamPrincipalXid = json['iam_principal_xid'];
|
||||
ticketXid = json['ticket_xid'];
|
||||
file = json['file'];
|
||||
isActive = json['is_active'];
|
||||
createdAt = json['created_at'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['id'] = id;
|
||||
data['iam_principal_xid'] = iamPrincipalXid;
|
||||
data['ticket_xid'] = ticketXid;
|
||||
data['file'] = file;
|
||||
data['is_active'] = isActive;
|
||||
data['created_at'] = createdAt;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -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,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);
|
||||
// },
|
||||
|
||||
@@ -29,7 +29,7 @@ class ContactUsApi {
|
||||
data,
|
||||
ApiUrls.addTicket,
|
||||
);
|
||||
|
||||
log(response.toString());
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
@@ -59,4 +59,61 @@ class ContactUsApi {
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> getContactUsDetailsData(
|
||||
String id,
|
||||
) async {
|
||||
final response = await NetworkApiServices()
|
||||
.getApi(ApiUrls.getcontactusDetails + id, isAuth: true);
|
||||
log(response.data.toString());
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
return response;
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> addTicketMessageApi(data) async {
|
||||
final response = await NetworkApiServices().postApi(
|
||||
data,
|
||||
ApiUrls.sendMessage,
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
print("token is $response");
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<ResponseData<dynamic>> updateTicketStatusApi(data) async {
|
||||
final response = await NetworkApiServices().postApi(
|
||||
data,
|
||||
ApiUrls.updateTicketStatusApi,
|
||||
);
|
||||
|
||||
if (response.status == ResponseStatus.SUCCESS) {
|
||||
Map<String, dynamic> responseData =
|
||||
Map<String, dynamic>.from(response.data);
|
||||
if (responseData['status'] == "success") {
|
||||
print("token is $response");
|
||||
} else {
|
||||
return ResponseData<dynamic>(
|
||||
responseData['message'], ResponseStatus.FAILED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
27
pubspec.lock
27
pubspec.lock
@@ -109,10 +109,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
|
||||
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.18.0"
|
||||
version: "1.17.2"
|
||||
connectivity_plus:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -676,10 +676,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
|
||||
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.9.1"
|
||||
mime:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -961,18 +961,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
|
||||
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.11.1"
|
||||
version: "1.11.0"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
|
||||
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
version: "2.1.1"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1057,10 +1057,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
|
||||
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.1"
|
||||
version: "0.6.0"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1266,10 +1266,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web
|
||||
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
|
||||
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.0"
|
||||
version: "0.1.4-beta"
|
||||
win32:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -1295,5 +1295,8 @@ packages:
|
||||
source: hosted
|
||||
version: "6.3.0"
|
||||
sdks:
|
||||
|
||||
dart: ">=3.2.3 <4.0.0"
|
||||
flutter: ">=3.16.6"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user