employee new flow design done

This commit is contained in:
Venba 2024-03-30 17:08:13 +05:30
parent 89bcd6e3d6
commit d78c46be9d
14 changed files with 3469 additions and 702 deletions

BIN
assets/Group.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
assets/Group_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
assets/Vector.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

BIN
assets/partnerLogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

974
lib/addons.dart Normal file
View File

@ -0,0 +1,974 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'customAppBar/customAppBar.dart';
class addOnsDetails extends StatefulWidget {
const addOnsDetails({Key? key}) : super(key: key);
@override
State<addOnsDetails> createState() => _addOnsDetailsState();
}
class _addOnsDetailsState extends State<addOnsDetails> {
bool _isSwitched = false; // Declare the _isSwitched variable here
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: CustomAppBar(),
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.symmetric(
horizontal: MediaQuery.of(context).size.width *
0.1, // 30% of screen width as horizontal padding
vertical: MediaQuery.of(context).size.height *
0.03, // 5% of screen height as vertical padding
),
color: Color(0xFFEFF3F6),
child: Column(
children: [
Card(
elevation: 0,
child: Container(
width: double.infinity,
height: 75,
padding: EdgeInsets.only(
top: 20,
bottom: 20,
left: 30,
right: 30), // Add padding to the container
child: Row(
children: [
Expanded(
flex: 6,
child: Container(
width: 150,
height: 150,
alignment: Alignment.centerLeft,
child: Image.asset(
'assets/Group.png',
width: 80, // Set the width of the image
height: 80, // Set the height of the image
fit: BoxFit.contain, // Adjust the fit as needed
),
)),
Expanded(
flex: 6,
child: Text(
'Bharti Airtel',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
)
],
),
),
),
SizedBox(height: 16),
Card(
elevation: 0,
child: Padding(
padding: EdgeInsets.all(30),
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Color(
0xFFFFF1DD), // Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Plan Name',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
),
),
Text(
'Group Personal Accident Coverage',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Text(
'Floater Sum Insured',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 18,
),
),
Text(
'₹ 3,00,000',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
],
),
),
SizedBox(height: 15),
Container(
padding: EdgeInsets.only(
top: 0, bottom: 0, left: 15, right: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.arrow_right,
color: Color(0xFFE26728)), // Arrow icon
SizedBox(
width: 10), // Space between icon and text
Expanded(
child: Text(
'Employee Name • Self • DOB - 22/10/1997',
style: TextStyle(
fontSize: 18,
color: Color(0xFF232526),
),
),
),
],
),
],
),
),
],
),
)),
SizedBox(height: 16),
Card(
elevation: 0,
child: Padding(
padding: EdgeInsets.all(30),
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Color(
0xFFFFF1DD), // Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Plan Name',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
),
),
Text(
'Group Medical Coverage',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Text(
'Floater Sum Insured',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 18,
),
),
Text(
'₹ 3,00,000',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
],
),
),
SizedBox(height: 15),
Container(
padding: EdgeInsets.only(
top: 0, bottom: 0, left: 15, right: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.arrow_right,
color: Color(0xFFE26728)), // Arrow icon
SizedBox(
width: 10), // Space between icon and text
Expanded(
child: Text(
'Employee Name • Self • DOB - 22/10/1997',
style: TextStyle(
fontSize: 18,
color: Color(0xFF232526),
),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.arrow_right,
color: Color(0xFFE26728)), // Arrow icon
SizedBox(
width: 10), // Space between icon and text
Expanded(
child: Text(
'Spouse Name • Spouse • DOB - 22/10/1997',
style: TextStyle(
fontSize: 18,
color: Color(0xFF232526),
),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.arrow_right,
color: Color(0xFFE26728)), // Arrow icon
SizedBox(
width: 10), // Space between icon and text
Expanded(
child: Text(
'Sons Name • Son • DOB - 22/10/1997',
style: TextStyle(
fontSize: 18,
color: Color(0xFF232526),
),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.arrow_right,
color: Color(0xFFE26728)), // Arrow icon
SizedBox(
width: 10), // Space between icon and text
Expanded(
child: Text(
'Daughters Name • Daughter • DOB - 22/10/1997',
style: TextStyle(
fontSize: 18,
color: Color(0xFF232526),
),
),
),
],
),
],
),
),
],
),
)),
SizedBox(height: 16),
Card(
elevation: 0,
child: Padding(
padding: EdgeInsets.all(30),
child: Column(
children: [
Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 12,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Add Ons',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
color: Color(0xFF181818)),
),
Text(
'Increase your medical cover for your family or add parents or parent in laws by paying additional premium',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
color: Color(0xFF181818),
),
),
],
))),
],
),
),
],
),
)),
SizedBox(height: 16),
Card(
elevation: 0,
child: Padding(
padding: EdgeInsets.all(30),
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Color(
0xFFDDF3FF), // Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 25, bottom: 25, left: 25, right: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Add On Name',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
),
),
Text(
'Group Medical Coverage - Top Up',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Switch(
value: _isSwitched,
onChanged: (value) {
setState(() {
_isSwitched = value;
// Add your logic here based on the toggle state
});
},
activeColor: Color(
0xFFE26728), // Color when the switch is ON
inactiveTrackColor: Colors
.grey, // Color of the switch track when OFF
),
],
))),
],
),
),
SizedBox(height: 15),
Container(
decoration: BoxDecoration(
color: Color(
0xFFDDF3FF), // Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 25, bottom: 25, left: 25, right: 25),
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Add On Name',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
),
),
Text(
'Group Medical Coverage - Add Parents',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
Expanded(
flex: 3,
child: Container(
width: 50,
alignment: Alignment.center,
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
DropdownButtonFormField<String>(
onChanged: (value) {},
decoration: InputDecoration(
border:
OutlineInputBorder(),
hintText: 'Sum Insured',
labelText: 'Sum Insured',
contentPadding:
EdgeInsets.symmetric(
vertical: 5,
horizontal: 5),
),
value: null,
items: [
DropdownMenuItem(
value: 'Item 1',
child: Text('₹ 3,00,000'),
),
DropdownMenuItem(
value: 'Item 2',
child: Text('₹ 4,00,000'),
),
],
),
],
))),
Expanded(
flex: 3,
child: Container(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Switch(
value: _isSwitched,
onChanged: (value) {
setState(() {
_isSwitched = value;
// Add your logic here based on the toggle state
});
},
activeColor: Color(
0xFFE26728), // Color when the switch is ON
inactiveTrackColor: Colors
.grey, // Color of the switch track when OFF
),
],
))),
],
),
SizedBox(height: 20),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 4,
child: Container(
width: 50,
alignment: Alignment.center,
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
DropdownButtonFormField<String>(
onChanged: (value) {},
decoration: InputDecoration(
border:
OutlineInputBorder(),
hintText: 'Relationship',
labelText: 'Relationship',
contentPadding:
EdgeInsets.symmetric(
vertical: 5,
horizontal: 5),
),
value: null,
items: [
DropdownMenuItem(
value: 'Item 1',
child: Text('Father'),
),
DropdownMenuItem(
value: 'Item 2',
child: Text('Mother'),
),
],
),
],
))),
SizedBox(width: 10),
Expanded(
flex: 4,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
child: TextFormField(
onChanged: (value) => null,
decoration: InputDecoration(
border:
OutlineInputBorder(),
hintText:
'Member Full Name',
labelText:
'Member Full Name',
contentPadding:
EdgeInsets.symmetric(
vertical: 10,
horizontal: 15),
),
validator: (value) {
if (value == null ||
value.isEmpty) {
return 'Member Full Name is required';
}
return null;
},
),
)
],
))),
SizedBox(width: 10),
Expanded(
flex: 4,
child: Container(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Container(
child: TextFormField(
onChanged: (value) => null,
decoration: InputDecoration(
border:
OutlineInputBorder(),
hintText: 'DD-MM-YYYY',
labelText:
'Date of Birth',
contentPadding:
EdgeInsets.symmetric(
vertical: 10,
horizontal: 15),
),
validator: (value) {
if (value == null ||
value.isEmpty) {
return 'Date of Birth is required';
}
return null;
},
),
)
],
))),
],
),
SizedBox(height: 10),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
flex: 12,
child: Container(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Align(
alignment:
Alignment.centerRight,
child: SizedBox(
width:
180, // Set the desired width
child: TextButton(
onPressed: () => null,
child: Row(
mainAxisAlignment:
MainAxisAlignment
.end,
children: [
Icon(
Icons
.person_remove,
color: Color(
0xFF62696C), // Set the color of the icon
),
SizedBox(
width:
8), // Add space between icon and text
Text(
'Remove',
style: TextStyle(
color: Color(
0xFF62696C), // Set the color of the text
),
)
],
),
),
),
),
],
))),
]),
SizedBox(height: 20),
Container(
decoration: BoxDecoration(
border: Border.all(
color:
Color(0xFF000000), // Set border color
width: 1, // Set border width
),
// Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Container(
alignment: Alignment.center,
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(
5), // Padding around the icon
decoration: BoxDecoration(
color: Color(
0xFF6A6A6A), // Background color of the icon container
borderRadius:
BorderRadius.circular(
5), // Radius of the container
),
child: Icon(
Icons
.person_add, // Icon data
color: Colors.white,
size:
20, // Color of the icon
),
),
],
))),
Expanded(
flex: 11,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Add Parent',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 22,
fontWeight:
FontWeight.w500,
),
),
],
))),
],
),
),
SizedBox(height: 20),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 5,
child: Container(
alignment: Alignment.center,
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
'Additional Premium',
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
Text(
'₹3099/Year',
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 18,
),
),
],
))),
Expanded(
flex: 2,
child: Container(
alignment: Alignment.center,
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
'GST',
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
Text(
'₹557.82/-',
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 18,
),
),
],
))),
Expanded(
flex: 5,
child: Container(
alignment: Alignment.center,
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
'Total Payable',
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
),
),
Text(
'₹3656.82/Year',
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 18,
),
),
],
))),
],
),
],
)),
],
),
)),
SizedBox(height: 16),
Card(
elevation: 0,
child: Container(
width: double.infinity,
height: 75,
padding: EdgeInsets.only(
top: 20,
bottom: 20,
left: 30,
right: 30), // Add padding to the container
child: Row(
children: [
Expanded(
flex: 6,
child: Container(
width: 150,
height: 150,
alignment: Alignment.centerLeft,
child: ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, 'empDetails');
},
child: Text(
'Back',
style: TextStyle(color: Color(0xFFE26728)),
),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
side: BorderSide(color: Color(0xFFE26728)),
),
),
),
)),
Expanded(
flex: 6,
child: Container(
width: 150,
height: 150,
alignment: Alignment.centerRight,
child: ElevatedButton(
onPressed: () {
Navigator.pushNamed(
context, 'empReviewDetails');
},
child: Text(
'Continue',
style: TextStyle(color: Colors.white),
),
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFFE26728),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
),
),
),
)),
],
),
),
),
],
),
),
),
);
}
}

