Commit 2a8fa440 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

AttendanceScreen and hrm color and responsive

parents 96031396 9e243e0c
...@@ -42,8 +42,8 @@ android { ...@@ -42,8 +42,8 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "in.webgrid.generp" applicationId = "in.webgrid.generp"
minSdk = flutter.minSdkVersion minSdk = 23
targetSdk = flutter.targetSdkVersion targetSdk = 36
versionCode = flutter.versionCode versionCode = flutter.versionCode
versionName = flutter.versionName versionName = flutter.versionName
} }
......
...@@ -949,6 +949,11 @@ class Addnewleadsandprospectsprovider extends ChangeNotifier { ...@@ -949,6 +949,11 @@ class Addnewleadsandprospectsprovider extends ChangeNotifier {
nameError = "Please Enter Name"; nameError = "Please Enter Name";
isValid = false; isValid = false;
} }
if(nameError == "Name already exists"){
isValid = false;
}
if (customerMailIdController.text.trim().isNotEmpty && if (customerMailIdController.text.trim().isNotEmpty &&
!RegExp(r'\S+@\S+\.\S+').hasMatch(customerMailIdController.text)) { !RegExp(r'\S+@\S+\.\S+').hasMatch(customerMailIdController.text)) {
mailIdError = "Please enter a proper Email ID"; mailIdError = "Please enter a proper Email ID";
...@@ -963,6 +968,9 @@ class Addnewleadsandprospectsprovider extends ChangeNotifier { ...@@ -963,6 +968,9 @@ class Addnewleadsandprospectsprovider extends ChangeNotifier {
isValid = false; isValid = false;
} }
} }
if ( mobileError == "Mobile number already exists"){
isValid = false;
}
// if(designationController.text.trim().isEmpty){ // if(designationController.text.trim().isEmpty){
// designationError = "Please enter Designation"; // designationError = "Please enter Designation";
...@@ -973,6 +981,11 @@ class Addnewleadsandprospectsprovider extends ChangeNotifier { ...@@ -973,6 +981,11 @@ class Addnewleadsandprospectsprovider extends ChangeNotifier {
return isValid; return isValid;
} }
bool validateStep2() { bool validateStep2() {
bool isValid = true; bool isValid = true;
if (alternateMobileController.text.trim().isNotEmpty && if (alternateMobileController.text.trim().isNotEmpty &&
......
This diff is collapsed.
...@@ -1440,7 +1440,6 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1440,7 +1440,6 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
null, null,
TextInputAction.done, TextInputAction.done,
), ),
errorWidget(context, provider.addressError), errorWidget(context, provider.addressError),
], ],
), ),
...@@ -1620,4 +1619,33 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> { ...@@ -1620,4 +1619,33 @@ class _AddleadsprospectsscreenState extends State<Addleadsprospectsscreen> {
}, },
); );
} }
void showCustomSnackBar(BuildContext context, String message) {
final snackBar = SnackBar(
behavior: SnackBarBehavior.floating,
backgroundColor: Colors.black87,
elevation: 6,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
content: Row(
children: [
Icon(Icons.info_outline, color: Colors.white),
SizedBox(width: 12),
Expanded(
child: Text(
message,
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
],
),
duration: Duration(seconds: 3),
);
ScaffoldMessenger.of(context).showSnackBar(snackBar);
}
} }
...@@ -30,6 +30,38 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -30,6 +30,38 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
"Casual Leave List" "Casual Leave List"
]; ];
// Responsive text size function
double getResponsiveTextSize(BuildContext context, double baseSize) {
final double scale = MediaQuery.of(context).textScaleFactor;
final double width = MediaQuery.of(context).size.width;
if (width < 360) { // Small phones
return baseSize * 0.85;
} else if (width < 400) { // Medium phones
return baseSize;
} else { // Large phones
return baseSize * 1.1;
}
}
// Responsive padding function
double getResponsivePadding(BuildContext context) {
final double width = MediaQuery.of(context).size.width;
return width * 0.04; // 4% of screen width
}
// Responsive height function
double getResponsiveHeight(BuildContext context, double baseHeight) {
final double height = MediaQuery.of(context).size.height;
if (height < 700) { // Small height devices
return baseHeight * 0.85;
} else if (height < 800) { // Medium height devices
return baseHeight;
} else { // Large height devices
return baseHeight * 1.15;
}
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
...@@ -43,6 +75,9 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -43,6 +75,9 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final bool isSmallScreen = MediaQuery.of(context).size.width < 360;
final bool isLargeScreen = MediaQuery.of(context).size.width > 400;
return SafeArea( return SafeArea(
top: false, top: false,
child: Scaffold( child: Scaffold(
...@@ -55,14 +90,14 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -55,14 +90,14 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
onTap: () => Navigator.pop(context, true), onTap: () => Navigator.pop(context, true),
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/svg/appbar_back_button.svg", "assets/svg/appbar_back_button.svg",
height: 25, height: isSmallScreen ? 22 : 25,
), ),
), ),
const SizedBox(width: 10), SizedBox(width: isSmallScreen ? 8 : 10),
Text( Text(
"HRM", "HRM",
style: TextStyle( style: TextStyle(
fontSize: 18, fontSize: getResponsiveTextSize(context, 18),
fontFamily: "Plus Jakarta Sans", fontFamily: "Plus Jakarta Sans",
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: AppColors.semi_black, color: AppColors.semi_black,
...@@ -80,13 +115,16 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -80,13 +115,16 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
children: [ children: [
Container( Container(
width: double.infinity, width: double.infinity,
height: 490, height: getResponsiveHeight(context, 490),
color: const Color(0xffF6F6F8), color: const Color(0xffF6F6F8),
), ),
Container( Container(
width: double.infinity, width: double.infinity,
height: 490, height: getResponsiveHeight(context, 490),
padding: const EdgeInsets.only(top: 1, bottom: 30), padding: EdgeInsets.only(
top: 1,
bottom: getResponsiveHeight(context, 30)
),
decoration: const BoxDecoration( decoration: const BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(
colors: [ colors: [
...@@ -101,10 +139,13 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -101,10 +139,13 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
), ),
Container( Container(
width: double.infinity, width: double.infinity,
padding: const EdgeInsets.only(top: 1, bottom: 30), padding: EdgeInsets.only(
top: 1,
bottom: getResponsiveHeight(context, 30)
),
child: Image.asset( child: Image.asset(
"assets/images/vector.png", "assets/images/vector.png",
height: 230, height: getResponsiveHeight(context, 230),
width: double.infinity, width: double.infinity,
fit: BoxFit.fitWidth, fit: BoxFit.fitWidth,
), ),
...@@ -116,26 +157,27 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -116,26 +157,27 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
/// Top Illustration & Button /// Top Illustration & Button
Container( Container(
width: double.infinity, width: double.infinity,
padding: const EdgeInsets.only(top: 60, bottom: 30), padding: EdgeInsets.only(
top: getResponsiveHeight(context, 60),
bottom: getResponsiveHeight(context, 30)
),
child: Column( child: Column(
children: [ children: [
SvgPicture.asset( SvgPicture.asset(
"assets/images/capa.svg", "assets/images/capa.svg",
height: 146, height: getResponsiveHeight(context, 146),
width: 400, width: MediaQuery.of(context).size.width * 0.9,
), ),
const SizedBox(height: 32), SizedBox(height: getResponsiveHeight(context, 32)),
Container( Container(
padding: const EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 20, horizontal: isSmallScreen ? 16 : 20,
vertical: 8, vertical: isSmallScreen ? 6 : 8,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: const Color( color: const Color(0xFF1487C9),
0xFF1487C9, width: 1.2,
), // border color
width: 1.2, // thickness of the border
), ),
color: const Color(0xffEDF8FF), color: const Color(0xffEDF8FF),
borderRadius: BorderRadius.circular(30), borderRadius: BorderRadius.circular(30),
...@@ -154,23 +196,28 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -154,23 +196,28 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
children: [ children: [
SvgPicture.asset( SvgPicture.asset(
"assets/svg/hrm/groupIc.svg", "assets/svg/hrm/groupIc.svg",
height: 29, height: isSmallScreen ? 25 : 29,
width: 29, width: isSmallScreen ? 25 : 29,
fit: BoxFit.contain, fit: BoxFit.contain,
), ),
const SizedBox(width: 7), SizedBox(width: isSmallScreen ? 5 : 7),
const Text( Flexible(
child: Text(
"Organization Structure", "Organization Structure",
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: getResponsiveTextSize(context, 15),
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
fontStyle: FontStyle.normal, fontStyle: FontStyle.normal,
fontFamily: "Plus Jakarta Sans", fontFamily: "Plus Jakarta Sans",
), ),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
), ),
const Icon( Icon(
Icons.chevron_right, Icons.chevron_right,
color: Colors.black54, color: Colors.black54,
size: isSmallScreen ? 18 : 20,
), ),
], ],
), ),
...@@ -183,9 +230,13 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -183,9 +230,13 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
/// Grid Section /// Grid Section
LayoutBuilder( LayoutBuilder(
builder: (context, constraints) { builder: (context, constraints) {
final screenWidth = constraints.maxWidth;
final crossAxisCount = (screenWidth / 180).floor().clamp(2, 4);
final childAspectRatio = screenWidth < 360 ? 1.5 : 1.7;
return Padding( return Padding(
padding: const EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 8, horizontal: getResponsivePadding(context),
vertical: 10, vertical: 10,
), ),
child: Consumer<HrmAccessiblePagesProvider>( child: Consumer<HrmAccessiblePagesProvider>(
...@@ -197,7 +248,12 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -197,7 +248,12 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
} }
if (provider.errorMessage != null) { if (provider.errorMessage != null) {
return Center( return Center(
child: Text(provider.errorMessage!), child: Text(
provider.errorMessage!,
style: TextStyle(
fontSize: getResponsiveTextSize(context, 14),
),
),
); );
} }
...@@ -207,8 +263,7 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -207,8 +263,7 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
(page) => allowedPages.contains( (page) => allowedPages.contains(
page.pageName, page.pageName,
), ),
) ).toList();
.toList();
return GridView.builder( return GridView.builder(
itemCount: pages.length, itemCount: pages.length,
...@@ -216,19 +271,17 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -216,19 +271,17 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
gridDelegate: gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount( SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: (constraints.maxWidth / crossAxisCount: crossAxisCount,
180) crossAxisSpacing: isSmallScreen ? 2 : 4,
.floor() mainAxisSpacing: isSmallScreen ? 2 : 4,
.clamp(2, 6), childAspectRatio: childAspectRatio,
crossAxisSpacing: 1,
mainAxisSpacing: 2,
childAspectRatio: 1.8,
), ),
itemBuilder: (context, index) { itemBuilder: (context, index) {
final page = pages[index]; final page = pages[index];
return _buildTile( return _buildTile(
label: page.pageName ?? "",//in page number there is 6 items comming from serever it showing only four context: context,
label: page.pageName ?? "",
subtitle: _getSubtitle( subtitle: _getSubtitle(
page.pageName ?? "", page.pageName ?? "",
), ),
...@@ -249,10 +302,7 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -249,10 +302,7 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
}, },
), ),
//////////// SizedBox(height: getResponsiveHeight(context, 40)),
SizedBox(height: 40,)
], ],
), ),
], ],
...@@ -266,12 +316,15 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -266,12 +316,15 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
/// Card builder /// Card builder
Widget _buildTile({ Widget _buildTile({
required BuildContext context,
required String label, required String label,
required String subtitle, required String subtitle,
required String assetIcon, required String assetIcon,
required Color txtColor, required Color txtColor,
VoidCallback? onTap, VoidCallback? onTap,
}) { }) {
final bool isSmallScreen = MediaQuery.of(context).size.width < 360;
return LayoutBuilder( return LayoutBuilder(
builder: (context, constraints) { builder: (context, constraints) {
return InkWell( return InkWell(
...@@ -279,18 +332,28 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -279,18 +332,28 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: constraints.maxHeight * 0.05, vertical: constraints.maxHeight * 0.08,
horizontal: constraints.maxWidth * 0.05, horizontal: constraints.maxWidth * 0.06,
),
margin: EdgeInsets.symmetric(
vertical: isSmallScreen ? 4 : 7,
horizontal: isSmallScreen ? 3 : 5
), ),
margin: const EdgeInsets.symmetric(vertical: 7, horizontal: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
// boxShadow: [
// BoxShadow(
// color: Colors.black12,
// blurRadius: 4,
// offset: Offset(0, 2),
// ),
// ],
), ),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
flex: 2, flex: 3,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
...@@ -299,25 +362,29 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -299,25 +362,29 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
child: Text( child: Text(
label, label,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: getResponsiveTextSize(context, 14),
color: AppColors.app_blue, color: AppColors.app_blue,
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
height: 1.2,
), ),
softWrap: true, softWrap: true,
overflow: TextOverflow.visible, overflow: TextOverflow.ellipsis,
maxLines: isSmallScreen ? 2 : 3,
), ),
), ),
const SizedBox(height: 4), SizedBox(height: isSmallScreen ? 2 : 6),
Flexible( Flexible(
child: Text( child: Text(
subtitle, subtitle,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: getResponsiveTextSize(context, 12),
color: AppColors.grey_semi, color: AppColors.grey_semi,
fontFamily: "JakartaMedium", fontFamily: "JakartaMedium",
height: 1,
), ),
softWrap: true, softWrap: true,
overflow: TextOverflow.visible, overflow: TextOverflow.ellipsis,
maxLines: 2,
), ),
), ),
], ],
...@@ -326,8 +393,8 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -326,8 +393,8 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
height: constraints.maxHeight * 0.39, height: constraints.maxHeight * 0.45,
width: constraints.maxHeight * 0.39, width: constraints.maxHeight * 0.45,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, shape: BoxShape.circle,
color: const Color(0xFFEDF8FF), color: const Color(0xFFEDF8FF),
...@@ -335,8 +402,8 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -335,8 +402,8 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
child: Center( child: Center(
child: SvgPicture.asset( child: SvgPicture.asset(
assetIcon, assetIcon,
height: constraints.maxHeight * 0.19, height: constraints.maxHeight * 0.22,
width: constraints.maxHeight * 0.19, width: constraints.maxHeight * 0.22,
), ),
), ),
), ),
...@@ -361,9 +428,9 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> { ...@@ -361,9 +428,9 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
case "Tour Bill List": case "Tour Bill List":
return "Submit and manage claims"; return "Submit and manage claims";
case "Team Leave Request Approval": case "Team Leave Request Approval":
return ""; return "Approve & Reject";
case "Team Attendance Approval": case "Team Attendance Approval":
return ""; return "Team Attendance Request";
case "Advance List": case "Advance List":
return "Advance Payment"; return "Advance Payment";
case "Casual Leave List": case "Casual Leave List":
......
This diff is collapsed.
...@@ -445,10 +445,10 @@ packages: ...@@ -445,10 +445,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.3" version: "1.3.2"
ffi: ffi:
dependency: transitive dependency: transitive
description: description:
...@@ -1180,26 +1180,26 @@ packages: ...@@ -1180,26 +1180,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker name: leak_tracker
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "11.0.2" version: "10.0.8"
leak_tracker_flutter_testing: leak_tracker_flutter_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_flutter_testing name: leak_tracker_flutter_testing
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.10" version: "3.0.9"
leak_tracker_testing: leak_tracker_testing:
dependency: transitive dependency: transitive
description: description:
name: leak_tracker_testing name: leak_tracker_testing
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.2" version: "3.0.1"
lints: lints:
dependency: transitive dependency: transitive
description: description:
...@@ -1873,10 +1873,10 @@ packages: ...@@ -1873,10 +1873,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.6" version: "0.7.4"
timezone: timezone:
dependency: transitive dependency: transitive
description: description:
...@@ -2017,10 +2017,10 @@ packages: ...@@ -2017,10 +2017,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.2.0" version: "2.1.4"
vm_service: vm_service:
dependency: transitive dependency: transitive
description: description:
...@@ -2118,5 +2118,5 @@ packages: ...@@ -2118,5 +2118,5 @@ packages:
source: hosted source: hosted
version: "3.1.3" version: "3.1.3"
sdks: sdks:
dart: ">=3.8.0-0 <3.10.0-z" dart: ">=3.7.2 <3.10.0-z"
flutter: ">=3.27.0" flutter: ">=3.27.0"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment