second commit

This commit is contained in:
Anbarasu
2026-05-27 10:35:09 +05:30
parent c53794c04c
commit 1435ac47b0
501 changed files with 52818 additions and 0 deletions

View File

@@ -0,0 +1,484 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:shimmer/shimmer.dart';
import '../../../../Controller/More/Locations/Staffs/Staffdetailscontroller.dart';
import '../../../../Controller/More/Staffs/Staffscontroller.dart';
import '../../../../Helper/Constants/AssetConstants.dart';
import '../../../../Helper/Constants/Colorconstants.dart';
import '../../../../Helper/utility.dart';
import '../../../Home/Homeview.dart';
class StaffsDetails extends StatelessWidget {
List staffData;
String locationName;
StaffDetailsController staffDetailsController = Get.put(StaffDetailsController());
StaffsDetails({Key? key, required this.staffData, required this.locationName,}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: ColorConstants.lightColor,
appBar: AppBar(
backgroundColor: ColorConstants.primaryColor,
elevation: 0.3,
leading: Padding(
padding: const EdgeInsets.all(5.0),
child: Image(
image: AssetImage(AssetConstants.NearleAppbarIcon),
height: 30,
),
),
title: Text('$locationName Staffs'),
titleSpacing: 0,
),
body: Stack(
children: [
Column(
children: [
SizedBox(
height: 10,
),
Expanded(
flex: 9,
child: mobileUserList(),
)
],
),
Positioned(
bottom: 5,
left: 0,
right: 0,
child: Container(
margin: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
height: 60,
// width: Get.width * 0.8,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30), color: ColorConstants.primaryColor),
child: Center(
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: InkWell(
onTap: () {
Get.to(()=>HomeView(selectedIndex: 0,));
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.home,
color: Colors.white,
),
SizedBox(
height: 3,
),
Text(
'Home',
style: TextStyle(color: Colors.white),
)
],
),
),
),
Container(
color: Colors.white,
width: 0.5,
),
Expanded(
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.arrow_back,
color: Colors.white,
),
SizedBox(
height: 3,
),
Text(
'Back',
style: TextStyle(color: Colors.white),
)
],
),
),
),
],
),
),
),
)
],
),
);
}
addUser() {
// Get.to(()=>AddUser(location: true, locationId:staffData[0]['Locationid']??[],));
}
mobileUserList() {
return GetBuilder<StaffsController>(
builder: (context) {
return Container(
margin: const EdgeInsets.only(
left: 10.0,
right: 10,
),
child:staffData.isEmpty
? Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image(
height: 160,
width: 160,
image: AssetImage(AssetConstants.NoRecords),
),
SizedBox(
height: 8,
),
Text(
"No users at this moment",
style: TextStyle(
color: Colors.grey[600], fontSize: 14),
),
],
))
: staffDetailsController.shimmer == true
? Shimmer.fromColors(
enabled: true,
child: ListView.builder(
padding: EdgeInsets.only(bottom: 60),
itemCount: 4,
itemBuilder: (BuildContext context, int index) {
return InkWell(
child: Container(
margin: EdgeInsets.only(bottom: 10),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey[400]!, width: 2),
borderRadius:
BorderRadius.all(Radius.circular(3)),
),
height: 90,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 3,
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Container(
width: 55,
height: 55,
child: CircleAvatar(
backgroundColor: ColorConstants.secondaryColor,
child: Text(
"",
style: TextStyle(
color: ColorConstants.secondaryColor,
fontSize: 22),
)),
),
],
)),
Expanded(
flex: 8,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.center,
children: [
SizedBox(
height: 4,
),
Expanded(
flex: 2,
child: Row(
children: [
Icon(
Icons.person,
color: ColorConstants.secondaryColor,
size: 20,
),
SizedBox(
width: 5,
),
Text(
"--------------",
style: TextStyle(
fontSize: 16,
color: Colors.grey[600],
fontWeight:
FontWeight.w600),
),
],
),
),
Expanded(
flex: 2,
child: Row(
children: [
Icon(
Icons.phone,
color: ColorConstants.primaryColor,
size: 20,
),
SizedBox(
width: 5,
),
Text(
'-----------',
style: TextStyle(
fontSize: 15,
color: Colors.black54,
fontWeight:
FontWeight.w400),
),
],
),
),
Expanded(
flex: 2,
child: Row(
children: [
Expanded(
// flex: 5,
child: Row(
children: [
Icon(
Icons.store,
color: ColorConstants.primaryColor,
size: 20,
),
SizedBox(
width: 3,
),
Text(
'-----------',
// '',
style: TextStyle(
fontSize: 15,
color: Colors.black54,
fontWeight:
FontWeight.w400),
),
SizedBox(
width: 5,
),
],
)),
],
),
),
SizedBox(
height: 4,
),
],
)),
Expanded(
flex: 1,
child: Center(
child: Icon(
Icons.arrow_forward_ios,
color: Colors.grey[600],
size: 16,
),
),
)
],
),
),
);
}),
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
)
: ListView.builder(
padding: EdgeInsets.only(bottom: 80),
itemCount: staffData.length,
itemBuilder: (BuildContext context, int index) {
return Padding(
padding: const EdgeInsets.only(top: 12),
child: Stack(
children: [
Container(
decoration: BoxDecoration(
color: ColorConstants.secondaryColor,
boxShadow: [BoxShadow(color: Colors.grey)],
borderRadius:
BorderRadius.all(Radius.circular(3)),
),
height: 130,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 3,
child: Container(
padding: EdgeInsets.all(5),
decoration: BoxDecoration(
color: UtilityPromotion.getLightColors(
'${ staffData[index]['Firstname']==null||staffData[index]['Firstname'].toString().isEmpty?'':staffData[index]['Firstname'].toString()[0]}'
.toString())
.withAlpha(100),
// staffData[index]['Firstname'][0].toString()),
shape: BoxShape.rectangle,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Container(
// width: 55,
// height: 60,
child: CircleAvatar(
backgroundColor: Colors.white70,
radius: 28,
child: Text(
"${ staffData[index]['Firstname']==null||staffData[index]['Firstname'].toString().isEmpty?'':staffData[index]['Firstname'].toString()[0].toUpperCase()}",
style: TextStyle(
color: Colors.black54,
fontSize: 22),
)),
),
SizedBox(
height: 12,
),
Text(
locationName
.toString()
.length >
9
?locationName
.toString()
.substring(0, 9) +
'...'
: locationName
.toString(),
overflow: TextOverflow.ellipsis,
// '',
style: TextStyle(
fontSize: 13,
color: Colors.black54,
fontWeight: FontWeight.w600),
),
],
),
)),
SizedBox(
width: 10,
),
Expanded(
flex: 8,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: [
// SizedBox(
// height: 4,
// ),
Row(
children: [
Icon(
Icons.person,
color: ColorConstants.primaryColor,
size: 20,
),
SizedBox(
width: 5,
),
Row(
children: [
Text(
"${staffData[index]['Firstname'] == null ? "" : staffData[index]['Firstname']} ${staffData[index]['Lastname'] == null ? "" : staffData[index]['Lastname']}",
style: TextStyle(
fontSize: 16,
color: Colors.grey[600],
fontWeight: FontWeight.w600),
),
SizedBox(width: 10,),
staffData[index]['Roleid']==1?Icon(Icons.admin_panel_settings_outlined,color: ColorConstants.primaryColor,size:20,):staffData[index]['Roleid']==2?Icon(Icons.phone_android,color: ColorConstants.primaryColor,size:20,):
Icon(Icons.laptop_windows,color: ColorConstants.primaryColor,size:20,)
],
),
],
),
Row(
children: [
Icon(
Icons.phone,
color: ColorConstants.primaryColor,
size: 20,
),
SizedBox(
width: 5,
),
Text(
'91 ${staffData[index]['Contact']}',
style: TextStyle(
fontSize: 15,
color: Colors.black54,
fontWeight: FontWeight.w400),
),
],
),
Row(
children: [
Icon(
Icons.mail,
color: ColorConstants.primaryColor,
size: 20,
),
SizedBox(
width: 5,
),
Text(
'${staffData[index]['Email']}',
style: TextStyle(
fontSize: 16,
color: Colors.black54,
fontWeight: FontWeight.w400),
),
],
),
],
),
),
],
),
),
],
),
);
}),
);
}
);
}
}