View File

@ -20,20 +20,36 @@ class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
children: [
// Logo Column
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.only(top: 10, bottom: 10),
width: 150,
height: 150,
child: Image.asset(
'assets/navbarLogo.png',
fit: BoxFit.contain, // Adjust the fit as needed
),
flex: 3,
child: Row(
mainAxisAlignment: MainAxisAlignment
.spaceEvenly, // Adjust the alignment as needed
children: [
Container(
margin: EdgeInsets.only(top: 10, bottom: 10),
width: 230,
height: 230,
child: Image.asset(
'assets/Group_3.png',
fit: BoxFit.contain, // Adjust the fit as needed
),
),
// SizedBox(width: 0), // Adjust the space between the images
// Container(
// margin: EdgeInsets.only(top: 10, bottom: 10),
// width: 150,
// height: 150,
// child: Image.asset(
// 'assets/partnerLogo.png',
// fit: BoxFit.contain, // Adjust the fit as needed
// ),
// ),
],
),
),
// AdaptiveNavBar Column
Expanded(
flex: 8,
flex: 9,
child: AdaptiveNavBar(
screenWidth: sw,
backgroundColor: Color(0xFF00989E),

765
lib/empDetails.dart Normal file
View File

@ -0,0 +1,765 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'customAppBar/customAppBar.dart';
class empDetails extends StatefulWidget {
const empDetails({Key? key}) : super(key: key);
@override
State<empDetails> createState() => _empDetailsState();
}
class _empDetailsState extends State<empDetails> {
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: CustomAppBar(),
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.symmetric(
horizontal: MediaQuery.of(context).size.width *
0.1, // 30% of screen width as horizontal padding
vertical: MediaQuery.of(context).size.height *
0.03, // 5% of screen height as vertical padding
),
color: Color(0xFFEFF3F6),
child: Column(
children: [
Card(
elevation: 0,
child: Container(
width: double.infinity,
height: 75,
padding: EdgeInsets.only(
top: 20,
bottom: 20,
left: 30,
right: 30), // Add padding to the container
child: Row(
children: [
Expanded(
flex: 6,
child: Container(
width: 150,
height: 150,
alignment: Alignment.centerLeft,
child: Image.asset(
'assets/Group.png',
width: 80, // Set the width of the image
height: 80, // Set the height of the image
fit: BoxFit.contain, // Adjust the fit as needed
),
)),
Expanded(
flex: 6,
child: Text(
'Bharti Airtel',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
)
],
),
),
),
SizedBox(height: 16),
Card(
elevation: 0,
child: Padding(
padding: EdgeInsets.all(30),
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Color(
0xFFFFF1DD), // Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Plan Name',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
),
),
Text(
'Group Personal Accident Coverage',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Text(
'Floater Sum Insured',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 18,
),
),
Text(
'₹ 3,00,000',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
],
),
),
SizedBox(height: 10),
Container(
padding: EdgeInsets.only(
top: 0, bottom: 0, left: 10, right: 10),
child: Text(
'This is a floater sum insured. A floater is a type ot sum insured that provides coverage to more than one member ot a tamily at the same time. Simply put, its a single insurance cover tor the entire family.',
style: TextStyle(
fontSize: 14,
color: Color(0xFF727272),
)),
),
SizedBox(height: 15),
Container(
decoration: BoxDecoration(
color: Color(
0xFFF9F9FB), // Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 12,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Please Note',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
Text(
'Lorem Ipsum is simply dummy text of the printing and typesetting industry.',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
),
),
],
))),
],
),
),
SizedBox(height: 15),
Container(
decoration: BoxDecoration(
border: Border.all(
color: Color(0xFF000000), // Set border color
width: 1, // Set border width
),
// Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.all(
10), // Padding around the icon
decoration: BoxDecoration(
color: Color(
0xFF00989E), // Background color of the icon container
borderRadius: BorderRadius.circular(
5), // Radius of the container
),
child: Icon(
Icons.account_circle, // Icon data
color: Colors.white,
size: 32, // Color of the icon
),
),
],
))),
Expanded(
flex: 9,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Employee',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
Text(
'Self • 6565656565 • 22/10/1997',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
),
),
],
))),
Expanded(
flex: 2,
child: Container(
alignment: Alignment.topRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Text(
'View',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 16,
color: Color(0xFFE26728),
),
),
],
))),
],
),
),
],
),
)),
SizedBox(height: 16),
Card(
elevation: 0,
child: Padding(
padding: EdgeInsets.all(30),
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Color(
0xFFFFF1DD), // Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Plan Name',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
),
),
Text(
'Group Medical Coverage',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Text(
'Floater Sum Insured',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 18,
),
),
Text(
'₹ 3,00,000',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
],
),
),
SizedBox(height: 10),
Container(
padding: EdgeInsets.only(
top: 0, bottom: 0, left: 10, right: 10),
child: Text(
'This is a floater sum insured. A floater is a type ot sum insured that provides coverage to more than one member ot a tamily at the same time. Simply put, its a single insurance cover tor the entire family.',
style: TextStyle(
fontSize: 14,
color: Color(0xFF727272),
)),
),
SizedBox(height: 15),
Container(
decoration: BoxDecoration(
color: Color(
0xFFF9F9FB), // Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 12,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Please Note',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
Text(
'Can add Employee + Spouse + 2 dependent children',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
),
),
],
))),
],
),
),
SizedBox(height: 15),
Container(
padding: EdgeInsets.only(
top: 0, bottom: 0, left: 15, right: 15),
child: Text('Please review your enrolled dependents.',
style: TextStyle(
fontSize: 18,
color: Color(0xFF727272),
fontWeight: FontWeight.w500,
)),
),
SizedBox(height: 15),
Container(
decoration: BoxDecoration(
border: Border.all(
color: Color(0xFF000000), // Set border color
width: 1, // Set border width
),
// Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.all(
10), // Padding around the icon
decoration: BoxDecoration(
color: Color(
0xFF00989E), // Background color of the icon container
borderRadius: BorderRadius.circular(
5), // Radius of the container
),
child: Icon(
Icons.account_circle, // Icon data
color: Colors.white,
size: 32, // Color of the icon
),
),
],
))),
Expanded(
flex: 9,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Employee',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
Text(
'Self • DOB - 22/10/1997',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
),
),
],
))),
Expanded(
flex: 2,
child: Container(
alignment: Alignment.topRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Text(
'View',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 16,
color: Color(0xFFE26728),
),
),
],
))),
],
),
),
SizedBox(height: 15),
Container(
decoration: BoxDecoration(
border: Border.all(
color: Color(0xFF000000), // Set border color
width: 1, // Set border width
),
// Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.all(
10), // Padding around the icon
decoration: BoxDecoration(
color: Color(
0xFF00989E), // Background color of the icon container
borderRadius: BorderRadius.circular(
5), // Radius of the container
),
child: Icon(
Icons.account_circle, // Icon data
color: Colors.white,
size: 32, // Color of the icon
),
),
],
))),
Expanded(
flex: 8,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Spouse Name',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
Text(
'Spouse • DOB - 22/10/1999',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
),
),
],
))),
Expanded(
flex: 1,
child: Container(
alignment: Alignment.topRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Text(
'Delete',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 16,
color: Color(0xFFE26728),
),
),
],
))),
Expanded(
flex: 1,
child: Container(
alignment: Alignment.topRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Text(
'View',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 16,
color: Color(0xFFE26728),
),
),
],
))),
],
),
),
SizedBox(height: 15),
Container(
decoration: BoxDecoration(
border: Border.all(
color: Color(0xFF000000), // Set border color
width: 1, // Set border width
),
// Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 1,
child: Container(
alignment: Alignment.center,
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(
5), // Padding around the icon
decoration: BoxDecoration(
color: Color(
0xFF6A6A6A), // Background color of the icon container
borderRadius: BorderRadius.circular(
5), // Radius of the container
),
child: Icon(
Icons.person_add, // Icon data
color: Colors.white,
size: 20, // Color of the icon
),
),
],
))),
Expanded(
flex: 11,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Add Child',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.w500,
),
),
],
))),
],
),
),
],
),
)),
SizedBox(height: 16),
Card(
elevation: 0,
child: Container(
width: double.infinity,
height: 75,
padding: EdgeInsets.only(
top: 20,
bottom: 20,
left: 30,
right: 30), // Add padding to the container
child: Row(
children: [
Expanded(
flex: 12,
child: Container(
width: 150,
height: 150,
alignment: Alignment.centerRight,
child: ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, 'addOnsDetails');
},
child: Text(
'Continue',
style: TextStyle(color: Colors.white),
),
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFFE26728),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
),
),
),
)),
],
),
),
),
],
),
),
),
);
}
}

