CHANGE_TICKET_FLOW
This commit is contained in:
parent
3d6e9656b4
commit
925e6e7624
36
ation - Inprogress
Normal file
36
ation - Inprogress
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
|
||||||
|
SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS
|
||||||
|
|
||||||
|
Commands marked with * may be preceded by a number, _N.
|
||||||
|
Notes in parentheses indicate the behavior if _N is given.
|
||||||
|
A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.
|
||||||
|
|
||||||
|
h H Display this help.
|
||||||
|
q :q Q :Q ZZ Exit.
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
MMOOVVIINNGG
|
||||||
|
|
||||||
|
e ^E j ^N CR * Forward one line (or _N lines).
|
||||||
|
y ^Y k ^K ^P * Backward one line (or _N lines).
|
||||||
|
f ^F ^V SPACE * Forward one window (or _N lines).
|
||||||
|
b ^B ESC-v * Backward one window (or _N lines).
|
||||||
|
z * Forward one window (and set window to _N).
|
||||||
|
w * Backward one window (and set window to _N).
|
||||||
|
ESC-SPACE * Forward one window, but don't stop at end-of-file.
|
||||||
|
d ^D * Forward one half-window (and set half-window to _N).
|
||||||
|
u ^U * Backward one half-window (and set half-window to _N).
|
||||||
|
ESC-) RightArrow * Right one half screen width (or _N positions).
|
||||||
|
ESC-( LeftArrow * Left one half screen width (or _N positions).
|
||||||
|
ESC-} ^RightArrow Right to last column displayed.
|
||||||
|
ESC-{ ^LeftArrow Left to first column.
|
||||||
|
F Forward forever; like "tail -f".
|
||||||
|
ESC-F Like F but stop when search pattern is found.
|
||||||
|
r ^R ^L Repaint screen.
|
||||||
|
R Repaint screen, discarding buffered input.
|
||||||
|
---------------------------------------------------
|
||||||
|
Default "window" is the screen height.
|
||||||
|
Default "half-window" is half of the screen height.
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
SSEEAARRCCHHIINNGG
|
||||||
@ -34,6 +34,7 @@ class _claimtracklistformState extends State<claimtracklist> {
|
|||||||
dynamic policyDataIsEmpty = 1;
|
dynamic policyDataIsEmpty = 1;
|
||||||
dynamic policyHeading;
|
dynamic policyHeading;
|
||||||
dynamic policyName;
|
dynamic policyName;
|
||||||
|
dynamic name;
|
||||||
dynamic policyType;
|
dynamic policyType;
|
||||||
dynamic policyTickID;
|
dynamic policyTickID;
|
||||||
dynamic policyDate;
|
dynamic policyDate;
|
||||||
@ -188,6 +189,7 @@ class _claimtracklistformState extends State<claimtracklist> {
|
|||||||
print(claimTrackMasterList[0]['thz_id']);
|
print(claimTrackMasterList[0]['thz_id']);
|
||||||
policyTickID = claimTrackMasterList[0]['thz_id'];
|
policyTickID = claimTrackMasterList[0]['thz_id'];
|
||||||
policyName = claimTrackMasterList[0]['policy_no'];
|
policyName = claimTrackMasterList[0]['policy_no'];
|
||||||
|
// name = claimTrackMasterList[0]['name'];
|
||||||
policyType = claimTrackMasterList[0]['ticket_type'];
|
policyType = claimTrackMasterList[0]['ticket_type'];
|
||||||
policyStatus = claimTrackMasterList[0]['status'];
|
policyStatus = claimTrackMasterList[0]['status'];
|
||||||
member = claimTrackMasterList[0]['assignee_name'];
|
member = claimTrackMasterList[0]['assignee_name'];
|
||||||
@ -305,8 +307,15 @@ class _claimtracklistformState extends State<claimtracklist> {
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
// Navigator.pushNamed(
|
||||||
|
// context, 'claims');
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context, 'claims');
|
context,
|
||||||
|
'help',
|
||||||
|
arguments: {
|
||||||
|
'ticketTabSelected': 0
|
||||||
|
},
|
||||||
|
);
|
||||||
},
|
},
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons
|
Icons
|
||||||
@ -325,7 +334,7 @@ class _claimtracklistformState extends State<claimtracklist> {
|
|||||||
: MainAxisAlignment.start,
|
: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
policyName ?? '',
|
policyType ?? '',
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
fontSize:
|
fontSize:
|
||||||
@ -441,6 +450,8 @@ class _claimtracklistformState extends State<claimtracklist> {
|
|||||||
dynamic messagername;
|
dynamic messagername;
|
||||||
messagername =
|
messagername =
|
||||||
message['notes_by'];
|
message['notes_by'];
|
||||||
|
dynamic name;
|
||||||
|
name = message['name'];
|
||||||
// if (isUserMessage) {
|
// if (isUserMessage) {
|
||||||
// messagername = empName;
|
// messagername = empName;
|
||||||
// } else {
|
// } else {
|
||||||
@ -511,7 +522,7 @@ class _claimtracklistformState extends State<claimtracklist> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: 5),
|
width: 5),
|
||||||
Text(
|
Text(
|
||||||
messagername,
|
name,
|
||||||
style: GoogleFonts
|
style: GoogleFonts
|
||||||
.poppins(
|
.poppins(
|
||||||
fontSize:
|
fontSize:
|
||||||
@ -601,7 +612,7 @@ class _claimtracklistformState extends State<claimtracklist> {
|
|||||||
Responsive.isDesktop(
|
Responsive.isDesktop(
|
||||||
context)
|
context)
|
||||||
? 2
|
? 2
|
||||||
: 3,
|
: 4,
|
||||||
child: Container(
|
child: Container(
|
||||||
alignment: Alignment
|
alignment: Alignment
|
||||||
.centerRight,
|
.centerRight,
|
||||||
@ -634,13 +645,6 @@ class _claimtracklistformState extends State<claimtracklist> {
|
|||||||
formData);
|
formData);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Text(
|
|
||||||
'Reply',
|
|
||||||
style: GoogleFonts
|
|
||||||
.poppins(
|
|
||||||
color: Colors
|
|
||||||
.white),
|
|
||||||
),
|
|
||||||
style: ElevatedButton
|
style: ElevatedButton
|
||||||
.styleFrom(
|
.styleFrom(
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
@ -654,6 +658,13 @@ class _claimtracklistformState extends State<claimtracklist> {
|
|||||||
5),
|
5),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
child: Text(
|
||||||
|
'Reply',
|
||||||
|
style: GoogleFonts
|
||||||
|
.poppins(
|
||||||
|
color: Colors
|
||||||
|
.white),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -749,15 +760,17 @@ class _claimtracklistformState extends State<claimtracklist> {
|
|||||||
|
|
||||||
Widget buildDesktopLayout(BuildContext context) {
|
Widget buildDesktopLayout(BuildContext context) {
|
||||||
return Column(
|
return Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
buildExpandedColumn(context, 'Policy No', policyTickID),
|
buildExpandedColumn(context, 'Ticket No', policyTickID),
|
||||||
buildExpandedColumn(context, 'Policy Name', policyName),
|
if (policyType != "Sales")
|
||||||
buildExpandedColumn(context, 'Ticket Type', policyType),
|
buildExpandedColumn(context, 'Policy No', policyName),
|
||||||
|
// buildExpandedColumn(context, 'Ticket Type', policyType),
|
||||||
buildExpandedColumn(context, 'Status', policyStatus),
|
buildExpandedColumn(context, 'Status', policyStatus),
|
||||||
buildExpandedColumn(context, 'Assign To', member),
|
buildExpandedColumn(context, 'Message', policyMessage),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (departmentID == '4') // Conditional check for policy_type
|
if (departmentID == '4') // Conditional check for policy_type
|
||||||
@ -808,24 +821,28 @@ class _claimtracklistformState extends State<claimtracklist> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
buildExpandedColumn(context, 'Policy No', policyTickID),
|
buildExpandedColumn(context, 'Ticket No', policyTickID),
|
||||||
buildExpandedColumn(context, 'Policy Name', policyName),
|
if (policyType != "Sales")
|
||||||
],
|
buildExpandedColumn(context, 'Policy No', policyName),
|
||||||
),
|
if (policyType == "Sales")
|
||||||
SizedBox(height: 20),
|
buildExpandedColumn(context, 'Status', policyStatus),
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
buildExpandedColumn(context, 'Status', policyStatus),
|
|
||||||
buildExpandedColumn(context, 'Ticket Type', policyType),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 20),
|
SizedBox(height: 20),
|
||||||
|
if (policyType != "Sales")
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
buildExpandedColumn(context, 'Status', policyStatus),
|
||||||
|
// buildExpandedColumn(context, 'Ticket Type', policyType),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
if (policyType != "Sales") SizedBox(height: 20),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
buildExpandedColumn(context, 'Subject', policySubject),
|
buildExpandedColumn(context, 'Subject', policySubject),
|
||||||
buildExpandedColumn(context, 'Assigned To', member),
|
buildExpandedColumn(context, 'Message', policyMessage),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (departmentID == '4')
|
if (departmentID == '4')
|
||||||
|
|||||||
@ -75,6 +75,29 @@ class _helpState extends State<help> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
apiService = ApiService(context); // Initialize ApiService here
|
apiService = ApiService(context); // Initialize ApiService here
|
||||||
_loadToken();
|
_loadToken();
|
||||||
|
print('initState');
|
||||||
|
getTicketList();
|
||||||
|
// handleTicketRefrsh();
|
||||||
|
}
|
||||||
|
|
||||||
|
void handleTicketRefrsh() {
|
||||||
|
print('handleTicketRefrsh');
|
||||||
|
final args =
|
||||||
|
ModalRoute.of(context)?.settings.arguments as Map<String, dynamic>?;
|
||||||
|
|
||||||
|
if (args != null && args.containsKey('ticketTabSelected')) {
|
||||||
|
print('ARGSDATA');
|
||||||
|
setState(() {
|
||||||
|
tickets = args['ticketTabSelected']; // e.g. 0 from TicketForm
|
||||||
|
closedTrackActive = 1;
|
||||||
|
allClaimsActive = 1;
|
||||||
|
tickets = 0;
|
||||||
|
ticketsActive = 0;
|
||||||
|
isActive = false;
|
||||||
|
|
||||||
|
getTicketList();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -85,21 +108,29 @@ class _helpState extends State<help> {
|
|||||||
@override
|
@override
|
||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
|
print('didChangeDependencies');
|
||||||
|
|
||||||
if (!_isArgsHandled) {
|
// if (!_isArgsHandled) {
|
||||||
final args = ModalRoute.of(context)?.settings.arguments as Map<String, dynamic>?;
|
final args =
|
||||||
|
ModalRoute.of(context)?.settings.arguments as Map<String, dynamic>?;
|
||||||
|
print('args - $args');
|
||||||
|
if (args != null && args.containsKey('ticketTabSelected')) {
|
||||||
|
print('args1');
|
||||||
|
setState(() {
|
||||||
|
tickets = args['ticketTabSelected']; // e.g. 0 from TicketForm
|
||||||
|
|
||||||
if (args != null && args.containsKey('ticketTabSelected')) {
|
print('args2- $tickets');
|
||||||
setState(() {
|
closedTrackActive = 1;
|
||||||
tickets = args['ticketTabSelected']; // e.g. 0 from TicketForm
|
allClaimsActive = 1;
|
||||||
closedTrackActive = 1;
|
tickets = 0;
|
||||||
allClaimsActive = 1;
|
ticketsActive = 0;
|
||||||
isActive = false;
|
isActive = false;
|
||||||
});
|
if (tickets == 0) getTicketList();
|
||||||
}
|
});
|
||||||
|
|
||||||
_isArgsHandled = true; // ✅ only apply once
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// _isArgsHandled = true; // ✅ only apply once
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _loadToken() async {
|
Future<void> _loadToken() async {
|
||||||
@ -122,6 +153,7 @@ class _helpState extends State<help> {
|
|||||||
print(client_id);
|
print(client_id);
|
||||||
getSelfEmployeeProfile();
|
getSelfEmployeeProfile();
|
||||||
getTrackClaimsList();
|
getTrackClaimsList();
|
||||||
|
getTicketList();
|
||||||
} else {
|
} else {
|
||||||
// Token is empty or null, handle accordingly (e.g., navigate to login screen)
|
// Token is empty or null, handle accordingly (e.g., navigate to login screen)
|
||||||
ToastHelper.showErrorToast(context, 'Session Out');
|
ToastHelper.showErrorToast(context, 'Session Out');
|
||||||
@ -637,6 +669,7 @@ class _helpState extends State<help> {
|
|||||||
ticketsActive = 0;
|
ticketsActive = 0;
|
||||||
allClaimsActive = 1;
|
allClaimsActive = 1;
|
||||||
closedTrackActive = 1;
|
closedTrackActive = 1;
|
||||||
|
tickets = 0;
|
||||||
// isActive = false;
|
// isActive = false;
|
||||||
// allClaimsActive = 1;
|
// allClaimsActive = 1;
|
||||||
// closedTrackActive = 1;
|
// closedTrackActive = 1;
|
||||||
|
|||||||
@ -111,10 +111,10 @@ class ApiService {
|
|||||||
await _initializeToken();
|
await _initializeToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
final url2 =
|
final url =
|
||||||
Uri.parse('${Environment.apiUrl}ticketList?mobile=$empMobileNo');
|
Uri.parse('${Environment.apiUrl}ticketList?mobile=$empMobileNo');
|
||||||
|
|
||||||
final url = Uri.parse('${Environment.apiUrl}ticketList?mobile=1234567890');
|
final url1 = Uri.parse('${Environment.apiUrl}ticketList?mobile=1234567890');
|
||||||
final headers = {
|
final headers = {
|
||||||
'Authorization': 'Bearer $_token' ?? '',
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
};
|
};
|
||||||
|
|||||||
@ -119,8 +119,8 @@ class _ticketsState extends State<tickets> {
|
|||||||
client_id!, empCodeString!, 'Active', client_branch_id, mobileNo);
|
client_id!, empCodeString!, 'Active', client_branch_id, mobileNo);
|
||||||
|
|
||||||
final responseInactive =
|
final responseInactive =
|
||||||
await apiService.getActiveAndInactivePolicyDetails(client_id!,
|
await apiService.getActiveAndInactivePolicyDetails(client_id!,
|
||||||
empCodeString!, 'Inactive', client_branch_id, mobileNo);
|
empCodeString!, 'Inactive', client_branch_id, mobileNo);
|
||||||
|
|
||||||
final bool isActiveSuccess = responseActive['status'] == 'success' &&
|
final bool isActiveSuccess = responseActive['status'] == 'success' &&
|
||||||
responseActive['data'] != null;
|
responseActive['data'] != null;
|
||||||
@ -191,9 +191,7 @@ class _ticketsState extends State<tickets> {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isServiceValid &&
|
if (isServiceValid && isPolicyValid && isSubjectValid && isMessageValid) {
|
||||||
isPolicyValid &&
|
|
||||||
isSubjectValid && isMessageValid) {
|
|
||||||
// Proceed to submit
|
// Proceed to submit
|
||||||
} else {
|
} else {
|
||||||
ToastHelper.showErrorToast(context, 'Please Fill Required Fields');
|
ToastHelper.showErrorToast(context, 'Please Fill Required Fields');
|
||||||
@ -215,7 +213,8 @@ class _ticketsState extends State<tickets> {
|
|||||||
'email': decodedToken['email_corporate'] != null
|
'email': decodedToken['email_corporate'] != null
|
||||||
? decodedToken['email_corporate']
|
? decodedToken['email_corporate']
|
||||||
: '',
|
: '',
|
||||||
'empcode': decodedToken['emp_code'] != null ? decodedToken['emp_code'] : '',
|
'empcode':
|
||||||
|
decodedToken['emp_code'] != null ? decodedToken['emp_code'] : '',
|
||||||
'message': messageController.text,
|
'message': messageController.text,
|
||||||
'mobile': decodedToken['mobile'] != null ? decodedToken['mobile'] : '',
|
'mobile': decodedToken['mobile'] != null ? decodedToken['mobile'] : '',
|
||||||
'name': decodedToken['name'] != null ? decodedToken['name'] : '',
|
'name': decodedToken['name'] != null ? decodedToken['name'] : '',
|
||||||
@ -250,7 +249,7 @@ class _ticketsState extends State<tickets> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
});
|
});
|
||||||
Navigator.pushNamed(context, 'help');
|
// Navigator.pushNamed(context, 'help');
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context,
|
context,
|
||||||
'help',
|
'help',
|
||||||
@ -273,265 +272,299 @@ class _ticketsState extends State<tickets> {
|
|||||||
body: Stack(children: [
|
body: Stack(children: [
|
||||||
SingleChildScrollView(
|
SingleChildScrollView(
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: Responsive.isDesktop(context)
|
padding: Responsive.isDesktop(context)
|
||||||
? EdgeInsets.symmetric(
|
? EdgeInsets.symmetric(
|
||||||
horizontal: MediaQuery.of(context).size.width *
|
horizontal: MediaQuery.of(context).size.width *
|
||||||
0.2, // 30% of screen width as horizontal padding
|
0.2, // 30% of screen width as horizontal padding
|
||||||
vertical: MediaQuery.of(context).size.height *
|
vertical: MediaQuery.of(context).size.height *
|
||||||
0.05, // 5% of screen height as vertical padding
|
0.05, // 5% of screen height as vertical padding
|
||||||
)
|
)
|
||||||
: EdgeInsets.all(10),
|
: EdgeInsets.all(10),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
Card(
|
Card(
|
||||||
elevation: 5,
|
elevation: 5,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(15.0), // Set border radius here
|
BorderRadius.circular(15.0), // Set border radius here
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white, // Set background color to white
|
color: Colors.white, // Set background color to white
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(
|
||||||
15.0), // Set border radius for Container
|
15.0), // Set border radius for Container
|
||||||
),
|
),
|
||||||
padding: Responsive.isDesktop(context)
|
padding: Responsive.isDesktop(context)
|
||||||
? EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15)
|
? EdgeInsets.only(top: 15, bottom: 15, left: 15, right: 15)
|
||||||
: EdgeInsets.only(
|
: EdgeInsets.only(
|
||||||
top: 10,
|
top: 10,
|
||||||
bottom: 10,
|
bottom: 10,
|
||||||
left: 10,
|
left: 10,
|
||||||
right: 10), // Add padding to the container
|
right: 10), // Add padding to the container
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 12,
|
flex: 12,
|
||||||
child: Container(
|
child: Container(
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Color(
|
color: Color(
|
||||||
0xFFFFFCE5), // Set background color for the container
|
0xFFFFFCE5), // Set background color for the container
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(
|
||||||
10), // Set border radius for the container
|
10), // Set border radius for the container
|
||||||
),
|
),
|
||||||
padding: Responsive.isDesktop(context)
|
padding: Responsive.isDesktop(context)
|
||||||
? EdgeInsets.only(
|
? EdgeInsets.only(
|
||||||
top: 20,
|
top: 20,
|
||||||
bottom: 20,
|
bottom: 20,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0)
|
right: 0)
|
||||||
: EdgeInsets.only(
|
: EdgeInsets.only(
|
||||||
top: 10,
|
top: 10,
|
||||||
bottom: 10,
|
bottom: 10,
|
||||||
left: 10,
|
left: 10,
|
||||||
right: 10),
|
right: 10),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment.center,
|
CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.start,
|
MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context, 'help');
|
context, 'help');
|
||||||
},
|
},
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons
|
Icons
|
||||||
.chevron_left, // Replace with your desired icon
|
.chevron_left, // Replace with your desired icon
|
||||||
color: Color(0xFF000000),
|
color: Color(0xFF000000),
|
||||||
size: 30,
|
size: 30,
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Expanded(
|
),
|
||||||
flex: 11,
|
),
|
||||||
child: Row(
|
Expanded(
|
||||||
mainAxisAlignment:
|
flex: 11,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
Responsive.isDesktop(context)
|
Responsive.isDesktop(context)
|
||||||
? MainAxisAlignment.center
|
? MainAxisAlignment.center
|
||||||
: MainAxisAlignment.start,
|
: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'Raise a Ticket',
|
'Raise a Ticket',
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
fontSize:
|
fontSize:
|
||||||
Responsive.isDesktop(
|
Responsive.isDesktop(
|
||||||
context)
|
context)
|
||||||
? 20
|
? 20
|
||||||
: 16,
|
: 16,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
color: Color(0xFF000000),
|
color: Color(0xFF000000),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
|
||||||
), // Space between rows
|
|
||||||
// Add more rows as needed
|
|
||||||
],
|
],
|
||||||
),
|
), // Space between rows
|
||||||
),
|
// Add more rows as needed
|
||||||
SizedBox(height: 15),
|
],
|
||||||
Container(
|
),
|
||||||
child: Column(
|
),
|
||||||
children: [
|
SizedBox(height: 15),
|
||||||
Column(
|
Container(
|
||||||
crossAxisAlignment:
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.start,
|
MainAxisAlignment.start,
|
||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Form(
|
Form(
|
||||||
key: formKey,
|
key: formKey,
|
||||||
child: Column(
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment
|
||||||
|
.start,
|
||||||
children: [
|
children: [
|
||||||
Column(
|
buildDropdownField<
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
int>(
|
||||||
children: [
|
'Type',
|
||||||
|
(value) {
|
||||||
buildDropdownField<int>(
|
setState(() {
|
||||||
'Service',
|
serviceId =
|
||||||
(value) {
|
value;
|
||||||
setState(() {
|
selectedServiceName =
|
||||||
serviceId = value;
|
serviceList
|
||||||
selectedServiceName = serviceList.firstWhere(
|
.firstWhere(
|
||||||
(serList) => serList['id'] == value,
|
(serList) =>
|
||||||
orElse: () => {'name': ''},
|
serList[
|
||||||
)['name'];
|
'id'] ==
|
||||||
isServiceValid = true;
|
value,
|
||||||
});
|
orElse: () =>
|
||||||
},
|
{
|
||||||
false,
|
'name': ''
|
||||||
serviceList,
|
|
||||||
'name',
|
|
||||||
serviceId,
|
|
||||||
valueKey: 'id',
|
|
||||||
),
|
|
||||||
if (!isServiceValid)
|
|
||||||
Text('Please select a Service',
|
|
||||||
style: TextStyle(color: Colors.red)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: 15),
|
|
||||||
if (selectedServiceName != "Sales")
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
|
|
||||||
buildDropdownField<String>(
|
|
||||||
'Policy Number',
|
|
||||||
(value) {
|
|
||||||
setState(() {
|
|
||||||
policyNumberId = value;
|
|
||||||
isPolicyValid = true;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
false,
|
)['name'];
|
||||||
policyList,
|
isServiceValid =
|
||||||
'policy_no',
|
true;
|
||||||
policyNumberId,
|
});
|
||||||
valueKey: 'policy_no',
|
},
|
||||||
),
|
false,
|
||||||
if (!isPolicyValid)
|
serviceList,
|
||||||
Text('Please select a policy',
|
'name',
|
||||||
style: TextStyle(color: Colors.red)),
|
serviceId,
|
||||||
],
|
valueKey: 'id',
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(height: 15),
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
buildTextField('Subject',
|
|
||||||
subjectController),
|
|
||||||
if (!isSubjectValid)
|
|
||||||
Text('Please enter the Subject', style: TextStyle(color: Colors.red)),
|
|
||||||
SizedBox(height: 15),
|
|
||||||
buildTextAreaField(
|
|
||||||
'Message',
|
|
||||||
messageController),
|
|
||||||
if (!isMessageValid)
|
|
||||||
Text('Please enter the Message', style: TextStyle(color: Colors.red)),
|
|
||||||
]
|
|
||||||
),
|
),
|
||||||
|
if (!isServiceValid)
|
||||||
|
Text(
|
||||||
|
'Please select a Service',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors
|
||||||
|
.red)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
SizedBox(height: 15),
|
||||||
],
|
if (selectedServiceName !=
|
||||||
|
"Sales")
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment
|
||||||
|
.start,
|
||||||
|
children: [
|
||||||
|
buildDropdownField<
|
||||||
|
String>(
|
||||||
|
'Policy Number',
|
||||||
|
(value) {
|
||||||
|
setState(() {
|
||||||
|
policyNumberId =
|
||||||
|
value;
|
||||||
|
isPolicyValid =
|
||||||
|
true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
false,
|
||||||
|
policyList,
|
||||||
|
'policy_no',
|
||||||
|
policyNumberId,
|
||||||
|
valueKey:
|
||||||
|
'policy_no',
|
||||||
|
),
|
||||||
|
if (!isPolicyValid)
|
||||||
|
Text(
|
||||||
|
'Please select a policy',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors
|
||||||
|
.red)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 15),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment
|
||||||
|
.start,
|
||||||
|
children: [
|
||||||
|
buildTextField(
|
||||||
|
'Subject',
|
||||||
|
subjectController),
|
||||||
|
if (!isSubjectValid)
|
||||||
|
Text(
|
||||||
|
'Please enter the Subject',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors
|
||||||
|
.red)),
|
||||||
|
SizedBox(
|
||||||
|
height: 15),
|
||||||
|
buildTextAreaField(
|
||||||
|
'Message',
|
||||||
|
messageController),
|
||||||
|
if (!isMessageValid)
|
||||||
|
Text(
|
||||||
|
'Please enter the Message',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors
|
||||||
|
.red)),
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 15),
|
],
|
||||||
Row(
|
),
|
||||||
children: [
|
SizedBox(height: 15),
|
||||||
Expanded(
|
Row(
|
||||||
flex: 12,
|
children: [
|
||||||
child: Container(
|
Expanded(
|
||||||
alignment: Alignment.centerRight,
|
flex: 12,
|
||||||
child: ElevatedButton(
|
child: Container(
|
||||||
onPressed: () {
|
alignment: Alignment.centerRight,
|
||||||
sendFormDataToApi();
|
child: ElevatedButton(
|
||||||
},
|
onPressed: () {
|
||||||
child: Text(
|
sendFormDataToApi();
|
||||||
'Send',
|
},
|
||||||
style: GoogleFonts.poppins(
|
child: Text(
|
||||||
color: Colors.white),
|
'Send',
|
||||||
),
|
style: GoogleFonts.poppins(
|
||||||
style: ElevatedButton.styleFrom(
|
color: Colors.white),
|
||||||
backgroundColor:
|
),
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor:
|
||||||
Color(0xFFE26728),
|
Color(0xFFE26728),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius:
|
borderRadius:
|
||||||
BorderRadius.circular(
|
BorderRadius.circular(
|
||||||
5),
|
5),
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
))),
|
),
|
||||||
],
|
],
|
||||||
),
|
))),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: Responsive.isDesktop(context) ? 40 : 60),
|
),
|
||||||
]),
|
),
|
||||||
)),
|
SizedBox(height: Responsive.isDesktop(context) ? 40 : 60),
|
||||||
|
]),
|
||||||
|
)),
|
||||||
if (isLoading)
|
if (isLoading)
|
||||||
Container(
|
Container(
|
||||||
color: Color(0x98FFFCE5), // Semi-transparent background
|
color: Color(0x98FFFCE5), // Semi-transparent background
|
||||||
child: Center(
|
child: Center(
|
||||||
child: // Your GIF loader widget
|
child: // Your GIF loader widget
|
||||||
Image.asset(
|
Image.asset(
|
||||||
height: 60,
|
height: 60,
|
||||||
width: 60,
|
width: 60,
|
||||||
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
|
'assets/nhance-loader.gif'), // Adjust path to your GIF loader
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (Responsive.isDesktop(context))
|
if (Responsive.isDesktop(context))
|
||||||
@ -557,36 +590,36 @@ class _ticketsState extends State<tickets> {
|
|||||||
bottomNavigationBar: Responsive.isDesktop(context)
|
bottomNavigationBar: Responsive.isDesktop(context)
|
||||||
? null
|
? null
|
||||||
: CustomBottomNavigationBar(
|
: CustomBottomNavigationBar(
|
||||||
onTabChanged: (index) {
|
onTabChanged: (index) {
|
||||||
// repositionBotman();
|
// repositionBotman();
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
Navigator.pushNamed(context, 'home');
|
Navigator.pushNamed(context, 'home');
|
||||||
} else if (index == 1) {
|
} else if (index == 1) {
|
||||||
Navigator.pushNamed(context, 'claims');
|
Navigator.pushNamed(context, 'claims');
|
||||||
} else if (index == 2) {
|
} else if (index == 2) {
|
||||||
Navigator.pushNamed(context, 'profile');
|
Navigator.pushNamed(context, 'profile');
|
||||||
} else if (index == 3) {
|
} else if (index == 3) {
|
||||||
Navigator.pushNamed(context, 'help');
|
Navigator.pushNamed(context, 'help');
|
||||||
// Navigator.pushNamed(context, 'help');
|
// Navigator.pushNamed(context, 'help');
|
||||||
} else if (index == 4) {
|
} else if (index == 4) {
|
||||||
Navigator.pushNamed(context, 'wellness');
|
Navigator.pushNamed(context, 'wellness');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
icons: [
|
icons: [
|
||||||
Icons.home_outlined,
|
Icons.home_outlined,
|
||||||
Icons.sticky_note_2_outlined,
|
Icons.sticky_note_2_outlined,
|
||||||
Icons.person_outline_outlined,
|
Icons.person_outline_outlined,
|
||||||
Icons.headset_mic_outlined,
|
Icons.headset_mic_outlined,
|
||||||
Icons.health_and_safety_outlined,
|
Icons.health_and_safety_outlined,
|
||||||
],
|
],
|
||||||
labels: [
|
labels: [
|
||||||
"Home",
|
"Home",
|
||||||
"Claim",
|
"Claim",
|
||||||
"Profile",
|
"Profile",
|
||||||
"Help",
|
"Help",
|
||||||
"Wellness",
|
"Wellness",
|
||||||
], // Initial index of the bottom navigation bar
|
], // Initial index of the bottom navigation bar
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -620,14 +653,14 @@ class _ticketsState extends State<tickets> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget buildDropdownField<T>(
|
Widget buildDropdownField<T>(
|
||||||
String label,
|
String label,
|
||||||
void Function(T?) onChanged,
|
void Function(T?) onChanged,
|
||||||
bool readOnly,
|
bool readOnly,
|
||||||
List<Map<String, dynamic>> itemsList,
|
List<Map<String, dynamic>> itemsList,
|
||||||
String displayField,
|
String displayField,
|
||||||
T? selectedValue, {
|
T? selectedValue, {
|
||||||
String valueKey = 'id',
|
String valueKey = 'id',
|
||||||
}) {
|
}) {
|
||||||
return DropdownButtonFormField<T>(
|
return DropdownButtonFormField<T>(
|
||||||
value: selectedValue,
|
value: selectedValue,
|
||||||
decoration: InputDecoration(labelText: label),
|
decoration: InputDecoration(labelText: label),
|
||||||
@ -635,7 +668,7 @@ class _ticketsState extends State<tickets> {
|
|||||||
return DropdownMenuItem<T>(
|
return DropdownMenuItem<T>(
|
||||||
value: item[valueKey] as T, // ✅ cast to generic type
|
value: item[valueKey] as T, // ✅ cast to generic type
|
||||||
child:
|
child:
|
||||||
Text(item[displayField].toString()), // always display as String
|
Text(item[displayField].toString()), // always display as String
|
||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
onChanged: readOnly ? null : onChanged,
|
onChanged: readOnly ? null : onChanged,
|
||||||
|
|||||||
@ -27,7 +27,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
|||||||
FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
|
FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
|
||||||
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
|
InAppWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "InAppWebViewFlutterPlugin"))
|
||||||
FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin"))
|
FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin"))
|
||||||
FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin"))
|
LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin"))
|
||||||
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
|
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user