layout changes
This commit is contained in:
parent
5c31a33ff2
commit
15992c4008
@ -307,25 +307,40 @@ class _ApprovalListState extends State<ApprovalList> {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
appBar: isDesktop ? null : const CustomAppBar(title: 'Home'),
|
// appBar: isDesktop ? null : const CustomAppBar(title: 'Home'),
|
||||||
drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
// drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
||||||
body: Row(
|
appBar: const CustomAppBar(),
|
||||||
|
drawer: CustomDrawer(isDesktop: false),
|
||||||
|
body: Padding(
|
||||||
|
padding: isDesktop
|
||||||
|
? EdgeInsets.symmetric(
|
||||||
|
horizontal: MediaQuery.of(context).size.width *
|
||||||
|
0.1, // 30% of screen width as horizontal padding
|
||||||
|
vertical: MediaQuery.of(context).size.height *
|
||||||
|
0, // 5% of screen height as vertical padding
|
||||||
|
)
|
||||||
|
: EdgeInsets.all(8),
|
||||||
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
// if (isDesktop) CustomDrawer(isDesktop: true),
|
||||||
Expanded(child: buildGroupListLayout(isDesktop))
|
Expanded(child: buildGroupListLayout(isDesktop))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildGroupListLayout(bool isDesktop) {
|
Widget buildGroupListLayout(bool isDesktop) {
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
// color: Colors.amber,
|
// // color: Colors.amber,
|
||||||
// color: bodyColor,
|
// // color: bodyColor,
|
||||||
color: Color(0xFFE1F5FE),
|
// color: Color(0xFFE1F5FE),
|
||||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
// border: Border.all(
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
|
// color: Colors.white,
|
||||||
|
// width: 3.5)),
|
||||||
child: buildTableLayout(isDesktop),
|
child: buildTableLayout(isDesktop),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -341,25 +356,26 @@ class _ApprovalListState extends State<ApprovalList> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
margin: isDesktop
|
// margin: isDesktop
|
||||||
? EdgeInsets.all(10.0)
|
// ? EdgeInsets.all(10.0)
|
||||||
: EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
// : EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||||
padding: const EdgeInsets.all(10),
|
// padding: const EdgeInsets.all(10),
|
||||||
height: isDesktop
|
height: isDesktop
|
||||||
? MediaQuery.of(context).size.height * 0.98
|
? MediaQuery.of(context).size.height * 0.98
|
||||||
: MediaQuery.of(context).size.height,
|
: MediaQuery.of(context).size.height,
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
border: isDesktop
|
// border: isDesktop
|
||||||
? Border.all(
|
// ? Border.all(
|
||||||
width: 2,
|
// width: 2,
|
||||||
color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
)
|
// // color: Color(0xFFF7F7FB),
|
||||||
: null,
|
// )
|
||||||
color: Colors.white,
|
// : null,
|
||||||
// color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
// color: Colors.amber,
|
//
|
||||||
),
|
// // color: Colors.amber,
|
||||||
|
// ),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(1.0),
|
padding: const EdgeInsets.all(1.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -368,7 +384,10 @@ class _ApprovalListState extends State<ApprovalList> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 2),
|
// Divider(
|
||||||
|
// thickness: 0.2, // how "thick" the line is
|
||||||
|
// color: Colors.grey, // optional
|
||||||
|
// ),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@ -382,16 +401,6 @@ class _ApprovalListState extends State<ApprovalList> {
|
|||||||
color: Color(0xFF212121))),
|
color: Color(0xFF212121))),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: 2),
|
|
||||||
Divider(
|
|
||||||
thickness: 0.2, // how "thick" the line is
|
|
||||||
color: Colors.grey, // optional
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Container(
|
Container(
|
||||||
width: MediaQuery.of(context).size.width * 0.2,
|
width: MediaQuery.of(context).size.width * 0.2,
|
||||||
// or use Flexible
|
// or use Flexible
|
||||||
|
|||||||
@ -9,27 +9,19 @@ class HomePage extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
return ResponsiveBuilder(builder: (context, sizingInfo) {
|
||||||
return ResponsiveBuilder(
|
|
||||||
builder: (context, sizingInfo) {
|
|
||||||
bool isDesktop = sizingInfo.deviceScreenType == DeviceScreenType.desktop;
|
bool isDesktop = sizingInfo.deviceScreenType == DeviceScreenType.desktop;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: isDesktop ? null : const CustomAppBar(title:'Home'),
|
appBar: isDesktop ? null : const CustomAppBar(),
|
||||||
drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
||||||
body:
|
body: Row(
|
||||||
Row(
|
|
||||||
children: [
|
children: [
|
||||||
if(isDesktop)
|
if (isDesktop) CustomDrawer(isDesktop: true),
|
||||||
CustomDrawer(isDesktop: true),
|
|
||||||
const Expanded(child: Center(child: Text("Home Page Content"))),
|
const Expanded(child: Center(child: Text("Home Page Content"))),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -324,14 +324,24 @@ class _groupState extends State<Group> {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
appBar: isDesktop ? null : const CustomAppBar(title: 'Home'),
|
appBar: const CustomAppBar(),
|
||||||
drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
drawer: CustomDrawer(isDesktop: false),
|
||||||
body: Row(
|
body: Padding(
|
||||||
|
padding: isDesktop
|
||||||
|
? EdgeInsets.symmetric(
|
||||||
|
horizontal: MediaQuery.of(context).size.width *
|
||||||
|
0.1, // 30% of screen width as horizontal padding
|
||||||
|
vertical: MediaQuery.of(context).size.height *
|
||||||
|
0, // 5% of screen height as vertical padding
|
||||||
|
)
|
||||||
|
: EdgeInsets.all(8),
|
||||||
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
// if (isDesktop) CustomDrawer(isDesktop: true),
|
||||||
Expanded(child: buildData(isDesktop, context))
|
Expanded(child: buildData(isDesktop, context))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -339,17 +349,20 @@ class _groupState extends State<Group> {
|
|||||||
Widget buildData(bool isDesktop, context) {
|
Widget buildData(bool isDesktop, context) {
|
||||||
return Container(
|
return Container(
|
||||||
// margin: const EdgeInsets.only(left: 10.0, right: 15.0, top: 10.0, bottom: 10.0),
|
// margin: const EdgeInsets.only(left: 10.0, right: 15.0, top: 10.0, bottom: 10.0),
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
// color: Colors.amber,
|
// // color: Colors.amber,
|
||||||
// color: bodyColor,
|
// // color: bodyColor,
|
||||||
color: Color(0xFFE1F5FE),
|
// color: Color(0xFFE1F5FE),
|
||||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
// border: Border.all(
|
||||||
|
// color: Colors.white,
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
|
// width: 3.5)),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
// color: bodyColor,
|
// color: bodyColor,
|
||||||
color: Color(0xFFE1F5FE),
|
// color: Color(0xFFE1F5FE),
|
||||||
child: buildOrganizationLayout(isDesktop),
|
child: buildOrganizationLayout(isDesktop),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -373,25 +386,26 @@ class _groupState extends State<Group> {
|
|||||||
|
|
||||||
Widget buildOrganizationLayout(isDesktop) {
|
Widget buildOrganizationLayout(isDesktop) {
|
||||||
return Container(
|
return Container(
|
||||||
margin: isDesktop
|
// margin: isDesktop
|
||||||
? EdgeInsets.all(10.0)
|
// ? EdgeInsets.all(10.0)
|
||||||
: EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
// : EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||||
height: isDesktop
|
height: isDesktop
|
||||||
? MediaQuery.of(context).size.height * 0.98
|
? MediaQuery.of(context).size.height * 0.98
|
||||||
: MediaQuery.of(context).size.height,
|
: MediaQuery.of(context).size.height,
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
border: isDesktop
|
// border: isDesktop
|
||||||
? Border.all(
|
// ? Border.all(
|
||||||
width: 2,
|
// width: 2,
|
||||||
color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
)
|
// // color: Color(0xFFF7F7FB),
|
||||||
: null,
|
// )
|
||||||
color: Colors.white,
|
// : null,
|
||||||
|
// color: Colors.white,
|
||||||
// color: Color(0xFFF7F7FB),
|
//
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
// color: Colors.amber,
|
//
|
||||||
),
|
// // color: Colors.amber,
|
||||||
|
// ),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
|||||||
@ -132,25 +132,38 @@ class _GroupListState extends State<GroupList> {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
appBar: isDesktop ? null : const CustomAppBar(title: 'Home'),
|
appBar: const CustomAppBar(),
|
||||||
drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
drawer: CustomDrawer(isDesktop: false),
|
||||||
body: Row(
|
body: Padding(
|
||||||
|
padding: isDesktop
|
||||||
|
? EdgeInsets.symmetric(
|
||||||
|
horizontal: MediaQuery.of(context).size.width *
|
||||||
|
0.1, // 30% of screen width as horizontal padding
|
||||||
|
vertical: MediaQuery.of(context).size.height *
|
||||||
|
0, // 5% of screen height as vertical padding
|
||||||
|
)
|
||||||
|
: EdgeInsets.all(8),
|
||||||
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
// if (isDesktop) CustomDrawer(isDesktop: true),
|
||||||
Expanded(child: buildGroupListLayout(isDesktop))
|
Expanded(child: buildGroupListLayout(isDesktop))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildGroupListLayout(bool isDesktop) {
|
Widget buildGroupListLayout(bool isDesktop) {
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
// color: Colors.amber,
|
// // color: Colors.amber,
|
||||||
// color: bodyColor,
|
// // color: bodyColor,
|
||||||
color: Color(0xFFE1F5FE),
|
// color: Color(0xFFE1F5FE),
|
||||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
// border: Border.all(
|
||||||
|
// color: Colors.white,
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
|
// width: 3.5)),
|
||||||
child: buildGroupData(isDesktop),
|
child: buildGroupData(isDesktop),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -163,25 +176,26 @@ class _GroupListState extends State<GroupList> {
|
|||||||
|
|
||||||
Widget buildGroupData(isDesktop) {
|
Widget buildGroupData(isDesktop) {
|
||||||
return Container(
|
return Container(
|
||||||
margin: isDesktop
|
// margin: isDesktop
|
||||||
? EdgeInsets.all(10.0)
|
// ? EdgeInsets.all(10.0)
|
||||||
: EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
// : EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||||
padding: const EdgeInsets.all(10),
|
// padding: const EdgeInsets.all(10),
|
||||||
height: isDesktop
|
height: isDesktop
|
||||||
? MediaQuery.of(context).size.height * 0.98
|
? MediaQuery.of(context).size.height * 0.98
|
||||||
: MediaQuery.of(context).size.height,
|
: MediaQuery.of(context).size.height,
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
border: isDesktop
|
// border: isDesktop
|
||||||
? Border.all(
|
// ? Border.all(
|
||||||
width: 2,
|
// width: 2,
|
||||||
color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
)
|
// // color: Color(0xFFF7F7FB),
|
||||||
: null,
|
// )
|
||||||
color: Colors.white,
|
// : null,
|
||||||
// color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
// color: Colors.amber,
|
//
|
||||||
),
|
// // color: Colors.amber,
|
||||||
|
// ),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
|
|||||||
@ -184,7 +184,7 @@ class TaxiListWidget extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"${getRequestForTaxiClass(item["car_type"]!.toString())} For ${item["no_of_passengers"]!} Passernger",
|
"${getRequestForTaxiClass(item["car_type"]!.toString())} For ${item["no_of_passengers"]!} Passenger",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.w800,
|
fontWeight: FontWeight.w800,
|
||||||
|
|||||||
@ -331,24 +331,37 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
appBar: isDesktop ? null : const CustomAppBar(title: 'Home'),
|
appBar: const CustomAppBar(),
|
||||||
drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
drawer: CustomDrawer(isDesktop: false),
|
||||||
body: Row(
|
body: Padding(
|
||||||
|
padding: isDesktop
|
||||||
|
? EdgeInsets.symmetric(
|
||||||
|
horizontal: MediaQuery.of(context).size.width *
|
||||||
|
0.1, // 30% of screen width as horizontal padding
|
||||||
|
vertical: MediaQuery.of(context).size.height *
|
||||||
|
0, // 5% of screen height as vertical padding
|
||||||
|
)
|
||||||
|
: EdgeInsets.all(8),
|
||||||
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
// if (isDesktop) CustomDrawer(isDesktop: true),
|
||||||
Expanded(child: buildOrganizationLayout(isDesktop))
|
Expanded(child: buildOrganizationLayout(isDesktop))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildOrganizationLayout(isDesktop) {
|
Widget buildOrganizationLayout(isDesktop) {
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
// color: Colors.amber,
|
// // color: Colors.amber,
|
||||||
color: bodyColor,
|
// color: bodyColor,
|
||||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
// border: Border.all(
|
||||||
|
// color: Colors.white,
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
|
// width: 3.5)),
|
||||||
child: Column(
|
child: Column(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@ -401,24 +414,25 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
margin: isDesktop
|
// margin: isDesktop
|
||||||
? EdgeInsets.all(10.0)
|
// ? EdgeInsets.all(10.0)
|
||||||
: EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
// : EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||||
height: isDesktop
|
height: isDesktop
|
||||||
? MediaQuery.of(context).size.height * 0.98
|
? MediaQuery.of(context).size.height * 0.98
|
||||||
: MediaQuery.of(context).size.height,
|
: MediaQuery.of(context).size.height,
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
border: isDesktop
|
// border: isDesktop
|
||||||
? Border.all(
|
// ? Border.all(
|
||||||
width: 2,
|
// width: 2,
|
||||||
color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
)
|
// // color: Color(0xFFF7F7FB),
|
||||||
: null,
|
// )
|
||||||
color: Colors.white,
|
// : null,
|
||||||
// color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
// color: Colors.amber,
|
//
|
||||||
),
|
// // color: Colors.amber,
|
||||||
|
// ),
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@ -59,11 +59,13 @@ class _OrganizationListState extends State<OrganizationList> {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
appBar: isDesktop ? null : const CustomAppBar(title: 'Home'),
|
// appBar: isDesktop ? null : const CustomAppBar(title: 'Home'),
|
||||||
drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
// drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
||||||
|
appBar: const CustomAppBar(),
|
||||||
|
drawer: CustomDrawer(isDesktop: false),
|
||||||
body: Row(
|
body: Row(
|
||||||
children: [
|
children: [
|
||||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
// if (isDesktop) CustomDrawer(isDesktop: true),
|
||||||
Expanded(child: buildGroupListLayout(isDesktop))
|
Expanded(child: buildGroupListLayout(isDesktop))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -67,14 +67,26 @@ class _CreatePlansState extends State<CreatePlan> {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
body: Row(
|
appBar: const CustomAppBar(),
|
||||||
|
drawer: CustomDrawer(isDesktop: false),
|
||||||
|
body: Padding(
|
||||||
|
padding: isDesktop
|
||||||
|
? EdgeInsets.symmetric(
|
||||||
|
horizontal: MediaQuery.of(context).size.width *
|
||||||
|
0.1, // 30% of screen width as horizontal padding
|
||||||
|
vertical: MediaQuery.of(context).size.height *
|
||||||
|
0, // 5% of screen height as vertical padding
|
||||||
|
)
|
||||||
|
: EdgeInsets.all(8),
|
||||||
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
// if (isDesktop) CustomDrawer(isDesktop: true),
|
||||||
Expanded(
|
Expanded(
|
||||||
child:
|
child: buildUserTable(
|
||||||
buildUserTable(isDesktop, context, bodyColor, layoutColor)),
|
isDesktop, context, bodyColor, layoutColor)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -99,11 +111,15 @@ class _CreatePlansState extends State<CreatePlan> {
|
|||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
// margin: const EdgeInsets.only(left: 10.0, right: 15.0, top: 10.0, bottom: 10.0),
|
// margin: const EdgeInsets.only(left: 10.0, right: 15.0, top: 10.0, bottom: 10.0),
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
// color: Colors.amber,
|
// // color: Colors.amber,
|
||||||
// color: bodyColor,
|
// // color: bodyColor,
|
||||||
color: Color(0xFFE1F5FE),
|
// color: Color(0xFFE1F5FE),
|
||||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
// border: Border.all(
|
||||||
|
// color: Colors.white,
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
|
//
|
||||||
|
// width: 3.5)),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
// Container(
|
// Container(
|
||||||
@ -133,26 +149,27 @@ class _CreatePlansState extends State<CreatePlan> {
|
|||||||
// ),
|
// ),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: isDesktop
|
// margin: isDesktop
|
||||||
? EdgeInsets.all(10.0)
|
// ? EdgeInsets.all(10.0)
|
||||||
: EdgeInsets.only(
|
// : EdgeInsets.only(
|
||||||
left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
// left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||||
padding: const EdgeInsets.all(10),
|
// padding: const EdgeInsets.all(10),
|
||||||
height: isDesktop
|
height: isDesktop
|
||||||
? MediaQuery.of(context).size.height * 0.98
|
? MediaQuery.of(context).size.height * 0.98
|
||||||
: MediaQuery.of(context).size.height,
|
: MediaQuery.of(context).size.height,
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
border: isDesktop
|
// border: isDesktop
|
||||||
? Border.all(
|
// ? Border.all(
|
||||||
width: 2,
|
// width: 2,
|
||||||
color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
)
|
// // color: Color(0xFFF7F7FB),
|
||||||
: null,
|
// )
|
||||||
color: Colors.white,
|
// : null,
|
||||||
// color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
// color: Colors.amber,
|
//
|
||||||
),
|
// // color: Colors.amber,
|
||||||
|
// ),
|
||||||
|
|
||||||
// color: bodyColor,
|
// color: bodyColor,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
|
|||||||
@ -233,25 +233,40 @@ class _ListPlansState extends State<ListPlans> {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
appBar: isDesktop ? null : const CustomAppBar(title: 'Home'),
|
// appBar: isDesktop ? null : const CustomAppBar(title: 'Home'),
|
||||||
drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
// drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
||||||
body: Row(
|
appBar: const CustomAppBar(),
|
||||||
|
drawer: CustomDrawer(isDesktop: false),
|
||||||
|
body: Padding(
|
||||||
|
padding: isDesktop
|
||||||
|
? EdgeInsets.symmetric(
|
||||||
|
horizontal: MediaQuery.of(context).size.width *
|
||||||
|
0.1, // 30% of screen width as horizontal padding
|
||||||
|
vertical: MediaQuery.of(context).size.height *
|
||||||
|
0, // 5% of screen height as vertical padding
|
||||||
|
)
|
||||||
|
: EdgeInsets.all(8),
|
||||||
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
// if (isDesktop) CustomDrawer(isDesktop: true),
|
||||||
Expanded(child: buildGroupListLayout(isDesktop))
|
Expanded(child: buildGroupListLayout(isDesktop))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildGroupListLayout(bool isDesktop) {
|
Widget buildGroupListLayout(bool isDesktop) {
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
// color: Colors.amber,
|
// // color: Colors.amber,
|
||||||
// color: bodyColor,
|
// // color: bodyColor,
|
||||||
color: Color(0xFFE1F5FE),
|
// color: Color(0xFFE1F5FE),
|
||||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
// border: Border.all(
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
|
// color: Colors.white,
|
||||||
|
// width: 3.5)),
|
||||||
child: buildTableLayout(isDesktop),
|
child: buildTableLayout(isDesktop),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -278,7 +293,8 @@ class _ListPlansState extends State<ListPlans> {
|
|||||||
border: isDesktop
|
border: isDesktop
|
||||||
? Border.all(
|
? Border.all(
|
||||||
width: 2,
|
width: 2,
|
||||||
color: Color(0xFFF7F7FB),
|
color: Colors.white,
|
||||||
|
// color: Color(0xFFF7F7FB),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
@ -294,7 +310,10 @@ class _ListPlansState extends State<ListPlans> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(height: 2),
|
// Divider(
|
||||||
|
// thickness: 0.2, // how "thick" the line is
|
||||||
|
// color: Colors.grey, // optional
|
||||||
|
// ),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@ -308,16 +327,8 @@ class _ListPlansState extends State<ListPlans> {
|
|||||||
color: Color(0xFF212121))),
|
color: Color(0xFF212121))),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
|
||||||
),
|
Spacer(),
|
||||||
SizedBox(height: 2),
|
|
||||||
Divider(
|
|
||||||
thickness: 0.2, // how "thick" the line is
|
|
||||||
color: Colors.grey, // optional
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Container(
|
Container(
|
||||||
width: MediaQuery.of(context).size.width * 0.2,
|
width: MediaQuery.of(context).size.width * 0.2,
|
||||||
// or use Flexible
|
// or use Flexible
|
||||||
@ -573,30 +584,33 @@ class _ListPlansState extends State<ListPlans> {
|
|||||||
height: 25,
|
height: 25,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: plan.statusValue ==
|
color: getStatusColor(plan.statusValue),
|
||||||
"Partially Approved"
|
// color: plan.statusValue ==
|
||||||
? Colors.yellow.shade100
|
// "Partially Approved"
|
||||||
: plan.statusValue == "Approved"
|
// ? Colors.yellow.shade100
|
||||||
? Colors.green.shade100
|
// : plan.statusValue == "Approved"
|
||||||
: plan.statusValue == "Completed"
|
// ? Colors.green.shade100
|
||||||
? Colors.green.shade500
|
// : plan.statusValue == "Completed"
|
||||||
: plan.statusValue == "Rejected"
|
// ? Colors.green.shade500
|
||||||
? Colors.red.shade100
|
// : plan.statusValue == "Rejected"
|
||||||
: Colors.grey.shade100,
|
// ? Colors.red.shade100
|
||||||
|
// : Colors.grey.shade100,
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
plan.statusValue,
|
plan.statusValue,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: (plan.statusValue ==
|
color:
|
||||||
"Partially Approved" ||
|
getStatusTextColor(plan.statusValue),
|
||||||
plan.statusValue == "Approved" ||
|
// color: (plan.statusValue ==
|
||||||
plan.statusValue == "Rejected")
|
// "Partially Approved" ||
|
||||||
? Colors.black
|
// plan.statusValue == "Approved" ||
|
||||||
: plan.statusValue == "Completed"
|
// plan.statusValue == "Rejected")
|
||||||
? Colors.white
|
// ? Colors.black
|
||||||
: Colors.grey,
|
// : plan.statusValue == "Completed"
|
||||||
|
// ? Colors.white
|
||||||
|
// : Colors.grey,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
),
|
),
|
||||||
@ -667,4 +681,24 @@ class _ListPlansState extends State<ListPlans> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Helper functions for colors
|
||||||
|
Color getStatusColor(String status) {
|
||||||
|
if (status == "Partially Approved") return Colors.yellow.shade100;
|
||||||
|
if (status == "Approved") return Colors.green.shade100;
|
||||||
|
if (status == "Completed") return Colors.green.shade500;
|
||||||
|
if (status == "Rejected") return Colors.red.shade100;
|
||||||
|
return Colors.grey.shade100;
|
||||||
|
}
|
||||||
|
|
||||||
|
Color getStatusTextColor(String status) {
|
||||||
|
if (status == "Partially Approved" ||
|
||||||
|
status == "Approved" ||
|
||||||
|
status == "Rejected") {
|
||||||
|
return Colors.black;
|
||||||
|
} else if (status == "Completed") {
|
||||||
|
return Colors.white;
|
||||||
|
}
|
||||||
|
return Colors.grey;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -380,14 +380,23 @@ class _PolicyState extends State<Policy> {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
appBar: isDesktop ? null : const CustomAppBar(title: 'Policy'),
|
appBar: const CustomAppBar(),
|
||||||
drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
drawer: CustomDrawer(isDesktop: false),
|
||||||
body: Column(
|
body: Padding(
|
||||||
|
padding: isDesktop
|
||||||
|
? EdgeInsets.symmetric(
|
||||||
|
horizontal: MediaQuery.of(context).size.width *
|
||||||
|
0.1, // 30% of screen width as horizontal padding
|
||||||
|
vertical: MediaQuery.of(context).size.height *
|
||||||
|
0, // 5% of screen height as vertical padding
|
||||||
|
)
|
||||||
|
: EdgeInsets.all(8),
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
// if (isDesktop) CustomDrawer(isDesktop: true),
|
||||||
|
|
||||||
Expanded(child: buildData(isDesktop, context)),
|
Expanded(child: buildData(isDesktop, context)),
|
||||||
// Expanded(
|
// Expanded(
|
||||||
@ -401,6 +410,7 @@ class _PolicyState extends State<Policy> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
// Row(
|
// Row(
|
||||||
// children: [
|
// children: [
|
||||||
@ -440,16 +450,20 @@ class _PolicyState extends State<Policy> {
|
|||||||
Widget buildData(bool isDesktop, context) {
|
Widget buildData(bool isDesktop, context) {
|
||||||
return Container(
|
return Container(
|
||||||
// margin: const EdgeInsets.only(left: 10.0, right: 15.0, top: 10.0, bottom: 10.0),
|
// margin: const EdgeInsets.only(left: 10.0, right: 15.0, top: 10.0, bottom: 10.0),
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
color: Color(0xFFE1F5FE),
|
// color: Color(0xFFE1F5FE),
|
||||||
// color: bodyColor,
|
// // color: bodyColor,
|
||||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
// border: Border.all(
|
||||||
|
// color: Colors.white,
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
|
//
|
||||||
|
// width: 3.5)),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
// color: bodyColor,
|
// color: bodyColor,
|
||||||
color: Color(0xFFE1F5FE),
|
// color: Color(0xFFE1F5FE),
|
||||||
child: buildPolicyLayout(isDesktop),
|
child: buildPolicyLayout(isDesktop),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -473,24 +487,25 @@ class _PolicyState extends State<Policy> {
|
|||||||
|
|
||||||
Widget buildPolicyLayout(bool isDesktop) {
|
Widget buildPolicyLayout(bool isDesktop) {
|
||||||
return Container(
|
return Container(
|
||||||
margin: isDesktop
|
// margin: isDesktop
|
||||||
? EdgeInsets.all(10.0)
|
// ? EdgeInsets.all(10.0)
|
||||||
: EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
// : EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||||
height: isDesktop
|
height: isDesktop
|
||||||
? MediaQuery.of(context).size.height * 0.98
|
? MediaQuery.of(context).size.height * 0.98
|
||||||
: MediaQuery.of(context).size.height,
|
: MediaQuery.of(context).size.height,
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
border: isDesktop
|
// border: isDesktop
|
||||||
? Border.all(
|
// ? Border.all(
|
||||||
width: 2,
|
// width: 2,
|
||||||
color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
)
|
// // color: Color(0xFFF7F7FB),
|
||||||
: null,
|
// )
|
||||||
color: Colors.white,
|
// : null,
|
||||||
// color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
// color: Colors.amber,
|
//
|
||||||
),
|
// // color: Colors.amber,
|
||||||
|
// ),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@ -139,51 +139,65 @@ class _PolicyListState extends State<PolicyList> {
|
|||||||
bool isDesktop = sizingInfo.deviceScreenType == DeviceScreenType.desktop;
|
bool isDesktop = sizingInfo.deviceScreenType == DeviceScreenType.desktop;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white54,
|
||||||
appBar: isDesktop ? null : const CustomAppBar(title: 'Home'),
|
appBar: const CustomAppBar(),
|
||||||
drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
drawer: CustomDrawer(isDesktop: false),
|
||||||
body: Row(
|
body: Padding(
|
||||||
|
padding: isDesktop
|
||||||
|
? EdgeInsets.symmetric(
|
||||||
|
horizontal: MediaQuery.of(context).size.width *
|
||||||
|
0.1, // 30% of screen width as horizontal padding
|
||||||
|
vertical: MediaQuery.of(context).size.height *
|
||||||
|
0, // 5% of screen height as vertical padding
|
||||||
|
)
|
||||||
|
: EdgeInsets.all(8),
|
||||||
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
// if (isDesktop) CustomDrawer(isDesktop: true),
|
||||||
Expanded(child: buildGroupList(isDesktop))
|
Expanded(child: buildGroupList(isDesktop))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildGroupList(bool isDesktop) {
|
Widget buildGroupList(bool isDesktop) {
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
// color: Colors.amber,
|
// // color: Colors.amber,
|
||||||
color: Color(0xFFE1F5FE),
|
// color: Color(0xFFE1F5FE),
|
||||||
// color: bodyColor,
|
// // color: bodyColor,
|
||||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
// border: Border.all(
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
|
// color: Colors.white,
|
||||||
|
// width: 3.5)),
|
||||||
child: buildGroupListLayout(isDesktop),
|
child: buildGroupListLayout(isDesktop),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildGroupListLayout(bool isDesktop) {
|
Widget buildGroupListLayout(bool isDesktop) {
|
||||||
return Container(
|
return Container(
|
||||||
margin: isDesktop
|
// margin: isDesktop
|
||||||
? EdgeInsets.all(10.0)
|
// ? EdgeInsets.all(10.0)
|
||||||
: EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
// : EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||||
padding: const EdgeInsets.all(10),
|
// padding: const EdgeInsets.all(10),
|
||||||
height: isDesktop
|
height: isDesktop
|
||||||
? MediaQuery.of(context).size.height * 0.98
|
? MediaQuery.of(context).size.height * 0.98
|
||||||
: MediaQuery.of(context).size.height,
|
: MediaQuery.of(context).size.height,
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
border: isDesktop
|
// border: isDesktop
|
||||||
? Border.all(
|
// ? Border.all(
|
||||||
width: 2,
|
// width: 2,
|
||||||
color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
)
|
// // color: Color(0xFFF7F7FB),
|
||||||
: null,
|
// )
|
||||||
color: Colors.white,
|
// : null,
|
||||||
// color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
// color: Colors.amber,
|
//
|
||||||
),
|
// // color: Colors.amber,
|
||||||
|
// ),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
|
|||||||
@ -663,14 +663,23 @@ class _CreateUserFormState extends State<CreateUserForm> {
|
|||||||
bool isDesktop = sizingInfo.deviceScreenType == DeviceScreenType.desktop;
|
bool isDesktop = sizingInfo.deviceScreenType == DeviceScreenType.desktop;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: isDesktop ? null : const CustomAppBar(title: 'Create User '),
|
backgroundColor: Colors.white,
|
||||||
drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
// appBar: isDesktop ? null : const CustomAppBar(title: 'Create User '),
|
||||||
body: Container(
|
// drawer: isDesktop ? null : CustomDrawer(isDesktop: false),
|
||||||
// color: bodyColor,
|
appBar: const CustomAppBar(),
|
||||||
color: Colors.white,
|
drawer: CustomDrawer(isDesktop: false),
|
||||||
|
body: Padding(
|
||||||
|
padding: isDesktop
|
||||||
|
? EdgeInsets.symmetric(
|
||||||
|
horizontal: MediaQuery.of(context).size.width *
|
||||||
|
0.1, // 30% of screen width as horizontal padding
|
||||||
|
vertical: MediaQuery.of(context).size.height *
|
||||||
|
0, // 5% of screen height as vertical padding
|
||||||
|
)
|
||||||
|
: EdgeInsets.all(8),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
// if (isDesktop) CustomDrawer(isDesktop: true),
|
||||||
// const Expanded(child: Center(child: Text("User Details Content"))),
|
// const Expanded(child: Center(child: Text("User Details Content"))),
|
||||||
// Expanded(
|
// Expanded(
|
||||||
// child: _buildUserDetails(isDesktop),
|
// child: _buildUserDetails(isDesktop),
|
||||||
@ -687,35 +696,39 @@ class _CreateUserFormState extends State<CreateUserForm> {
|
|||||||
Widget buildData(bool isDesktop, context) {
|
Widget buildData(bool isDesktop, context) {
|
||||||
return Container(
|
return Container(
|
||||||
// margin: const EdgeInsets.only(left: 10.0, right: 15.0, top: 10.0, bottom: 10.0),
|
// margin: const EdgeInsets.only(left: 10.0, right: 15.0, top: 10.0, bottom: 10.0),
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
// color: Colors.amber,
|
// // color: Colors.amber,
|
||||||
// color: bodyColor,
|
// // color: bodyColor,
|
||||||
color: Color(0xFFE1F5FE),
|
// color: Color(0xFFE1F5FE),
|
||||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
// border: Border.all(
|
||||||
|
// color: Colors.white,
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
|
// width: 3.5)),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: isDesktop
|
// margin: isDesktop
|
||||||
? EdgeInsets.all(10.0)
|
// ? EdgeInsets.all(10.0)
|
||||||
: EdgeInsets.only(
|
// : EdgeInsets.only(
|
||||||
left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
// left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||||
padding: const EdgeInsets.all(10),
|
// padding: const EdgeInsets.all(10),
|
||||||
height: isDesktop
|
height: isDesktop
|
||||||
? MediaQuery.of(context).size.height * 0.98
|
? MediaQuery.of(context).size.height * 0.98
|
||||||
: MediaQuery.of(context).size.height,
|
: MediaQuery.of(context).size.height,
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
border: isDesktop
|
// border: isDesktop
|
||||||
? Border.all(
|
// ? Border.all(
|
||||||
width: 2,
|
// width: 2,
|
||||||
color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
)
|
// // color: Color(0xFFF7F7FB),
|
||||||
: null,
|
// )
|
||||||
color: Colors.white,
|
// : null,
|
||||||
// color: Color(0xFFF7F7FB),
|
// color: Colors.white,
|
||||||
|
// // color: Color(0xFFF7F7FB),
|
||||||
// color: Colors.amber,
|
//
|
||||||
),
|
// // color: Colors.amber,
|
||||||
|
// ),
|
||||||
// color: bodyColor,
|
// color: bodyColor,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1,34 +1,361 @@
|
|||||||
|
import 'dart:convert';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart'; // don't forget
|
||||||
|
import '../services/apiService.dart';
|
||||||
|
|
||||||
class CustomAppBar extends StatelessWidget implements PreferredSizeWidget {
|
class CustomAppBar extends StatefulWidget implements PreferredSizeWidget {
|
||||||
final String title;
|
final String? logoUrl;
|
||||||
final List<Widget>? actions; // Optional actions (icons, buttons)
|
final String? username;
|
||||||
|
final List<Widget>? actions;
|
||||||
final bool showBackButton;
|
final bool showBackButton;
|
||||||
|
|
||||||
const CustomAppBar({
|
const CustomAppBar({
|
||||||
super.key,
|
super.key,
|
||||||
required this.title,
|
this.logoUrl,
|
||||||
|
this.username,
|
||||||
this.actions,
|
this.actions,
|
||||||
this.showBackButton = false, // Default: No back button
|
this.showBackButton = false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_CustomAppBarState createState() => _CustomAppBarState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CustomAppBarState extends State<CustomAppBar> {
|
||||||
|
final ApiService apiService = ApiService();
|
||||||
|
|
||||||
|
String? token;
|
||||||
|
Map<String, dynamic>? userData;
|
||||||
|
Map<String, dynamic>? fetchedUserData;
|
||||||
|
Map<String, dynamic> userDetails = {};
|
||||||
|
|
||||||
|
Map<String, dynamic>? selectedOrg;
|
||||||
|
Color? layoutColor;
|
||||||
|
Color? bodyColor;
|
||||||
|
|
||||||
|
Color _myTravelRequestColor = Color(0xFF475569); // Default color
|
||||||
|
Color _myApprovalsColor = Color(0xFF475569); // Default color
|
||||||
|
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
// initializeData();
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
|
initializeData();
|
||||||
|
getOrganizationData();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> initializeData() async {
|
||||||
|
print("initializeDatainitializeData");
|
||||||
|
token = await getToken();
|
||||||
|
fetchedUserData = await getUserData();
|
||||||
|
|
||||||
|
if (token == null || fetchedUserData == null) {
|
||||||
|
print("Token or USerId missing");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setState(() {
|
||||||
|
userData = fetchedUserData;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String?> getToken() async {
|
||||||
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
return prefs.getString("auth_token");
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Map<String, dynamic>?> getUserData() async {
|
||||||
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
final String? userDataString = prefs.getString('user_data');
|
||||||
|
|
||||||
|
if (userDataString != null) {
|
||||||
|
try {
|
||||||
|
userDetails = jsonDecode(userDataString);
|
||||||
|
|
||||||
|
return {
|
||||||
|
"user_id": userDetails["user_id"].toString(),
|
||||||
|
"name": "${userDetails["first_name"]} ${userDetails["last_name"]}",
|
||||||
|
"email": userDetails["email"] ?? "",
|
||||||
|
"role": userDetails["role"] ?? "",
|
||||||
|
};
|
||||||
|
} catch (e) {
|
||||||
|
print("Error decoding user data: $e");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> getOrganizationData() async {
|
||||||
|
try {
|
||||||
|
print("getUpdatedServices");
|
||||||
|
|
||||||
|
final result = await apiService.fetchOrganization();
|
||||||
|
|
||||||
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
print("UUPdatedServices - $result");
|
||||||
|
|
||||||
|
setState(() {
|
||||||
|
selectedOrg = result;
|
||||||
|
|
||||||
|
layoutColor = selectedOrg?['layout_color'] != null
|
||||||
|
? Color(int.parse(selectedOrg!['layout_color']))
|
||||||
|
: Colors.white;
|
||||||
|
|
||||||
|
bodyColor = selectedOrg?['color'] != null
|
||||||
|
? Color(int.parse(
|
||||||
|
selectedOrg!['color'].toString().replaceFirst('0x', ''),
|
||||||
|
radix: 16))
|
||||||
|
: Colors.blue;
|
||||||
|
|
||||||
|
String? rawLogoPath = selectedOrg?['logo'];
|
||||||
|
if (rawLogoPath != null && rawLogoPath.contains('/assets')) {
|
||||||
|
const baseUrl = "https://apitest.tripapprovaltool.com";
|
||||||
|
final assetPath = rawLogoPath.split('/assets').last;
|
||||||
|
selectedOrg!['logo'] = "$baseUrl/assets$assetPath";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Save to SharedPreferences
|
||||||
|
await prefs.setString('layout_color', selectedOrg?['layout_color']);
|
||||||
|
await prefs.setString('body_color', selectedOrg?['color']);
|
||||||
|
await prefs.setString('body_color', selectedOrg?['plan_action']);
|
||||||
|
|
||||||
|
print(
|
||||||
|
"Layout Color- ${selectedOrg?['layout_color']} - $layoutColor ---------- bodyColor - $bodyColor");
|
||||||
|
} catch (e) {
|
||||||
|
print("Error : $e");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AppBar(
|
return AppBar(
|
||||||
title: Text(title, style: const TextStyle(fontWeight: FontWeight.bold)),
|
backgroundColor: Colors.white,
|
||||||
centerTitle: true,
|
surfaceTintColor: Colors.white,
|
||||||
backgroundColor: Colors.blueAccent, // Customize color
|
// elevation: 3,
|
||||||
elevation: 4, // Shadow effect
|
automaticallyImplyLeading: false,
|
||||||
leading: showBackButton
|
// leading: showBackButton
|
||||||
? IconButton(
|
// ? IconButton(
|
||||||
icon: const Icon(Icons.arrow_back),
|
// icon: const Icon(Icons.arrow_back, color: Colors.black87),
|
||||||
onPressed: () => Navigator.pop(context), // Back navigation
|
// onPressed: () => Navigator.pop(context),
|
||||||
|
// )
|
||||||
|
// : null,
|
||||||
|
titleSpacing: 0,
|
||||||
|
title: Row(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
child: selectedOrg?['logo'] != null
|
||||||
|
? ClipRect(
|
||||||
|
child: Image.network(
|
||||||
|
selectedOrg!['logo'],
|
||||||
|
width: 100,
|
||||||
|
height: 50,
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
return const CircleAvatar(
|
||||||
|
radius: 20,
|
||||||
|
backgroundColor: Colors.redAccent,
|
||||||
|
child: Icon(Icons.error, size: 10),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
)
|
)
|
||||||
: null,
|
: const CircleAvatar(
|
||||||
actions: actions,
|
radius: 20,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
child: Icon(
|
||||||
|
Icons.add_a_photo,
|
||||||
|
size: 10,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
MouseRegion(
|
||||||
|
cursor: SystemMouseCursors.click,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
print("ONTAP Custom");
|
||||||
|
print("ONTAP Custom- $userDetails ");
|
||||||
|
context.go(
|
||||||
|
"/CreateUserDetails",
|
||||||
|
extra: {
|
||||||
|
"selectedUser": userDetails,
|
||||||
|
"isEditProfile": true,
|
||||||
|
"isViewMode": true
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
userData?["name"] ?? "N/A",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontFamily: "Archivo",
|
||||||
|
// color: Color(0xFF12B24B),
|
||||||
|
color: layoutColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
MouseRegion(
|
||||||
|
cursor: SystemMouseCursors.click,
|
||||||
|
onEnter: (_) {
|
||||||
|
setState(() {
|
||||||
|
_myTravelRequestColor = Colors.blue; // Change color on hover
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onExit: (_) {
|
||||||
|
setState(() {
|
||||||
|
_myTravelRequestColor =
|
||||||
|
Color(0xFF475569); // Revert color when hover ends
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
context.go('/listPlan');
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
"My Travel Request",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
// color: Color(0xFF475569),
|
||||||
|
color: _myTravelRequestColor,
|
||||||
|
fontFamily: "Archivo"),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 25),
|
||||||
|
MouseRegion(
|
||||||
|
cursor: SystemMouseCursors.click,
|
||||||
|
onEnter: (_) {
|
||||||
|
setState(() {
|
||||||
|
_myApprovalsColor = Colors.blue; // Change color on hover
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onExit: (_) {
|
||||||
|
setState(() {
|
||||||
|
_myApprovalsColor =
|
||||||
|
Color(0xFF475569); // Revert color when hover ends
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
context.go('/ApprovalList');
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
"My Approvals",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: _myApprovalsColor,
|
||||||
|
// color: Color(0xFF475569),
|
||||||
|
fontFamily: "Archivo"),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 15),
|
||||||
|
if (userData?["role"] != "User")
|
||||||
|
Builder(
|
||||||
|
builder: (context) => PopupMenuButton<String>(
|
||||||
|
color: Colors.white,
|
||||||
|
icon: const Icon(Icons.settings, color: Colors.black87),
|
||||||
|
offset: const Offset(0, 50), // 👈 shift it 50 pixels down
|
||||||
|
onSelected: (String value) {
|
||||||
|
switch (value) {
|
||||||
|
case '/OrganizationSetup':
|
||||||
|
context.go('/OrganizationSetup');
|
||||||
|
break;
|
||||||
|
case '/listUser':
|
||||||
|
context.go('/listUser');
|
||||||
|
break;
|
||||||
|
case '/group':
|
||||||
|
context.go('/group');
|
||||||
|
break;
|
||||||
|
case '/PolicyList':
|
||||||
|
context.go('/PolicyList');
|
||||||
|
case '/CreateUserDetails':
|
||||||
|
context.go(
|
||||||
|
"/CreateUserDetails",
|
||||||
|
extra: {
|
||||||
|
"selectedUser": userDetails,
|
||||||
|
"isEditProfile": true,
|
||||||
|
"isViewMode": true
|
||||||
|
},
|
||||||
|
);
|
||||||
|
case '/logout':
|
||||||
|
context.go('/');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
itemBuilder: (BuildContext context) =>
|
||||||
|
menuItems.map(buildMenuItem).toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
bottom: PreferredSize(
|
||||||
|
preferredSize: Size.fromHeight(1),
|
||||||
|
child: Container(
|
||||||
|
height: 1,
|
||||||
|
color: Colors.grey.shade200, // Set the color of the bottom border
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Size get preferredSize => const Size.fromHeight(56); // Standard AppBar height
|
Size get preferredSize => const Size.fromHeight(kToolbarHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
final List<Map<String, dynamic>> menuItems = [
|
||||||
|
{
|
||||||
|
'value': '/OrganizationSetup',
|
||||||
|
'icon': Icons.business,
|
||||||
|
'label': 'Organization'
|
||||||
|
},
|
||||||
|
{'value': '/listUser', 'icon': Icons.manage_accounts, 'label': 'Users'},
|
||||||
|
{'value': '/group', 'icon': Icons.group, 'label': 'Group'},
|
||||||
|
{'value': '/PolicyList', 'icon': Icons.policy, 'label': 'Policy'},
|
||||||
|
{
|
||||||
|
'value': '/CreateUserDetails',
|
||||||
|
'icon': Icons.account_circle,
|
||||||
|
'label': 'My Profile'
|
||||||
|
},
|
||||||
|
{'value': '/logout', 'icon': Icons.login_outlined, 'label': 'Logout'},
|
||||||
|
];
|
||||||
|
|
||||||
|
PopupMenuItem<String> buildMenuItem(Map<String, dynamic> item) {
|
||||||
|
return PopupMenuItem<String>(
|
||||||
|
value: item['value'],
|
||||||
|
child: ListTile(
|
||||||
|
leading: Icon(item['icon'], size: 18),
|
||||||
|
title: Text(item['label'], style: const TextStyle(fontSize: 13)),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -357,18 +357,21 @@ class _CustomDrawerState extends State<CustomDrawer> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (widget.isDesktop) {
|
|
||||||
// Sidebar for Desktop (always visible)**
|
|
||||||
return Container(
|
|
||||||
width: 250, // Fixed width for sidebar
|
|
||||||
color: Colors.grey.shade50,
|
|
||||||
child: drawerContent,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
// Drawer for Mobile & Tablet**
|
|
||||||
return Drawer(
|
return Drawer(
|
||||||
child: ListView(padding: EdgeInsets.zero, children: [drawerContent]));
|
child: ListView(padding: EdgeInsets.zero, children: [drawerContent]));
|
||||||
}
|
|
||||||
|
// if (widget.isDesktop) {
|
||||||
|
// // Sidebar for Desktop (always visible)**
|
||||||
|
// return Container(
|
||||||
|
// width: 250, // Fixed width for sidebar
|
||||||
|
// color: Colors.grey.shade50,
|
||||||
|
// child: drawerContent,
|
||||||
|
// );
|
||||||
|
// } else {
|
||||||
|
// // Drawer for Mobile & Tablet**
|
||||||
|
// return Drawer(
|
||||||
|
// child: ListView(padding: EdgeInsets.zero, children: [drawerContent])) ;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// **Reusable Drawer Item**
|
/// **Reusable Drawer Item**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user