906
lib/empReview.dart Normal file
View File

@ -0,0 +1,906 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'customAppBar/customAppBar.dart';
class empReviewDetails extends StatefulWidget {
const empReviewDetails({Key? key}) : super(key: key);
@override
State<empReviewDetails> createState() => _empReviewDetailsState();
}
class _empReviewDetailsState extends State<empReviewDetails> {
bool isChecked = false; // Declare the _isSwitched variable here
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: CustomAppBar(),
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.symmetric(
horizontal: MediaQuery.of(context).size.width *
0.1, // 30% of screen width as horizontal padding
vertical: MediaQuery.of(context).size.height *
0.03, // 5% of screen height as vertical padding
),
color: Color(0xFFEFF3F6),
child: Column(
children: [
Card(
elevation: 0,
child: Container(
width: double.infinity,
height: 75,
padding: EdgeInsets.only(
top: 20,
bottom: 20,
left: 30,
right: 30), // Add padding to the container
child: Row(
children: [
Expanded(
flex: 6,
child: Container(
width: 150,
height: 150,
alignment: Alignment.centerLeft,
child: Image.asset(
'assets/Group.png',
width: 80, // Set the width of the image
height: 80, // Set the height of the image
fit: BoxFit.contain, // Adjust the fit as needed
),
)),
Expanded(
flex: 6,
child: Text(
'Bharti Airtel',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
)
],
),
),
),
SizedBox(height: 16),
Card(
elevation: 0,
child: Container(
width: double.infinity,
padding: EdgeInsets.only(
top: 20,
bottom: 20,
left: 30,
right: 30), // Add padding to the container
child: Column(children: [
Row(
children: [
Expanded(
flex: 12,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Review',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 20,
color: Color(0xFF181818),
fontWeight: FontWeight.w600,
),
),
],
))),
],
),
Row(
children: [
Expanded(
flex: 2,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Total Payable',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
color: Color(0xFF181818),
),
),
],
))),
Expanded(
flex: 10,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'₹6016.82/Year ',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 22,
color: Color(0xFFE26728),
fontWeight: FontWeight.w500,
),
),
],
))),
],
),
])),
),
SizedBox(height: 16),
Card(
elevation: 0,
child: Padding(
padding: EdgeInsets.all(30),
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Color(
0xFFFFF1DD), // Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Plan Name',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
),
),
Text(
'Group Personal Accident Coverage',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Text(
'Floater Sum Insured',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 18,
),
),
Text(
'₹ 3,00,000',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
],
),
),
SizedBox(height: 15),
Container(
padding: EdgeInsets.only(
top: 0, bottom: 0, left: 15, right: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.arrow_right,
color: Color(0xFFE26728)), // Arrow icon
SizedBox(
width: 10), // Space between icon and text
Expanded(
child: Text(
'Employee Name • Self • DOB - 22/10/1997',
style: TextStyle(
fontSize: 18,
color: Color(0xFF232526),
),
),
),
],
),
],
),
),
],
),
)),
SizedBox(height: 16),
Card(
elevation: 0,
child: Padding(
padding: EdgeInsets.all(30),
child: Column(
children: [
Container(
decoration: BoxDecoration(
color: Color(
0xFFFFF1DD), // Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Plan Name',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
),
),
Text(
'Group Medical Coverage',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Text(
'Floater Sum Insured',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 18,
),
),
Text(
'₹ 3,00,000',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
],
),
),
SizedBox(height: 15),
Container(
padding: EdgeInsets.only(
top: 0, bottom: 0, left: 15, right: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.arrow_right,
color: Color(0xFFE26728)), // Arrow icon
SizedBox(
width: 10), // Space between icon and text
Expanded(
child: Text(
'Employee Name • Self • DOB - 22/10/1997',
style: TextStyle(
fontSize: 18,
color: Color(0xFF232526),
),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.arrow_right,
color: Color(0xFFE26728)), // Arrow icon
SizedBox(
width: 10), // Space between icon and text
Expanded(
child: Text(
'Spouse Name • Spouse • DOB - 22/10/1997',
style: TextStyle(
fontSize: 18,
color: Color(0xFF232526),
),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.arrow_right,
color: Color(0xFFE26728)), // Arrow icon
SizedBox(
width: 10), // Space between icon and text
Expanded(
child: Text(
'Sons Name • Son • DOB - 22/10/1997',
style: TextStyle(
fontSize: 18,
color: Color(0xFF232526),
),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.arrow_right,
color: Color(0xFFE26728)), // Arrow icon
SizedBox(
width: 10), // Space between icon and text
Expanded(
child: Text(
'Daughters Name • Daughter • DOB - 22/10/1997',
style: TextStyle(
fontSize: 18,
color: Color(0xFF232526),
),
),
),
],
),
],
),
),
],
),
)),
SizedBox(height: 16),
Card(
elevation: 0,
child: Padding(
padding: EdgeInsets.all(30),
child: Column(
children: [
Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 12,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Add Ons',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
color: Color(0xFF181818),
fontWeight: FontWeight.w600,
),
),
],
))),
],
),
),
SizedBox(height: 15),
Container(
decoration: BoxDecoration(
color: Color(
0xFFFFF1DD), // Set background color for the container
borderRadius: BorderRadius.circular(
5), // Set border radius for the container
),
padding: EdgeInsets.only(
top: 15, bottom: 15, left: 25, right: 25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Addon Name',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
),
),
Text(
'Group Medical Coverage - Add Parents',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Text(
'Floater Sum Insured',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 18,
),
),
Text(
'₹ 3,00,000',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
),
),
],
))),
],
),
),
SizedBox(height: 15),
Container(
padding: EdgeInsets.only(
top: 0, bottom: 0, left: 15, right: 15),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.arrow_right,
color: Color(0xFFE26728)), // Arrow icon
SizedBox(
width: 10), // Space between icon and text
Expanded(
child: Text(
'Fathers Name • Father • DOB - 19/08/1948',
style: TextStyle(
fontSize: 18,
color: Color(0xFF232526),
),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(Icons.arrow_right,
color: Color(0xFFE26728)), // Arrow icon
SizedBox(
width: 10), // Space between icon and text
Expanded(
child: Text(
'Mothers Name • Mother • DOB - 19/08/1950',
style: TextStyle(
fontSize: 18,
color: Color(0xFF232526),
),
),
),
],
),
],
),
),
],
),
)),
SizedBox(height: 16),
Card(
elevation: 0,
child: Padding(
padding: EdgeInsets.all(30),
child: Column(
children: [
Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 12,
child: Container(
alignment: Alignment
.centerLeft, // Adjust padding as needed
child: Table(
columnWidths: {
0: FlexColumnWidth(
2), // Adjust column width as needed
1: FlexColumnWidth(2),
},
children: [
TableRow(
children: [
TableCell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Premium Summary',
textAlign: TextAlign.start,
style: TextStyle(
fontWeight:
FontWeight.bold),
),
),
),
TableCell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Additional Premium',
textAlign: TextAlign.start,
style: TextStyle(
fontWeight:
FontWeight.bold),
),
),
),
TableCell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'GST',
textAlign: TextAlign.start,
style: TextStyle(
fontWeight:
FontWeight.bold),
),
),
),
TableCell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Total',
textAlign: TextAlign.start,
style: TextStyle(
fontWeight:
FontWeight.bold),
),
),
),
],
),
TableRow(
children: [
TableCell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Group Medical Coverage - Top Up',
textAlign: TextAlign.start,
),
),
),
TableCell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'₹2000/Year',
textAlign: TextAlign.end,
),
),
),
TableCell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'₹360/-',
textAlign: TextAlign.end,
),
),
),
TableCell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'₹2360/Year',
textAlign: TextAlign.end,
),
),
),
],
),
TableRow(
children: [
TableCell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'Group Medical Coverage - Top Up',
textAlign: TextAlign.start,
),
),
),
TableCell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'₹2000/Year',
textAlign: TextAlign.end,
),
),
),
TableCell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'₹360/-',
textAlign: TextAlign.end,
),
),
),
TableCell(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
'₹2360/Year',
textAlign: TextAlign.end,
),
),
),
],
),
],
),
))
],
),
),
SizedBox(height: 10),
Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
'Total Payable',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 20,
color: Color(0xFF181818),
fontWeight: FontWeight.w600,
),
),
],
))),
Expanded(
flex: 6,
child: Container(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Text(
'₹6016.82/Year',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 18,
color: Color(0xFFE26728),
fontWeight: FontWeight.w500,
),
),
],
)))
],
),
),
SizedBox(height: 15),
Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
flex: 11,
child: Container(
alignment: Alignment.centerRight,
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
Text(
'I declare that the information I have provided is true and accurate to the best of my knowledge',
textAlign: TextAlign.right,
style: TextStyle(
fontSize: 18,
color: Color(0xFF292929),
),
),
],
))),
Expanded(
flex: 1,
child: Container(
alignment: Alignment.centerLeft,
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Checkbox(
value: isChecked,
onChanged: (bool? value) {
setState(() {
isChecked = value!;
});
},
activeColor: Color(0xFFE26728),
),
],
))),
],
),
),
SizedBox(height: 15),
Container(
child: Row(
children: [
Expanded(
flex: 6,
child: Container(
width: 150,
height: 150,
alignment: Alignment.centerLeft,
child: ElevatedButton(
onPressed: () {
Navigator.pushNamed(
context, 'addOnsDetails');
},
child: Text(
'Back',
style:
TextStyle(color: Color(0xFFE26728)),
),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(5),
side: BorderSide(
color: Color(0xFFE26728)),
),
),
),
)),
Expanded(
flex: 6,
child: Container(
width: 150,
height: 150,
alignment: Alignment.centerRight,
child: ElevatedButton(
onPressed: () {},
child: Text(
'Submit',
style: TextStyle(color: Colors.white),
),
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFFE26728),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(5),
),
),
),
)),
],
),
),
],
),
)),
],
),
),
),
);
}
}

