contact ui, create ticket

This commit is contained in:
jayesh
2024-03-22 17:21:40 +05:30
parent f0b1e1737d
commit be39551790
16 changed files with 846 additions and 37 deletions

View File

@@ -5,7 +5,6 @@ import 'package:get/get.dart';
import 'package:traderscircuit/Utils/Common/sized_box.dart';
import 'package:traderscircuit/Utils/text.dart';
import 'package:traderscircuit/resources/routes/route_name.dart';
import 'package:traderscircuit/view/onBoarding/splashScreen1.dart';
class SideMenu extends StatefulWidget {
const SideMenu({super.key});
@@ -16,7 +15,10 @@ class SideMenu extends StatefulWidget {
class _SideMenuState extends State<SideMenu> {
List sideBarData = [
{"imagePath": "assets/images/svg/sidemenu/Faq.svg", "text": "FAQs"},
{
"imagePath": "assets/images/svg/sidemenu/Faq.svg",
"text": "FAQs",
},
{
"imagePath": "assets/images/svg/sidemenu/contact.svg",
"text": "Contact Us"
@@ -62,9 +64,9 @@ class _SideMenuState extends State<SideMenu> {
child: Container(
width: 25.w,
height: 25.h,
decoration: ShapeDecoration(
decoration: const ShapeDecoration(
color: Colors.black,
shape: const OvalBorder(),
shape: OvalBorder(),
),
child: Align(
alignment: Alignment.center,
@@ -105,13 +107,13 @@ class _SideMenuState extends State<SideMenu> {
Container(
width: 80.w,
height: 80.h,
decoration: ShapeDecoration(
decoration: const ShapeDecoration(
image: DecorationImage(
image: AssetImage(
"assets/images/png/Ellipse 560.png"),
fit: BoxFit.fill,
),
shape: const OvalBorder(),
shape: OvalBorder(),
),
),
sizedBoxWidth(20.w),
@@ -131,7 +133,7 @@ class _SideMenuState extends State<SideMenu> {
Container(
height: 1,
margin: EdgeInsets.symmetric(vertical: 10.h),
decoration: BoxDecoration(
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color.fromRGBO(176, 176, 176, 0.5),
@@ -152,7 +154,7 @@ class _SideMenuState extends State<SideMenu> {
width: 122.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r),
color: Color(0xFF34C759),
color: const Color(0xFF34C759),
),
child: Center(child: text14W500_black('Upgrade')),
),
@@ -166,7 +168,7 @@ class _SideMenuState extends State<SideMenu> {
Container(
height: 1,
margin: EdgeInsets.symmetric(vertical: 10.h),
decoration: BoxDecoration(
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color.fromRGBO(176, 176, 176, 0.5),
@@ -192,7 +194,7 @@ class _SideMenuState extends State<SideMenu> {
Container(
height: 1,
margin: EdgeInsets.symmetric(vertical: 10.h),
decoration: BoxDecoration(
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color.fromRGBO(176, 176, 176, 0.5),
@@ -213,8 +215,8 @@ class _SideMenuState extends State<SideMenu> {
width: 122.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r),
color: Color(0xFF3A3A3A).withOpacity(0.6),
border: Border.all(color: Color(0xFF9A0000))),
color: const Color(0xFF3A3A3A).withOpacity(0.6),
border: Border.all(color: const Color(0xFF9A0000))),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: Row(
@@ -224,7 +226,7 @@ class _SideMenuState extends State<SideMenu> {
Container(
height: 30.h,
width: 30.h,
decoration: BoxDecoration(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
'assets/images/png/Ellipse 1498.png',
@@ -238,15 +240,13 @@ class _SideMenuState extends State<SideMenu> {
),
selected: true,
onTap: () {
setState(() {
// Get.toNamed(RouteName.privacypolicy);
});
Get.toNamed(RouteName.kyc);
},
),
Container(
height: 1,
margin: EdgeInsets.symmetric(vertical: 10.h),
decoration: BoxDecoration(
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color.fromRGBO(176, 176, 176, 0.5),
@@ -267,7 +267,7 @@ class _SideMenuState extends State<SideMenu> {
width: 122.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r),
color: Color(0xFF0093FF),
color: const Color(0xFF0093FF),
),
child: Center(child: text14W500('Conservative')),
),
@@ -284,6 +284,7 @@ class _SideMenuState extends State<SideMenu> {
image: sideBarData[index]["imagePath"],
text: sideBarData[index]["text"],
onTap: () {
print(index);
navigateTo(index, context);
},
);
@@ -367,7 +368,7 @@ LogOutdialog(context) {
color: const Color(0xFFFFFFFF)),
),
sizedBoxHeight(40.h),
Row(
const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// SizedBox(
@@ -408,7 +409,7 @@ void navigateTo(int index, BuildContext context) {
case 1:
{
// Get.toNamed(RouteName.feedback);
Get.toNamed(RouteName.contactUsMain);
}
break;
@@ -420,7 +421,7 @@ void navigateTo(int index, BuildContext context) {
case 3:
{
// Get.toNamed(RouteName.contactUs);
// Get.toNamed(RouteName.contactUsMain);
}
break;
@@ -517,7 +518,7 @@ void navigateTo(int index, BuildContext context) {
child: Container(
width: 150.w,
decoration: BoxDecoration(
color: Color(0xFF3192D8),
color: const Color(0xFF3192D8),
borderRadius: BorderRadius.circular(5.r),
),
child: Padding(
@@ -568,7 +569,7 @@ class sideBarTile extends StatelessWidget {
Container(
height: 1,
margin: EdgeInsets.symmetric(vertical: 10.h),
decoration: BoxDecoration(
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(
color: Color.fromRGBO(176, 176, 176, 0.5),

View File

@@ -0,0 +1,241 @@
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 '../../../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();
}
class _ContactUsMainScreenState extends State<ContactUsMainScreen> {
ContactUsController contactUsController = Get.put(ContactUsController());
@override
Widget build(BuildContext context) {
return 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: 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(
labelStyle: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w400,
fontFamily: "manrope",
),
isScrollable: true,
labelColor: Colors.white,
unselectedLabelColor: const Color(0xFF464646),
indicatorColor: const Color(0xFF6C0000),
indicatorSize: TabBarIndicatorSize.label,
unselectedLabelStyle: TextStyle(
fontSize: 18.sp,
fontWeight: FontWeight.w500,
fontFamily: "manrope",
),
tabs: const [
Tab(text: "All Tickets (2)"),
Tab(text: "Open Tickets (2)"),
Tab(text: "Closed (1)"),
Tab(text: "Resolved (1)"),
],
),
SizedBox(
height: 0.5.sh,
child: TabBarView(children: [
ListView.builder(
itemCount: dataL.length,
itemBuilder: (ctx, index) {
return ticketCardWidget(index, "ALL");
}),
ListView.builder(
itemCount: dataL.length,
itemBuilder: (ctx, index) {
return ticketCardWidget(index, "OPEN");
}),
ListView.builder(
itemCount: dataL.length,
itemBuilder: (ctx, index) {
return ticketCardWidget(index, "CLOSED");
}),
ListView.builder(
itemCount: dataL.length,
itemBuilder: (ctx, index) {
return ticketCardWidget(index, "RESOLVED");
}),
]),
)
],
)),
]),
],
),
),
);
}
}
Widget ticketCardWidget(index, type) {
return dataL[index]["type"] != type && type != "ALL"
? SizedBox()
: 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(dataL[index]["id"]),
Row(
children: [
text16W500(dataL[index]["type"],
clr: dataL[index]["type"] == "OPEN"
? const Color(0xFFFFAD31)
: dataL[index]["type"] == "CLOSED"
? const Color(0xFF95CCFF)
: const Color(0xFF34C759)),
const Gap(8),
CircleAvatar(
radius: 10,
backgroundColor: dataL[index]["type"] == "OPEN"
? const Color(0xFFFFAD31)
: dataL[index]["type"] == "CLOSED"
? const Color(0xFF95CCFF)
: const Color(0xFF34C759),
child: const Center(
child: Icon(
Icons.check_rounded,
size: 15,
color: Colors.white,
),
),
)
],
),
],
),
const Gap(10),
text16W600(dataL[index]["date"]),
const Gap(5),
text16W400(dataL[index]["category"]),
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(dataL[index]["desc"],
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"
}
];

View File

@@ -0,0 +1,219 @@
import 'dart:developer';
import 'dart:io';
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:traderscircuit/Utils/text.dart';
import '../../../Utils/Common/CustomTextFormField.dart';
import '../../../Utils/Common/FilePicker.dart';
import '../../../Utils/Common/commonBotton.dart';
import '../../../Utils/Common/custom_drop_down.dart';
import '../../../controller/contact_us_controller.dart';
import 'ticket_confirmed_bottom_sheet.dart';
class CreateTicketBottomSheet {
TextEditingController descriptionController = TextEditingController();
ContactUsController contactUsController = Get.put(ContactUsController());
bottomSheet(
BuildContext context,
) {
return showModalBottomSheet(
useSafeArea: true,
isScrollControlled: true,
context: context,
backgroundColor: const Color(0xFF101111),
isDismissible: false,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8.r),
topRight: Radius.circular(8.r),
),
),
builder: (BuildContext context) {
return Obx(
() => Container(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 20),
child: Wrap(
children: [
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),
const CustomDropDownWidget(
header: "Choose your query",
listData: [
"Account Management",
"Technical Support",
"Billing and Payments",
"Feedback and Suggestions",
"Complaints and Disputes",
"Subscriptions",
"Portfolio",
"Content Buytes",
"Market Insights"
],
),
const Gap(14),
Stack(
children: [
CustomTextFormField1(
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(6),
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);
},
bgClr: const Color(0xFF6C0000),
borderClr: const Color(0xFF990000),
),
),
const Gap(30),
],
)
],
),
),
);
},
);
}
}

View File

@@ -0,0 +1,83 @@
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:lottie/lottie.dart';
import 'package:traderscircuit/Utils/text.dart';
import '../../../Utils/Common/commonBotton.dart';
class TicketConfirmedBottomSheet {
bottomSheet(
BuildContext context,
) {
return showModalBottomSheet(
useSafeArea: true,
isScrollControlled: true,
context: context,
backgroundColor: const Color(0xFF101111),
isDismissible: false,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8.r),
topRight: Radius.circular(8.r),
),
),
builder: (BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 20),
child: Wrap(
children: [
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
GestureDetector(
onTap: () {
Get.back();
},
child: SvgPicture.asset(
"assets/images/svg/cross_cancel.svg")),
],
),
const Gap(22),
Lottie.asset(
'assets/images/png/check_lottie.json',
width: 140,
height: 140,
),
const Gap(10),
text18W600("#18663765"),
const Gap(8),
text18W400(
"Your ticket has been created successfully. our support team will get back to you in 24-48 business hours.",
texAl: TextAlign.center,
heightV: 2,
),
const Gap(35),
SizedBox(
width: Get.width,
child: kycBtn(
text: "Done",
onTap: () {
Get.back();
},
bgClr: const Color(0xFF6C0000),
borderClr: const Color(0xFF990000),
),
),
const Gap(30),
],
)
],
),
);
},
);
}
}

View File

@@ -7,7 +7,6 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';
import 'package:glassmorphism/glassmorphism.dart';
import 'package:traderscircuit/Utils/Common/CommonAppbar.dart';
import 'package:traderscircuit/Utils/Common/CommonDropdown.dart';
import 'package:traderscircuit/Utils/Common/CustomTextFormField.dart';
import 'package:traderscircuit/Utils/Common/commonBotton.dart';
import 'package:traderscircuit/Utils/text.dart';