ticket merge issue fix
This commit is contained in:
parent
fb37bd257f
commit
3d6e9656b4
@ -31,6 +31,7 @@ class _ticketsState extends State<tickets> {
|
|||||||
dynamic policyDataIsEmpty = 1;
|
dynamic policyDataIsEmpty = 1;
|
||||||
int? fromClaimsPage;
|
int? fromClaimsPage;
|
||||||
dynamic decodedToken;
|
dynamic decodedToken;
|
||||||
|
List<Map<String, dynamic>> departmentList = [];
|
||||||
List<Map<String, dynamic>> policyNumberList = [];
|
List<Map<String, dynamic>> policyNumberList = [];
|
||||||
dynamic serviceId;
|
dynamic serviceId;
|
||||||
dynamic policyNumberId;
|
dynamic policyNumberId;
|
||||||
@ -118,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;
|
||||||
@ -163,7 +164,7 @@ class _ticketsState extends State<tickets> {
|
|||||||
if (response.containsKey('data')) {
|
if (response.containsKey('data')) {
|
||||||
setState(() {
|
setState(() {
|
||||||
selfDetails = response['data'];
|
selfDetails = response['data'];
|
||||||
print('ABBC $selfDetails');
|
print(selfDetails);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Handle other status messages if needed
|
// Handle other status messages if needed
|
||||||
@ -272,141 +273,136 @@ 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: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment:
|
|
||||||
MainAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Row(
|
||||||
flex: 1,
|
mainAxisAlignment:
|
||||||
child: InkWell(
|
MainAxisAlignment.start,
|
||||||
onTap: () {
|
children: [
|
||||||
Navigator.pushNamed(
|
Expanded(
|
||||||
context, 'help');
|
flex: 1,
|
||||||
},
|
child: InkWell(
|
||||||
child: Icon(
|
onTap: () {
|
||||||
Icons
|
Navigator.pushNamed(
|
||||||
.chevron_left, // Replace with your desired icon
|
context, 'help');
|
||||||
color: Color(0xFF000000),
|
},
|
||||||
size: 30,
|
child: Icon(
|
||||||
|
Icons
|
||||||
|
.chevron_left, // Replace with your desired icon
|
||||||
|
color: Color(0xFF000000),
|
||||||
|
size: 30,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
),
|
flex: 11,
|
||||||
Expanded(
|
child: Row(
|
||||||
flex: 11,
|
mainAxisAlignment:
|
||||||
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(
|
||||||
SizedBox(height: 15),
|
|
||||||
Container(
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment:
|
|
||||||
CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Column(
|
||||||
width: double.infinity,
|
crossAxisAlignment:
|
||||||
alignment: Alignment.centerLeft,
|
CrossAxisAlignment.start,
|
||||||
child: Column(
|
children: [
|
||||||
mainAxisAlignment:
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
child: Column(
|
||||||
|
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(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -512,62 +508,30 @@ class _ticketsState extends State<tickets> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: 15),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: 12,
|
|
||||||
child: Container(
|
|
||||||
alignment: Alignment.centerRight,
|
|
||||||
child: ElevatedButton(
|
|
||||||
onPressed: () {
|
|
||||||
sendFormDataToApi();
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
'Send',
|
|
||||||
style: GoogleFonts.poppins(
|
|
||||||
color: Colors.white),
|
|
||||||
),
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
backgroundColor:
|
|
||||||
Color(0xFFE26728),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.circular(
|
|
||||||
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))
|
||||||
@ -593,36 +557,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
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -656,14 +620,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),
|
||||||
@ -671,7 +635,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,
|
||||||
@ -683,4 +647,4 @@ class _ticketsState extends State<tickets> {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -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"))
|
||||||
LocalAuthPlugin.register(with: registry.registrar(forPlugin: "LocalAuthPlugin"))
|
FLALocalAuthPlugin.register(with: registry.registrar(forPlugin: "FLALocalAuthPlugin"))
|
||||||
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