View File

@ -34,6 +34,10 @@ class _excelVerifyState extends State<excelVerify> {
dynamic columnIndexMismatchCount = 0;
dynamic columnMissingCount = 0;
List<Map<String, dynamic>> extractedData = [];
dynamic policyName;
dynamic policyFirstPart;
List<Map<String, dynamic>> originalData = []; // Original data source
List<Map<String, dynamic>> filteredData = []; // Filtered data source
@override
void initState() {
@ -114,14 +118,16 @@ class _excelVerifyState extends State<excelVerify> {
reader.readAsArrayBuffer(file);
reader.onLoadEnd.listen((event) async {
Uint8List? fileBytes = reader.result as Uint8List?;
Uint8List? fileBytes2 = reader.result as Uint8List?;
if (fileBytes != null) {
// Call function to process Excel data
setState(() {
fileName = file.name;
});
// Save fileBytes to local storage
final jsonString = json.encode(fileBytes);
html.window.localStorage['fileBytes'] = jsonString;
print(fileName);
print(fileBytes);
_processExcelData(fileBytes);
}
});
@ -141,8 +147,8 @@ class _excelVerifyState extends State<excelVerify> {
if (dataArray[0].length == 10) {
for (int i = 0; i < dataArray.length; i++) {
Map<String, dynamic> dataMap = {
"SNo": dataArray[i][0].value,
"EmpCode": dataArray[i][1].value,
"S.No": dataArray[i][0].value,
"Emp Code": dataArray[i][1].value,
"Name": dataArray[i][2].value,
"DOJ": dataArray[i][3].value,
"Gender": dataArray[i][4].value,
@ -161,8 +167,9 @@ class _excelVerifyState extends State<excelVerify> {
}
}
// Do something with extracted data (e.g., display in UI)
print(extractedData);
originalData = extractedData;
filteredData = List.from(originalData);
print(filteredData);
print(validationArray);
validationArray[0].forEach((key, value) {
@ -222,13 +229,48 @@ class _excelVerifyState extends State<excelVerify> {
return dataArray;
}
Future<void> sendExcelFIleTOAPI() async {
print('_processExcelData');
print(fileBytes2);
void _dragAndDropFile(html.File file) async {
print('file');
print(file);
// Prepare form data
final formData = html.FormData();
formData.appendBlob('file', file);
// Send formData to API endpoint
final response = await html.HttpRequest.request(
'your_api_endpoint_here',
method: 'POST',
sendData: formData,
);
// Handle response as needed
print(response.responseText);
}
void _retrieveAndUploadFile() {
final jsonString = html.window.localStorage['fileBytes'];
if (jsonString != null) {
final decodedBytes = json.decode(jsonString);
if (decodedBytes is List<dynamic>) {
setState(() {
fileName = 'Retrieved File'; // Provide a default name
});
sendExcelFIleTOAPI(
Uint8List.fromList(decodedBytes.cast<int>()), fileName!);
}
}
}
Future<void> sendExcelFIleTOAPI(Uint8List fileBytes, String fileName) async {
print('submit');
print(fileBytes);
if (fileBytes == null) {
print('return');
return; // No file selected
}
// // Prepare form data
// final formData = html.FormData();
// formData.appendBlob('file', html.Blob([fileBytes]), fileName);
// URL of the API where you want to send the file
final apiUrl = Environment.apiUrl + 'employeeUpload';
@ -239,10 +281,14 @@ class _excelVerifyState extends State<excelVerify> {
// Attach the file to the request
// Set authorization token in headers
request.headers['Authorization'] = 'Bearer $_token';
request.files.add(http.MultipartFile.fromBytes('file', fileBytes!,
request.files.add(http.MultipartFile.fromBytes('file', fileBytes,
filename: fileName)); // Specify filename here
request.fields['client_id'] = clintID;
request.fields['policy_id'] = '1';
if (policyFirstPart == 'GPA') {
request.fields['policy_id'] = '1';
} else {
request.fields['policy_id'] = '3';
}
// Send the request
final response = await request.send();
@ -259,224 +305,425 @@ class _excelVerifyState extends State<excelVerify> {
}
}
void search(String query) {
setState(() {
if (query.isEmpty) {
// If search query is empty, show all data
filteredData = List.from(originalData);
} else {
// Filter the data based on the search query
filteredData = originalData.where((item) {
// Implement your filter logic here, for example:
return item['emp_code'].toLowerCase().contains(query.toLowerCase());
}).toList();
}
});
}
@override
Widget build(BuildContext context) {
// Retrieve the passed argument
dynamic importPolicyName =
ModalRoute.of(context)!.settings.arguments as String?;
List<String> parts = importPolicyName.split(" - ");
policyFirstPart =
parts.isNotEmpty ? parts[0] : ''; // Accessing the first element
print(policyFirstPart); // Output: GMC
print(importPolicyName);
return Scaffold(
appBar: CustomAppBar(),
body: Container(
padding: const EdgeInsets.all(20),
color: Color(0xFFEFF3F6),
child: Card(
elevation: 0,
child: Column(
children: [
Expanded(
child: Stepper(
type: StepperType.horizontal,
currentStep: _currentStep,
onStepContinue: _currentStep == 2
? null
: () {
if (_currentStep == 0) {
// For the first step, allow continue if fileName is not null
if (fileName != null) {
setState(() {
_currentStep += 1;
});
}
} else if (_currentStep == 1) {
// For the second step, allow continue if both errors are 0
if (missingColumnErrorMsg == 0 &&
columnIndexMismatchCount == 0) {
setState(() {
_currentStep += 1;
});
}
}
// setState(() {
// // Increment the current step when the user clicks continue
// if (_currentStep < 2) {
// _currentStep += 1;
// }
// });
},
onStepCancel: () {
setState(() {
// Decrement the current step when the user clicks cancel
if (_currentStep > 0) {
_currentStep -= 1;
}
});
},
steps: [
Step(
title: Container(
child: Text(
'Import Excel',
style: TextStyle(
color: Color(0xFFE26728),
body: SafeArea(
child: Theme(
data: ThemeData(
canvasColor: Color(0xFFF4F7FE),
colorScheme: Theme.of(context).colorScheme.copyWith(
primary: Color(0xFFE26728),
background: Colors.red,
secondary: Color(0xFFE26728),
),
),
child: Container(
padding: const EdgeInsets.all(20),
color: Color(0xFFEFF3F6),
child: Card(
elevation: 0,
child: Column(
children: [
Expanded(
child: Stepper(
type: StepperType.horizontal,
currentStep: _currentStep,
controlsBuilder:
(BuildContext context, ControlsDetails controls) {
return Positioned(
bottom: 0,
right: 0,
left: 0,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
if (_currentStep != 0)
ElevatedButton(
onPressed: controls.onStepCancel,
child: Text(
'Cancel',
style:
TextStyle(color: Color(0xFFE26728)),
),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
side: BorderSide(
color: Color(0xFFE26728)),
),
),
),
SizedBox(width: 10),
if (_currentStep != 2)
ElevatedButton(
onPressed: controls.onStepContinue,
child: const Text(
'NEXT',
style: TextStyle(color: Colors.white),
),
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFFE26728),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
),
),
),
SizedBox(width: 10),
if (_currentStep == 2)
ElevatedButton(
onPressed: () {
_retrieveAndUploadFile();
},
child: Text(
'Submit',
style: TextStyle(color: Colors.white),
),
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFFE26728),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5),
),
),
),
],
),
),
),
),
content: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 6,
child: Container(
margin: EdgeInsets.symmetric(horizontal: 10),
alignment: Alignment.center,
color: Colors.grey[200],
height: 300, // Adjust height as needed
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
fileName != null
? Text(
'File Uploaded: $fileName',
style: TextStyle(fontSize: 16),
)
: ElevatedButton(
onPressed: () =>
_uploadFile('Policy Name'),
);
},
onStepContinue: _currentStep == 2
? null
: () {
if (_currentStep == 0) {
// For the first step, allow continue if fileName is not null
if (fileName != null) {
setState(() {
_currentStep += 1;
});
}
} else if (_currentStep == 1) {
// For the second step, allow continue if both errors are 0
if (missingColumnErrorMsg == 0 &&
columnIndexMismatchCount == 0) {
setState(() {
_currentStep += 1;
});
}
}
// setState(() {
// // Increment the current step when the user clicks continue
// if (_currentStep < 2) {
// _currentStep += 1;
// }
// });
},
onStepCancel: () {
setState(() {
// Decrement the current step when the user clicks cancel
if (_currentStep > 0) {
_currentStep -= 1;
}
});
},
steps: [
Step(
title: Container(
child: Text(
'Import Excel',
style: TextStyle(
color: Color(0xFFE26728),
),
),
),
content: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
flex: 12,
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Expanded(
child: Text(
'Import',
importPolicyName ?? '',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white),
fontSize: 20,
fontWeight: FontWeight
.w600, // Adjust the font size as needed
color: Color(
0xFF181818), // Adjust the text color as needed
),
),
style: ElevatedButton.styleFrom(
backgroundColor:
Color(0xFFE26728),
)
],
),
SizedBox(height: 20),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Expanded(
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 150),
alignment: Alignment.center,
color: Colors.grey[200],
height:
250, // Adjust height as needed
child: DragTarget(
onAccept:
(html.File droppedFile) {
setState(() {
fileName = droppedFile.name;
});
_dragAndDropFile(droppedFile);
},
builder: (BuildContext context,
List<String?> candidateData,
List<dynamic>
rejectedData) {
return Container(
alignment: Alignment.center,
child: Column(
mainAxisAlignment:
MainAxisAlignment
.center,
children: [
if (fileName == null)
Text(
'Drop files here to start uploading',
style: TextStyle(
fontSize: 16),
),
SizedBox(height: 20),
if (fileName == null)
Text(
'OR',
style: TextStyle(
fontSize: 16),
), // Add spacing between texts
SizedBox(height: 20),
fileName != null
? Text(
'File Uploaded: $fileName',
style: TextStyle(
fontSize:
16),
)
: ElevatedButton(
onPressed: () =>
_uploadFile(
'Policy Name'),
child: Text(
'Select File',
style: TextStyle(
color: Colors
.white),
),
style: ElevatedButton
.styleFrom(
backgroundColor:
Color(
0xFFE26728),
),
),
// Add more Text widgets for additional lines of text
],
),
);
},
),
),
),
SizedBox(height: 20), // Add some space
// Drag and drop widget goes here
// Example: DragTarget or Draggable
// For example, a DragTarget that accepts Draggable widgets
// if (fileName != null)
// Text(
// 'File Uploaded: $fileName',
// style: TextStyle(fontSize: 16),
// ),
if (fileName == null)
DragTarget(
builder: (BuildContext context,
List<String?> candidateData,
List<dynamic> rejectedData) {
return Container(
width: 200,
height: 200,
alignment: Alignment.center,
color: Colors.blue,
child: Text(
'Drag and drop file to import'),
);
},
onAccept: (data) {
// Handle accepted data
},
],
),
],
],
),
),
),
],
),
],
),
isActive: _currentStep == 0,
),
),
isActive: _currentStep == 0,
),
Step(
title: Text(
'Excel Validation',
style: TextStyle(color: Color(0xFFE26728)),
),
content: Padding(
padding: EdgeInsets.only(
top: 30,
bottom: 30,
left: 300,
right:
300), // Adjust the horizontal padding as needed
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
_buildRowWithIcon(
missingColumnErrorMsg == 0
? Icons.check_circle
: Icons.error,
'No of column missing - $missingColumnErrorMsg',
iconColor: missingColumnErrorMsg == 0
? Colors.green
: Colors.red, // Set color based on condition
Step(
title: Text(
'Excel Validation',
style: TextStyle(color: Color(0xFFE26728)),
),
content: Padding(
padding: EdgeInsets.only(
top: 30,
bottom: 30,
left: 300,
right:
300), // Adjust the horizontal padding as needed
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
_buildRowWithIcon(
missingColumnErrorMsg == 0
? Icons.check_circle
: Icons.error,
'No of column missing - $missingColumnErrorMsg',
iconColor: missingColumnErrorMsg == 0
? Colors.green
: Colors
.red, // Set color based on condition
),
if (missingColumnErrorMsg == 0)
_buildRowWithIcon(
columnIndexMismatchCount == 0
? Icons.check_circle
: Icons.error,
'Column Index is Missmatching - $columnIndexMismatchCount',
iconColor: columnIndexMismatchCount == 0
? Colors.green
: Colors.red,
),
// _buildRowWithIcon(
// columnMissingCount == 0
// ? Icons.check_circle
// : Icons.error,
// 'Column Missing - $columnMissingCount',
// iconColor: columnMissingCount == 0
// ? Colors.green
// : Colors.red,
// ),
],
),
if (missingColumnErrorMsg == 0)
_buildRowWithIcon(
columnIndexMismatchCount == 0
? Icons.check_circle
: Icons.error,
'Column Index is Missmatching - $columnIndexMismatchCount',
iconColor: columnIndexMismatchCount == 0
? Colors.green
: Colors.red,
),
// _buildRowWithIcon(
// columnMissingCount == 0
// ? Icons.check_circle
// : Icons.error,
// 'Column Missing - $columnMissingCount',
// iconColor: columnMissingCount == 0
// ? Colors.green
// : Colors.red,
// ),
],
),
isActive: _currentStep == 1,
),
),
isActive: _currentStep == 1,
),
Step(
title: Text(
'Preview',
style: TextStyle(color: Color(0xFFE26728)),
),
content: Column(
children: [
Row(
Step(
title: Text(
'Preview',
style: TextStyle(color: Color(0xFFE26728)),
),
content: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: _buildDataTable(),
),
)
Row(
children: [
Expanded(
flex: 10,
child: Container(
alignment: Alignment.centerLeft,
child: Container(
width:
350, // Set your desired width here
height:
40, // Set your desired height here
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(
255,
255,
255,
0.5), // Shadow color with opacity
offset: Offset(5,
5), // Shadow position (horizontal, vertical)
blurRadius: 10, // Blur radius
spreadRadius:
0, // Spread radius
),
],
borderRadius:
BorderRadius.circular(5),
),
child: TextField(
textAlignVertical: TextAlignVertical
.center, // Center the text vertically
decoration: InputDecoration(
hintText: 'Search',
suffixIcon: Icon(Icons.search),
contentPadding: EdgeInsets.all(
10), // Adjust the horizontal padding
border: OutlineInputBorder(
borderSide: BorderSide(
color: Color(
0xFFf5f5f7)), // Set border color to gray
),
),
onChanged:
search, // Call the search method on text change
),
)),
),
],
),
SizedBox(height: 20),
Row(
children: [
Expanded(
child: SingleChildScrollView(
child: _buildDataTable(),
),
)
],
),
],
),
],
),
isActive: _currentStep == 2,
),
],
),
),
SizedBox(height: 20),
if (_currentStep == 2)
Align(
alignment: Alignment.bottomRight,
child: ElevatedButton(
onPressed: () {
sendExcelFIleTOAPI();
},
child: Text(
'Complete',
style: TextStyle(color: Colors.white),
),
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFFE26728),
isActive: _currentStep == 2,
),
],
),
),
),
SizedBox(height: 20),
],
// SizedBox(height: 20),
// if (_currentStep == 2)
// Align(
// alignment: Alignment.bottomRight,
// child: ElevatedButton(
// onPressed: () {
// sendExcelFIleTOAPI();
// },
// child: Text(
// 'Complete',
// style: TextStyle(color: Colors.white),
// ),
// style: ElevatedButton.styleFrom(
// backgroundColor: Color(0xFFE26728),
// ),
// ),
// ),
// SizedBox(height: 20),
],
),
),
),
),
),
@ -484,7 +731,7 @@ class _excelVerifyState extends State<excelVerify> {
}
Widget _buildDataTable() {
if (extractedData.isEmpty) {
if (filteredData.isEmpty) {
SizedBox(height: 25);
return Text('No available data');
} else {
@ -504,7 +751,7 @@ class _excelVerifyState extends State<excelVerify> {
DataColumn(label: Text('Mobile No')),
DataColumn(label: Text('SI')),
],
source: _DependenceDataSource0(extractedData),
source: _DependenceDataSource0(filteredData),
),
);
}

View File

@ -37,11 +37,15 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
dynamic clintID;
late TabController _tabController;
List<dynamic> dataPolicy = [];
List<Map<String, dynamic>> originalDataGpa = []; // Original data source
List<Map<String, dynamic>> filteredDataGpa = []; // Filtered data source
List<Map<String, dynamic>> originalDataGmc = []; // Original data source
List<Map<String, dynamic>> filteredDataGmc = []; // Filtered data source
@override
void initState() {
super.initState();
_tabController = TabController(length: 3, vsync: this);
_tabController = TabController(length: 2, vsync: this);
_loadToken();
}
@ -59,7 +63,7 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
_token = token;
});
Map<String, dynamic>? decodedToken = Jwt.parseJwt(token);
clintID = decodedToken['client_id'].toString();
clintID = decodedToken['client_id'];
await getPolicyName(clintID);
} else {
_token = 'null';
@ -96,16 +100,9 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
getPolicyNo1 = dataPolicy[1]['client_policy_id'];
print(getPolicyNameDetails1);
});
const duration = Duration(seconds: 5);
Timer.periodic(duration, (timer) {
// Code to execute periodically every 2 seconds
getEmployeeAndDependenceGPA(clintID, getPolicyNo0);
getEmployeeAndDependenceGMC(clintID, getPolicyNo1);
// If you want to stop the periodic execution after some time,
// you can cancel the timer like this:
timer.cancel();
});
// Code to execute periodically every 2 seconds
getEmployeeAndDependenceGPA(clintID, getPolicyNo0);
getEmployeeAndDependenceGMC(clintID, getPolicyNo1);
} else {
print('API request failed with status: ${data['status']}');
}
@ -140,6 +137,8 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
setState(() {
getEmpDependenceByClintIdGPA =
List<Map<String, dynamic>>.from(data['data']);
originalDataGpa = getEmpDependenceByClintIdGPA;
filteredDataGpa = List.from(originalDataGpa);
});
} else {
print('API request failed with status: ${data['status']}');
@ -175,6 +174,8 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
setState(() {
getEmpDependenceByClintIdGMC =
List<Map<String, dynamic>>.from(data['data']);
originalDataGmc = getEmpDependenceByClintIdGMC;
filteredDataGmc = List.from(originalDataGmc);
});
} else {
print('API request failed with status: ${data['status']}');
@ -191,113 +192,15 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
}
}
// void _GMCImport() async {
// FilePickerResult? result = await FilePicker.platform.pickFiles(
// type: FileType.custom,
// allowedExtensions: ['xlsx', 'xls'], // Allow Excel file extensions
// );
//
// if (result != null) {
// List<int> fileBytes = result.files.single.bytes!;
// String fileName = result.files.single.name;
//
// var request = http.MultipartRequest(
// 'POST',
// Uri.parse(Environment.apiUrl + 'employeeUpload'),
// );
// // Set authorization token in headers
// request.headers['Authorization'] = 'Bearer $_token';
// request.files.add(
// http.MultipartFile.fromBytes(
// 'file',
// fileBytes,
// filename: fileName,
// ),
// );
// request.fields['client_id'] = clintID;
// request.fields['policy_id'] = '3';
//
// var response = await request.send();
//
// if (response.statusCode == 200) {
// ToastHelper.showSuccessToast(context, 'File uploaded successfully');
// print('File uploaded successfully');
//
// // Call your API here after file upload
// await getEmployeeAndDependenceGMC(clintID, getPolicyNo1);
// } else {
// ToastHelper.showErrorToast(
// context, 'Failed to upload file: ${response.reasonPhrase}');
// print('Failed to upload file: ${response.reasonPhrase}');
// }
// }
// }
// void _GPAImport() async {
// FilePickerResult? result = await FilePicker.platform.pickFiles(
// type: FileType.custom,
// allowedExtensions: ['xlsx', 'xls'], // Allow Excel file extensions
// );
//
// if (result != null) {
// List<int> fileBytes = result.files.single.bytes!;
// String fileName = result.files.single.name;
//
// var request = http.MultipartRequest(
// 'POST',
// Uri.parse(Environment.apiUrl + 'employeeUpload'),
// );
// // Set authorization token in headers
// request.headers['Authorization'] = 'Bearer $_token';
// request.files.add(
// http.MultipartFile.fromBytes(
// 'file',
// fileBytes,
// filename: fileName,
// ),
// );
// request.fields['client_id'] = clintID;
// request.fields['policy_id'] = '1';
//
// var response = await request.send();
//
// if (response.statusCode == 200) {
// print('File uploaded successfully');
// ToastHelper.showSuccessToast(context, 'File uploaded successfully');
//
// // Call your API here after file upload
// await getEmployeeAndDependenceGPA(clintID, getPolicyNo0);
// } else {
// ToastHelper.showErrorToast(
// context, 'Failed to upload file: ${response.reasonPhrase}');
// print('Failed to upload file: ${response.reasonPhrase}');
// }
// }
// }
// void _uploadFile(importPolicyName) async {
// if (kIsWeb) {
// print('WEB');
// final input = html.FileUploadInputElement();
// input.accept = '.xlsx,.xls'; // Specify accepted file types here
// input.click();
// input.onChange.listen((event) {
// final file = input.files!.first;
// final reader = html.FileReader();
// reader.readAsArrayBuffer(file);
//
// reader.onLoadEnd.listen((event) {
// setState(() {
// _fileBytes = reader.result as Uint8List?;
// _importFile(importPolicyName);
// });
// });
// });
// }
// }
void _uploadFile(importPolicyName) async {
Navigator.pushNamed(context, 'excelVerify');
var argumentDetails;
if (importPolicyName == 'GPA') {
argumentDetails = importPolicyName + ' - ' + getPolicyNameDetails0;
} else {
argumentDetails = importPolicyName + ' - ' + getPolicyNameDetails1;
}
Navigator.pushNamed(context, 'excelVerify', arguments: argumentDetails);
return;
if (kIsWeb) {
final input = html.FileUploadInputElement();
@ -311,218 +214,41 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
final Uint8List? fileBytes = reader.result as Uint8List?;
if (fileBytes != null) {
// Call function to process Excel data
_processExcelData(fileBytes);
}
});
});
}
}
void _processExcelData(Uint8List fileBytes) {
// Decode the Excel file and extract relevant data
// Assuming dataArray is your array containing Excel data
List<List<Data>> dataArray = decodeExcelData(fileBytes);
// Extract Name, Age, and City from the array
List<Map<String, dynamic>> extractedData = [];
for (int i = 1; i < dataArray.length; i++) {
Map<String, dynamic> dataMap = {
"SNo": dataArray[i][0].value,
"EmpCode": dataArray[i][1].value,
"Name": dataArray[i][2].value,
"DOJ": dataArray[i][3].value,
"Gender": dataArray[i][4].value,
"Relation": dataArray[i][5].value,
"DOB": dataArray[i][6].value,
"mail": dataArray[i][7].value,
"mobile": dataArray[i][8].value,
"SI": dataArray[i][9].value,
};
extractedData.add(dataMap);
}
// Do something with extracted data (e.g., display in UI)
print(extractedData);
}
// Placeholder function for decoding Excel data
List<List<Data>> decodeExcelData(Uint8List fileBytes) {
// Implement your logic to decode Excel data here
// This function should return your array containing Excel data
// For example, you can use the excel package to decode the Excel file
// Import the excel package in your pubspec.yaml file:
// dependencies:
// excel: ^1.1.0
// Then use the following code to decode the Excel file:
// Import the necessary packages
// import 'package:excel/excel.dart';
// Create an Excel instance from the fileBytes
final excel = Excel.decodeBytes(fileBytes);
// Assuming there's only one sheet in the Excel file
final sheet = excel.tables.keys.first;
final table = excel.tables[sheet]!;
// Convert Excel table to a List<List<Data>>
// Convert Excel table to a List<List<Data>>
List<List<Data>> dataArray = [];
for (int rowIdx = 0; rowIdx < table.rows.length; rowIdx++) {
List<Data> rowData = [];
for (int colIdx = 0; colIdx < table.rows[rowIdx].length; colIdx++) {
var value = table.rows[rowIdx][colIdx]?.value;
rowData.add(Data(value, rowIdx, colIdx, sheet));
}
dataArray.add(rowData);
}
return dataArray;
}
Future<void> _importFile(importPolicyName) async {
if (_fileBytes == null) {
return; // No file selected
}
// URL of the API where you want to send the file
final apiUrl = Environment.apiUrl + 'employeeUpload';
// Create a multipart request
final request = http.MultipartRequest('POST', Uri.parse(apiUrl));
// Attach the file to the request
// Set authorization token in headers
request.headers['Authorization'] = 'Bearer $_token';
request.files.add(http.MultipartFile.fromBytes('file', _fileBytes!,
filename: 'excel_file.xls')); // Specify filename here
request.fields['client_id'] = clintID;
if (importPolicyName == 'GPA') {
request.fields['policy_id'] = '1';
} else {
request.fields['policy_id'] = '3';
}
// Send the request
final response = await request.send();
// Check the status code of the response
if (response.statusCode == 200) {
// ToastHelper.showSuccessToast(context, 'File uploaded successfully');
print('File uploaded successfully');
if (importPolicyName == 'GPA') {
await getEmployeeAndDependenceGPA(clintID, getPolicyNo0);
void searchGpa(String query) {
setState(() {
if (query.isEmpty) {
// If search query is empty, show all data
filteredDataGpa = List.from(originalDataGpa);
} else {
await getEmployeeAndDependenceGMC(clintID, getPolicyNo1);
// Filter the data based on the search query
filteredDataGpa = originalDataGpa.where((item) {
// Implement your filter logic here, for example:
return item['emp_code'].toLowerCase().contains(query.toLowerCase());
}).toList();
}
print('File uploaded successfully');
} else {
// ToastHelper.showSuccessToast(
// context, 'Failed to upload file: ${response.reasonPhrase}');
print('Failed to upload file: ${response.reasonPhrase}');
}
});
}
// void _GPAImport() async {
// print('Enter');
//
// if (kIsWeb) {
// print('WEB');
// final input = html.FileUploadInputElement();
// input.accept = '.xlsx,.xls'; // Specify accepted file types here
// input.click();
// print('WEB111');
// input.onChange.listen((event) {
// final file = input.files!.first;
// final reader = html.FileReader();
// reader.readAsArrayBuffer(file);
//
// reader.onLoadEnd.listen((event) {
// setState(() {
// _fileBytes = reader.result as Uint8List?;
// });
// });
// });
// print(_fileBytes);
// if (_fileBytes == null) {
// return; // No file selected
// } else {
// var request = http.MultipartRequest(
// 'POST',
// Uri.parse(Environment.apiUrl + 'employeeUpload'),
// );
//
// // Set authorization token in headers
// request.headers['Authorization'] = 'Bearer $_token';
// request.files.add(
// http.MultipartFile.fromBytes(
// 'file',
// _fileBytes!,
// ),
// );
// request.fields['client_id'] = clintID;
// request.fields['policy_id'] = '1';
//
// var response = await request.send();
//
// if (response.statusCode == 200) {
// print('File uploaded successfully');
// ToastHelper.showSuccessToast(context, 'File uploaded successfully');
//
// // Call your API here after file upload
// await getEmployeeAndDependenceGPA(clintID, getPolicyNo0);
// } else {
// ToastHelper.showErrorToast(
// context, 'Failed to upload file: ${response.reasonPhrase}');
// print('Failed to upload file: ${response.reasonPhrase}');
// }
// }
// } else {
// print('IOS Android');
// // Use file picker for mobile platforms
// FilePickerResult? result = await FilePicker.platform.pickFiles(
// type: FileType.custom,
// allowedExtensions: ['xlsx', 'xls'], // Allow Excel file extensions
// );
//
// // Rest of your code remains the same
// // Make sure to handle the result based on the platform
// if (result != null) {
// List<int> fileBytes = result.files.single.bytes!;
// String fileName = result.files.single.name;
//
// var request = http.MultipartRequest(
// 'POST',
// Uri.parse(Environment.apiUrl + 'employeeUpload'),
// );
//
// // Set authorization token in headers
// request.headers['Authorization'] = 'Bearer $_token';
// request.files.add(
// http.MultipartFile.fromBytes(
// 'file',
// fileBytes,
// filename: fileName,
// ),
// );
// request.fields['client_id'] = clintID;
// request.fields['policy_id'] = '1';
//
// var response = await request.send();
//
// if (response.statusCode == 200) {
// print('File uploaded successfully');
// ToastHelper.showSuccessToast(context, 'File uploaded successfully');
//
// // Call your API here after file upload
// await getEmployeeAndDependenceGPA(clintID, getPolicyNo0);
// } else {
// ToastHelper.showErrorToast(
// context, 'Failed to upload file: ${response.reasonPhrase}');
// print('Failed to upload file: ${response.reasonPhrase}');
// }
// }
// }
// }
void searchGmc(String query) {
setState(() {
if (query.isEmpty) {
// If search query is empty, show all data
filteredDataGmc = List.from(originalDataGmc);
} else {
// Filter the data based on the search query
filteredDataGmc = originalDataGmc.where((item) {
// Implement your filter logic here, for example:
return item['emp_code'].toLowerCase().contains(query.toLowerCase());
}).toList();
}
});
}
@override
Widget build(BuildContext context) {
@ -539,7 +265,7 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
labelColor: Colors.white, // Selected tab color
unselectedLabelColor: Colors.grey, // Unselected tab color
indicator: BoxDecoration(
color: Colors.red, // Background color of selected tab
color: Color(0xFFE26728), // Background color of selected tab
),
indicatorSize: TabBarIndicatorSize.label,
controller: _tabController,
@ -549,7 +275,7 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
width: double.maxFinite,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 0),
child: Text('GPA-' + getPolicyNameDetails0 ?? ''),
child: Text('GPA-' + (getPolicyNameDetails0 ?? '')),
),
),
Tab(
@ -557,7 +283,7 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
width: double.infinity,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 0),
child: Text('GMC-' + getPolicyNameDetails1 ?? ''),
child: Text('GMC-' + (getPolicyNameDetails1 ?? '')),
),
),
],
@ -578,15 +304,50 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
Expanded(
flex: 10,
child: Container(
alignment: Alignment.centerLeft,
child: Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
alignment: Alignment.centerLeft,
child: Container(
width:
350, // Set your desired width here
height:
40, // Set your desired height here
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(
255,
255,
255,
0.5), // Shadow color with opacity
offset: Offset(5,
5), // Shadow position (horizontal, vertical)
blurRadius:
10, // Blur radius
spreadRadius:
0, // Spread radius
),
],
borderRadius:
BorderRadius.circular(5),
),
child: TextField(
textAlignVertical: TextAlignVertical
.center, // Center the text vertically
decoration: InputDecoration(
hintText: 'Search',
suffixIcon:
Icon(Icons.search),
contentPadding: EdgeInsets.all(
10), // Adjust the horizontal padding
border: OutlineInputBorder(
borderSide: BorderSide(
color: Color(
0xFFf5f5f7)), // Set border color to gray
),
),
onChanged:
searchGpa, // Call the search method on text change
),
)),
),
Expanded(
flex: 2,
@ -594,14 +355,14 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
alignment: Alignment.centerRight,
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
MainAxisAlignment.center,
children: [
Expanded(
child: ElevatedButton(
onPressed: () =>
_uploadFile('GPA'),
child: Text(
'Import',
'Import Data',
style: TextStyle(
color: Colors.white),
),
@ -609,6 +370,12 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
ElevatedButton.styleFrom(
backgroundColor:
Color(0xFFE26728),
shape:
RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(
5),
),
),
),
),
@ -644,15 +411,50 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
Expanded(
flex: 10,
child: Container(
alignment: Alignment.centerLeft,
child: Text(
'',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
alignment: Alignment.centerLeft,
child: Container(
width:
350, // Set your desired width here
height:
40, // Set your desired height here
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Color.fromRGBO(
255,
255,
255,
0.5), // Shadow color with opacity
offset: Offset(5,
5), // Shadow position (horizontal, vertical)
blurRadius:
10, // Blur radius
spreadRadius:
0, // Spread radius
),
],
borderRadius:
BorderRadius.circular(5),
),
child: TextField(
textAlignVertical: TextAlignVertical
.center, // Center the text vertically
decoration: InputDecoration(
hintText: 'Search',
suffixIcon:
Icon(Icons.search),
contentPadding: EdgeInsets.all(
10), // Adjust the horizontal padding
border: OutlineInputBorder(
borderSide: BorderSide(
color: Color(
0xFFf5f5f7)), // Set border color to gray
),
),
onChanged:
searchGmc, // Call the search method on text change
),
)),
),
Expanded(
flex: 2,
@ -675,6 +477,12 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
ElevatedButton.styleFrom(
backgroundColor:
Color(0xFFE26728),
shape:
RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(
5),
),
),
),
)
@ -709,7 +517,7 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
}
Widget _buildDataTableGPA() {
if (getEmpDependenceByClintIdGPA.isEmpty) {
if (filteredDataGpa.isEmpty) {
SizedBox(height: 25);
return Text('No available data');
} else {
@ -725,14 +533,14 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
DataColumn(label: Text('Gender')),
DataColumn(label: Text('Mobile No')),
],
source: _DependenceDataSource0(getEmpDependenceByClintIdGPA),
source: _DependenceDataSource0(filteredDataGpa),
),
);
}
}
Widget _buildDataTableGMC() {
if (getEmpDependenceByClintIdGPA.isEmpty) {
if (filteredDataGmc.isEmpty) {
SizedBox(height: 25);
return Text('No available data');
} else {
@ -748,7 +556,7 @@ class _MyHrHomeState extends State<MyHrHome> with TickerProviderStateMixin {
DataColumn(label: Text('Gender')),
DataColumn(label: Text('Mobile No')),
],
source: _DependenceDataSource1(getEmpDependenceByClintIdGMC),
source: _DependenceDataSource1(filteredDataGmc),
),
);
}

View File

@ -161,7 +161,7 @@ class _MyPhoneState extends State<MyHrLogin> {
Row(
children: [
Expanded(
flex: 6,
flex: 4,
child: Align(
alignment: Alignment.centerLeft,
child: MouseRegion(
@ -178,13 +178,11 @@ class _MyPhoneState extends State<MyHrLogin> {
children: [
Icon(
Icons
.keyboard_backspace, // Icon for customer login
.west, // Icon for customer login
color: Colors
.black, // Adjust color as needed
),
SizedBox(
width:
5), // Add some space between icon and text
SizedBox(width: 5),
Text(
'Customer Login',
style: TextStyle(
@ -199,7 +197,7 @@ class _MyPhoneState extends State<MyHrLogin> {
),
)),
Expanded(
flex: 6,
flex: 8,
child: Align(
alignment: Alignment
.centerRight, // Align to the start
@ -223,43 +221,53 @@ class _MyPhoneState extends State<MyHrLogin> {
)),
],
),
SizedBox(
height:
20), // Add some space between rows
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
"Welcome to Nhance",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
SizedBox(height: 15),
Container(
margin:
EdgeInsets.symmetric(horizontal: 150),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
"Welcome to Nhance",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
),
],
],
),
),
SizedBox(
height: 15,
),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
"Have a Health Insurance Policy number, but never signed in? Don't worry, We got you covered",
style: TextStyle(
fontSize: 12,
color: Color(0xFF000000)),
textAlign: TextAlign.center,
),
],
Container(
margin:
EdgeInsets.symmetric(horizontal: 150),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Expanded(
child: Text(
"Have a Health Insurance Policy number, but never signed in? Don't worry, We got you covered",
style: TextStyle(
fontSize: 12,
color: Color(0xFF000000)),
textAlign: TextAlign.center,
),
)
],
),
),
SizedBox(
height: 20,
),
Container(
height: 55,
margin:
EdgeInsets.symmetric(horizontal: 150),
decoration: BoxDecoration(
border: Border.all(
width: 1, color: Colors.grey),
@ -325,22 +333,26 @@ class _MyPhoneState extends State<MyHrLogin> {
SizedBox(
height: 20,
),
SizedBox(
width: double.infinity,
height: 45,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFF00989E),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10),
Container(
margin:
EdgeInsets.symmetric(horizontal: 150),
child: SizedBox(
width: double.infinity,
height: 45,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFF00989E),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10),
),
),
onPressed: handleSubmit,
child: Text(
"Login With OTP",
style: TextStyle(
color: Color(0xFFFFFFFF)),
),
),
onPressed: handleSubmit,
child: Text(
"Login With OTP",
style: TextStyle(
color: Color(0xFFFFFFFF)),
),
),
),
@ -348,22 +360,27 @@ class _MyPhoneState extends State<MyHrLogin> {
height: _size.width <= 1100 ? 0 : 0,
),
_size.width > 1100
? Column(
children: [
SizedBox(height: 30),
Text(
"Benefits of Login",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
? Container(
margin: EdgeInsets.symmetric(
horizontal: 150),
child: Column(
children: [
SizedBox(height: 30),
Text(
"Benefits of Login",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
SizedBox(height: 15),
],
)
SizedBox(height: 15),
],
))
: SizedBox(),
_size.width > 1100
? Container(
margin: EdgeInsets.symmetric(
horizontal: 150),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,

View File

@ -2,6 +2,9 @@ import 'dart:js';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:nhancepolicy/addons.dart';
import 'package:nhancepolicy/empReview.dart';
import 'package:nhancepolicy/empDetails.dart';
import 'package:nhancepolicy/excel_verification.dart';
import 'package:nhancepolicy/hrHome.dart';
import 'package:nhancepolicy/hrVerify.dart';
@ -26,6 +29,9 @@ Future<void> main() async {
'hrVerify': (context) => MyHrVerify(),
'hrHome': (context) => MyHrHome(),
'excelVerify': (context) => excelVerify(),
'empDetails': (context) => empDetails(),
'addOnsDetails': (context) => addOnsDetails(),
'empReviewDetails': (context) => empReviewDetails(),
},
));
}

View File

@ -140,7 +140,7 @@ class _MyPhoneState extends State<MyPhone> {
Row(
children: [
Expanded(
flex: 6,
flex: 10,
child: Align(
alignment: Alignment
.centerLeft, // Align to the start
@ -163,71 +163,90 @@ class _MyPhoneState extends State<MyPhone> {
),
)),
Expanded(
flex: 6,
flex: 2,
child: Align(
alignment: Alignment.centerRight,
child: ElevatedButton(
onPressed: () {
Navigator.pushNamed(
context, 'hrLogin');
},
child: Text(
'HR login',
style: TextStyle(
color: Color(0xFF00989E)),
),
style: ElevatedButton.styleFrom(
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(
5),
side: BorderSide(
color: Color(
0xFF00989E)), // Add border
child: MouseRegion(
cursor:
SystemMouseCursors.click,
child: GestureDetector(
onTap: () {
// Add your navigation logic here
// For example, you can use Navigator.push to navigate to another page
Navigator.pushNamed(
context, 'hrLogin');
},
child: Row(
children: [
Text(
'HR Login',
style: TextStyle(
color: Color(
0xFF000000), // Text color
// Add other text styles as needed
),
),
SizedBox(width: 5),
Icon(
Icons
.east, // Icon for customer login
color: Colors
.black, // Adjust color as needed
),
],
),
),
),
))
)),
],
),
SizedBox(
height:
20), // Add some space between rows
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
"Welcome to Nhance",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
SizedBox(height: 15),
Container(
margin:
EdgeInsets.symmetric(horizontal: 150),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
"Welcome to Nhance",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
),
],
],
),
),
SizedBox(
height: 15,
),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
"Have a Health Insurance Policy number, but never signed in? Don't worry, We got you covered",
style: TextStyle(
fontSize: 12,
color: Color(0xFF000000)),
textAlign: TextAlign.center,
),
],
Container(
margin:
EdgeInsets.symmetric(horizontal: 150),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Expanded(
child: Text(
"Have a Health Insurance Policy number, but never signed in? Don't worry, We got you covered",
style: TextStyle(
fontSize: 12,
color: Color(0xFF000000)),
textAlign: TextAlign.center,
),
)
],
),
),
SizedBox(
height: 20,
),
Container(
height: 55,
margin:
EdgeInsets.symmetric(horizontal: 150),
decoration: BoxDecoration(
border: Border.all(
width: 1, color: Colors.grey),
@ -293,22 +312,26 @@ class _MyPhoneState extends State<MyPhone> {
SizedBox(
height: 20,
),
SizedBox(
width: double.infinity,
height: 45,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFF00989E),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10),
Container(
margin:
EdgeInsets.symmetric(horizontal: 150),
child: SizedBox(
width: double.infinity,
height: 45,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFF00989E),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10),
),
),
onPressed: handleSubmit,
child: Text(
"Login With OTP",
style: TextStyle(
color: Color(0xFFFFFFFF)),
),
),
onPressed: handleSubmit,
child: Text(
"Login With OTP",
style: TextStyle(
color: Color(0xFFFFFFFF)),
),
),
),
@ -316,22 +339,27 @@ class _MyPhoneState extends State<MyPhone> {
height: _size.width <= 1100 ? 0 : 0,
),
_size.width > 1100
? Column(
children: [
SizedBox(height: 30),
Text(
"Benefits of Login",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
? Container(
margin: EdgeInsets.symmetric(
horizontal: 150),
child: Column(
children: [
SizedBox(height: 30),
Text(
"Benefits of Login",
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
SizedBox(height: 15),
],
)
SizedBox(height: 15),
],
))
: SizedBox(),
_size.width > 1100
? Container(
margin: EdgeInsets.symmetric(
horizontal: 150),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,

View File

@ -111,7 +111,7 @@ class _MyVerifyState extends State<MyVerify> {
// ToastHelper.showSuccessToast(context, 'Successfully Login');
print('Successfully Login');
// Redirect to another page
Navigator.pushNamed(context, 'home');
Navigator.pushNamed(context, 'empDetails');
} else {
// Show a Snackbar if the OTP is invalid
// ToastHelper.showErrorToast(context, 'Invalid OTP. Please try again');