diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index ba920a8..a0625e6 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -45,6 +45,8 @@ "msg": "Hello {} in the {} world ", "msg_named": "{} are written in the {lang} language", "clickMe": "Click me", + "human": "Human", + "resources": "Resources", "profile": { "reset_password": { "label": "Reset Password", diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index ba920a8..a0625e6 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -45,6 +45,8 @@ "msg": "Hello {} in the {} world ", "msg_named": "{} are written in the {lang} language", "clickMe": "Click me", + "human": "Human", + "resources": "Resources", "profile": { "reset_password": { "label": "Reset Password", diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 6a06610..7ca764b 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 6BB994F47479089301AC9232 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6CBD2B2B1A504A0E0BA52E83 /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; @@ -31,7 +32,11 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3085328F552329DC897B71DD /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 3A5ABA8306DCFDB9E71D453A /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 3B4D9CAD3B112CCF7FEE1F91 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 6CBD2B2B1A504A0E0BA52E83 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -49,12 +54,32 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 6BB994F47479089301AC9232 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 6BD33033650F08D3E79761E4 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6CBD2B2B1A504A0E0BA52E83 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 969F82F1FCE09135D9CB4C64 /* Pods */ = { + isa = PBXGroup; + children = ( + 3085328F552329DC897B71DD /* Pods-Runner.debug.xcconfig */, + 3B4D9CAD3B112CCF7FEE1F91 /* Pods-Runner.release.xcconfig */, + 3A5ABA8306DCFDB9E71D453A /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +97,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 969F82F1FCE09135D9CB4C64 /* Pods */, + 6BD33033650F08D3E79761E4 /* Frameworks */, ); sourceTree = ""; }; @@ -105,12 +132,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 7D19CFF3DFB977EA83F4C733 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + AAF25E5FC427CABFCDCC628C /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -183,6 +212,28 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 7D19CFF3DFB977EA83F4C733 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -197,6 +248,23 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; + AAF25E5FC427CABFCDCC628C /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/lib/classes/colors.dart b/lib/classes/colors.dart index e8b8b2a..7bca72b 100644 --- a/lib/classes/colors.dart +++ b/lib/classes/colors.dart @@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart'; class MyColors { static const Color darkIconColor = Color(0xff28323A); static const Color darkTextColor = Color(0xff2B353E); + static const Color lightTextColor = Color(0xffBFBFBF); static const Color gradiantStartColor = Color(0xff33c0a5); static const Color gradiantEndColor = Color(0xff259db7 ); static const Color textMixColor = Color(0xff2BB8A6); @@ -15,4 +16,6 @@ class MyColors { static const Color darkWhiteColor = Color(0xffE0E0E0); static const Color redColor = Color(0xffD02127); static const Color yellowColor = Color(0xffF4E31C); + static const Color black = Color(0xff000000); + static const Color white = Color(0xffffffff); } diff --git a/lib/config/routes.dart b/lib/config/routes.dart index d60f2b8..c204655 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:mohem_flutter_app/ui/dashboard.dart'; import 'package:mohem_flutter_app/ui/login/login_screen.dart'; import 'package:mohem_flutter_app/ui/login/verify_login_screen.dart'; +import 'package:mohem_flutter_app/ui/work_list/work_list_screen.dart'; class AppRoutes { static const String splash = "/splash"; @@ -14,9 +15,15 @@ class AppRoutes { static const String dashboard = "/dashboard"; static const String initialRoute = login; + //Work List + static const String workList = "/workList"; + static final Map routes = { login: (context) => LoginScreen(), verifyLogin: (context) => VerifyLoginScreen(), dashboard: (context) => Dashboard(), + + //Work List + workList: (context) => WorkListScreen(), }; } diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index d77bbff..21e370a 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -7,10 +7,16 @@ extension EmailValidator on String { Widget toText10({Color? color, bool isBold = false}) => Text( this, - style: TextStyle(fontSize: 10, fontWeight: isBold ? FontWeight.bold : FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.4), + style: TextStyle( + fontSize: 10, + fontWeight: isBold ? FontWeight.bold : FontWeight.w600, + color: color ?? MyColors.darkTextColor, + letterSpacing: -0.4), ); - Widget toText11({Color? color, bool isUnderLine = false, bool isBold = false}) => Text( + Widget toText11( + {Color? color, bool isUnderLine = false, bool isBold = false}) => + Text( this, style: TextStyle( fontSize: 11, @@ -20,7 +26,13 @@ extension EmailValidator on String { decoration: isUnderLine ? TextDecoration.underline : null), ); - Widget toText12({Color? color, bool isUnderLine = false, bool isBold = false, bool isCenter = false, int maxLine = 0}) => Text( + Widget toText12( + {Color? color, + bool isUnderLine = false, + bool isBold = false, + bool isCenter = false, + int maxLine = 0}) => + Text( this, textAlign: isCenter ? TextAlign.center : null, maxLines: (maxLine > 0) ? maxLine : null, @@ -34,26 +46,46 @@ extension EmailValidator on String { Widget toText13({Color? color, bool isUnderLine = false}) => Text( this, - style: TextStyle(fontSize: 13, fontWeight: FontWeight.w600, color: color ?? MyColors.darkTextColor, letterSpacing: -0.52, decoration: isUnderLine ? TextDecoration.underline : null), + style: TextStyle( + fontSize: 13, + fontWeight: FontWeight.w600, + color: color ?? MyColors.darkTextColor, + letterSpacing: -0.52, + decoration: isUnderLine ? TextDecoration.underline : null), ); Widget toText14({Color? color, bool isBold = false}) => Text( this, - style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 14, letterSpacing: -0.48, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), + style: TextStyle( + color: color ?? MyColors.darkTextColor, + fontSize: 14, + letterSpacing: -0.48, + fontWeight: isBold ? FontWeight.bold : FontWeight.w600), ); Widget toText16({Color? color, bool isBold = false}) => Text( this, - style: TextStyle(color: color ?? MyColors.darkTextColor, fontSize: 16, letterSpacing: -0.64, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), + style: TextStyle( + color: color ?? MyColors.darkTextColor, + fontSize: 16, + letterSpacing: -0.64, + fontWeight: isBold ? FontWeight.bold : FontWeight.w600), ); - Widget toText24({bool isBold = false}) => Text( + Widget toText24({bool isBold = false, Color? textColor}) => Text( this, - style: TextStyle(height: 23 / 24, color: MyColors.darkTextColor, fontSize: 24, letterSpacing: -1.44, fontWeight: isBold ? FontWeight.bold : FontWeight.w600), + style: TextStyle( + height: 23 / 24, + color: textColor ?? MyColors.darkTextColor, + fontSize: 24, + letterSpacing: -1.44, + fontWeight: isBold ? FontWeight.bold : FontWeight.w600), ); bool isValidEmail() { - return RegExp(r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$').hasMatch(this); + return RegExp( + r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$') + .hasMatch(this); } String toFormattedDate() { diff --git a/lib/generated/codegen_loader.g.dart b/lib/generated/codegen_loader.g.dart index 0991c28..a471169 100644 --- a/lib/generated/codegen_loader.g.dart +++ b/lib/generated/codegen_loader.g.dart @@ -51,6 +51,7 @@ class CodegenLoader extends AssetLoader{ "viewAllOffers": "View All Offers", "offers": "Offers & ", "discounts": "Discounts", + "newString": "New", "title": "Title", "home": "Home", "mySalary": "My Salary", @@ -130,6 +131,7 @@ static const Map en_US = { "viewAllOffers": "View All Offers", "offers": "Offers & ", "discounts": "Discounts", + "newString": "New", "title": "Title", "home": "Home", "mySalary": "My Salary", diff --git a/lib/ui/app_bar.dart b/lib/ui/app_bar.dart new file mode 100644 index 0000000..0823a5a --- /dev/null +++ b/lib/ui/app_bar.dart @@ -0,0 +1,25 @@ +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; + +AppBar appBar(BuildContext context, {required String title}) { + return AppBar( + title: title.toText24(textColor: MyColors.darkTextColor), + centerTitle: false, + automaticallyImplyLeading: false, + backgroundColor: Colors.white, + actions: [ + IconButton( + onPressed: () { + Navigator.pop(context); + }, + icon: Icon( + Icons.close, + color: MyColors.darkIconColor, + ), + ), + ], + ); +} diff --git a/lib/ui/dashboard.dart b/lib/ui/dashboard.dart index 2c9cf50..91a6e4f 100644 --- a/lib/ui/dashboard.dart +++ b/lib/ui/dashboard.dart @@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; @@ -31,14 +32,34 @@ class _DashboardState extends State { @override Widget build(BuildContext context) { - List names = [LocaleKeys.workList.tr(), LocaleKeys.missingSwipes.tr(), LocaleKeys.leaveBalance.tr(), LocaleKeys.ticketBalance.tr()]; + List names = [ + LocaleKeys.workList.tr(), + LocaleKeys.missingSwipes.tr(), + LocaleKeys.leaveBalance.tr(), + LocaleKeys.ticketBalance.tr() + ]; List namesInt = [118, 02, 18.5, 03]; List namesColor = [0xff125765, 0xff239D8F, 0xff2BB8A8, 0xff1D92AA]; - List namesT = [LocaleKeys.monthlyAttendance.tr(), LocaleKeys.workFromHome.tr(), LocaleKeys.ticketRequest.tr(), LocaleKeys.monthlyAttendance.tr()]; - List iconT = ["assets/images/monthly_attendance.svg", "assets/images/work_from_home.svg", "assets/images/ticket_request.svg", "assets/images/work_from_home.svg"]; + List namesT = [ + LocaleKeys.monthlyAttendance.tr(), + LocaleKeys.workFromHome.tr(), + LocaleKeys.ticketRequest.tr(), + LocaleKeys.monthlyAttendance.tr() + ]; + List iconT = [ + "assets/images/monthly_attendance.svg", + "assets/images/work_from_home.svg", + "assets/images/ticket_request.svg", + "assets/images/work_from_home.svg" + ]; - List namesD = ["Nostalgia Perfume Perfume", "Al Nafoura", "AlJadi", "Nostalgia Perfume"]; + List namesD = [ + "Nostalgia Perfume Perfume", + "Al Nafoura", + "AlJadi", + "Nostalgia Perfume" + ]; return Scaffold( body: Column( @@ -51,7 +72,8 @@ class _DashboardState extends State { CircularAvatar( width: 34, height: 34, - url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png", + url: + "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png", ), 8.width, SvgPicture.asset("assets/images/side_nav.svg"), @@ -81,7 +103,9 @@ class _DashboardState extends State { top: 0, child: Container( padding: const EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration(color: MyColors.redColor, borderRadius: BorderRadius.circular(17)), + decoration: BoxDecoration( + color: MyColors.redColor, + borderRadius: BorderRadius.circular(17)), child: "3".toText12(color: Colors.white), ), ) @@ -97,7 +121,9 @@ class _DashboardState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - LocaleKeys.goodMorning.tr().toText14(color: MyColors.grey77Color), + LocaleKeys.goodMorning + .tr() + .toText14(color: MyColors.grey77Color), "Mahmoud Shrouf".toText24(isBold: true), 16.height, Row( @@ -108,27 +134,41 @@ class _DashboardState extends State { child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), - gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomRight, colors: [ - MyColors.gradiantEndColor, - MyColors.gradiantStartColor, - ]), + gradient: const LinearGradient( + transform: GradientRotation(.46), + begin: Alignment.topRight, + end: Alignment.bottomRight, + colors: [ + MyColors.gradiantEndColor, + MyColors.gradiantStartColor, + ]), ), child: Stack( alignment: Alignment.center, children: [ SvgPicture.asset("assets/images/"), Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Expanded( child: Column( mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true), + LocaleKeys.markAttendance + .tr() + .toText14( + color: Colors.white, + isBold: true), 9.height, - "07:55:12".toText14(color: Colors.white, isBold: true), - LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white), + "07:55:12".toText14( + color: Colors.white, + isBold: true), + LocaleKeys.timeLeftToday + .tr() + .toText12(color: Colors.white), 9.height, const ClipRRect( borderRadius: BorderRadius.all( @@ -137,33 +177,50 @@ class _DashboardState extends State { child: LinearProgressIndicator( value: 0.7, minHeight: 8, - valueColor: const AlwaysStoppedAnimation(Colors.white), - backgroundColor: const Color(0xff196D73), + valueColor: + const AlwaysStoppedAnimation< + Color>(Colors.white), + backgroundColor: + const Color(0xff196D73), ), ), ], - ).paddingOnly(top: 12, right: 15, left: 12), + ).paddingOnly( + top: 12, right: 15, left: 12), ), Row( children: [ Expanded( child: Column( mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [LocaleKeys.checkIn.tr().toText12(color: Colors.white), "09:00".toText14(color: Colors.white, isBold: true), 4.height], + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + LocaleKeys.checkIn + .tr() + .toText12( + color: Colors.white), + "09:00".toText14( + color: Colors.white, + isBold: true), + 4.height + ], ).paddingOnly(left: 12), ), Container( width: 45, height: 45, - padding: const EdgeInsets.only(left: 14, right: 14), + padding: const EdgeInsets.only( + left: 14, right: 14), decoration: const BoxDecoration( color: Color(0xff259EA4), borderRadius: BorderRadius.only( - bottomRight: Radius.circular(15), + bottomRight: + Radius.circular(15), ), ), - child: SvgPicture.asset("assets/images/stop.svg"), + child: SvgPicture.asset( + "assets/images/stop.svg"), ), ], ), @@ -180,7 +237,12 @@ class _DashboardState extends State { shrinkWrap: true, primary: false, physics: const NeverScrollableScrollPhysics(), - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 2 / 2, crossAxisSpacing: 9, mainAxisSpacing: 9), + gridDelegate: + const SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + childAspectRatio: 2 / 2, + crossAxisSpacing: 9, + mainAxisSpacing: 9), padding: EdgeInsets.zero, itemCount: 4, itemBuilder: (BuildContext context, int index) { @@ -190,21 +252,32 @@ class _DashboardState extends State { borderRadius: BorderRadius.circular(10), ), child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ names[index].toText12(color: Colors.white), Row( children: [ Expanded( - child: namesInt[index].toStringAsFixed(1).toText16(color: Colors.white, isBold: true), + child: namesInt[index] + .toStringAsFixed(1) + .toText16( + color: Colors.white, + isBold: true), ), - SvgPicture.asset("assets/images/arrow_next.svg", color: Colors.white) + SvgPicture.asset( + "assets/images/arrow_next.svg", + color: Colors.white) ], ) ], - ).paddingOnly(left: 10, right: 10, bottom: 6, top: 6), - ); + ).paddingOnly( + left: 10, right: 10, bottom: 6, top: 6), + ).onPress(() { + Navigator.pushNamed( + context, AppRoutes.workList); + }); }, ), ), @@ -219,12 +292,14 @@ class _DashboardState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - LocaleKeys.other.tr().toText12(), + "Other".toText12(), LocaleKeys.services.tr().toText24(isBold: true), ], ), ), - LocaleKeys.viewAllServices.tr().toText12(isUnderLine: true), + LocaleKeys.viewAllServices + .tr() + .toText12(isUnderLine: true), ], ), ], @@ -234,7 +309,8 @@ class _DashboardState extends State { child: ListView.separated( shrinkWrap: true, physics: const BouncingScrollPhysics(), - padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13), + padding: const EdgeInsets.only( + left: 21, right: 21, top: 13, bottom: 13), scrollDirection: Axis.horizontal, itemBuilder: (cxt, index) { return AspectRatio( @@ -245,7 +321,8 @@ class _DashboardState extends State { borderRadius: BorderRadius.circular(15), boxShadow: [ BoxShadow( - color: const Color(0xff000000).withOpacity(.05), + color: + const Color(0xff000000).withOpacity(.05), blurRadius: 26, offset: const Offset(0, -3), ), @@ -260,13 +337,17 @@ class _DashboardState extends State { crossAxisAlignment: CrossAxisAlignment.end, children: [ Expanded( - child: namesT[index].toText11(isBold: true), + child: + namesT[index].toText11(isBold: true), ), - SvgPicture.asset("assets/images/arrow_next.svg").paddingOnly(bottom: 4) + SvgPicture.asset( + "assets/images/arrow_next.svg") + .paddingOnly(bottom: 4) ], ) ], - ).paddingOnly(left: 10, right: 10, bottom: 10, top: 12), + ).paddingOnly( + left: 10, right: 10, bottom: 10, top: 12), ), ); }, @@ -279,8 +360,11 @@ class _DashboardState extends State { padding: EdgeInsets.only(top: 31), decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.only(topRight: Radius.circular(50), topLeft: Radius.circular(50)), - border: Border.all(color: MyColors.lightGreyEDColor, width: 1), + borderRadius: BorderRadius.only( + topRight: Radius.circular(50), + topLeft: Radius.circular(50)), + border: + Border.all(color: MyColors.lightGreyEDColor, width: 1), ), child: Column( mainAxisSize: MainAxisSize.min, @@ -296,21 +380,29 @@ class _DashboardState extends State { LocaleKeys.offers.tr().toText12(), Row( children: [ - LocaleKeys.discounts.tr().toText24(isBold: true), + LocaleKeys.discounts + .tr() + .toText24(isBold: true), 6.width, Container( - padding: const EdgeInsets.only(left: 8, right: 8), + padding: const EdgeInsets.only( + left: 8, right: 8), decoration: BoxDecoration( color: MyColors.yellowColor, - borderRadius: BorderRadius.circular(10), + borderRadius: + BorderRadius.circular(10), ), - child: LocaleKeys.newString.tr().toText10(isBold: true)), + child: LocaleKeys.newString + .tr() + .toText10(isBold: true)), ], ), ], ), ), - LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true), + LocaleKeys.viewAllOffers + .tr() + .toText12(isUnderLine: true), ], ).paddingOnly(left: 21, right: 21), SizedBox( @@ -318,7 +410,8 @@ class _DashboardState extends State { child: ListView.separated( shrinkWrap: true, physics: const BouncingScrollPhysics(), - padding: const EdgeInsets.only(left: 21, right: 21, top: 13), + padding: const EdgeInsets.only( + left: 21, right: 21, top: 13), scrollDirection: Axis.horizontal, itemBuilder: (cxt, index) { return SizedBox( @@ -333,7 +426,9 @@ class _DashboardState extends State { borderRadius: const BorderRadius.all( Radius.circular(100), ), - border: Border.all(color: MyColors.lightGreyEDColor, width: 1), + border: Border.all( + color: MyColors.lightGreyEDColor, + width: 1), ), child: ClipRRect( borderRadius: const BorderRadius.all( @@ -346,7 +441,9 @@ class _DashboardState extends State { ), ), 4.height, - Expanded(child: namesD[6 % (index + 1)].toText12(isCenter: true,maxLine: 2)), + Expanded( + child: namesD[6 % (index + 1)].toText12( + isCenter: true, maxLine: 2)), ], ), ); diff --git a/lib/ui/work_list/work_list_screen.dart b/lib/ui/work_list/work_list_screen.dart new file mode 100644 index 0000000..9b9aee9 --- /dev/null +++ b/lib/ui/work_list/work_list_screen.dart @@ -0,0 +1,200 @@ +import 'package:easy_localization/src/public_ext.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/generated/locale_keys.g.dart'; +import 'package:mohem_flutter_app/ui/app_bar.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; +import 'package:mohem_flutter_app/extensions/widget_extensions.dart'; + +class WorkListScreen extends StatefulWidget { + @override + State createState() => _WorkListScreenState(); +} + +class _WorkListScreenState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: appBar( + context, + title: LocaleKeys.workList.tr(), + ), + body: Container( + width: double.infinity, + height: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + height: 2, + color: MyColors.darkWhiteColor, + ), + Container( + width: double.infinity, + height: 40, + margin: EdgeInsets.only( + top: 21, + ), + child: ListView.separated( + itemBuilder: (context, index) { + return Container( + padding: EdgeInsets.only( + left: 30, + right: 30, + ), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6), + color: tabList[index].isSelected + ? MyColors.darkIconColor + : MyColors.darkWhiteColor, + ), + child: tabList[index].title.toText12( + color: tabList[index].isSelected + ? MyColors.white + : MyColors.black, + ), + ); + }, + separatorBuilder: (context, index) { + return 8.width; + }, + shrinkWrap: true, + itemCount: tabList.length, + scrollDirection: Axis.horizontal, + padding: const EdgeInsets.only( + left: 21, + right: 21, + ), + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + LocaleKeys.human.toText12(), + LocaleKeys.resources.tr().toText24(isBold: true), + ], + ).paddingOnly(top: 24, left: 21, right: 21), + 24.height, + Expanded( + child: ListView.separated( + itemBuilder: (context, index) { + return rowItem(typesList[index]); + }, + separatorBuilder: (context, index) { + return 12.height; + }, + itemCount: typesList.length, + padding: EdgeInsets.only(left: 21, right: 21), + ), + ), + ], + ), + ), + ); + } + + Widget rowItem(Types types) { + return Container( + width: double.infinity, + padding: EdgeInsets.all(12), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withOpacity(.05), + blurRadius: 26, + offset: const Offset(0, -3), + ), + ], + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + gradient: LinearGradient( + transform: GradientRotation(.46), + begin: Alignment.topRight, + end: Alignment.bottomRight, + colors: types.colors), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset( + "assets/images/miss_swipe.svg", + color: Colors.white, + ), + 2.height, + types.title.toText10(color: Colors.white) + ], + ).paddingAll(6), + ), + 12.width, + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + "Missing Swipe Request".toText16(), + "Missing Swipe Request for Hussain, Mohammad has been approved" + .toText10(), + 12.height, + Row( + children: [ + Expanded( + child: "07 Jan 2021" + .toText10(color: MyColors.lightTextColor)), + SvgPicture.asset( + "assets/images/arrow_next.svg", + color: MyColors.darkIconColor, + ) + ], + ), + ], + ), + ), + ], + ), + ); + } +} + +class Tabs { + String title; + bool isSelected; + + Tabs(this.title, this.isSelected); +} + +List tabList = [ + Tabs("All", true), + Tabs("HR", false), + Tabs("MO", false), + Tabs("PR", false), + Tabs("PO", false), +]; + +class Types { + String title; + List colors; + + Types(this.title, this.colors); +} + +List typesList = [ + Types("HR", [Color(0xff32D892), Color(0xff1AB170)]), + Types("ITG", [Color(0xffEB8C90), Color(0xffDE6C70)]), + Types("PO", [Color(0xff5099E3), Color(0xff3670AA)]), + Types("PR", [Color(0xff48EACF), Color(0xff3DCAB3)]), + Types("MO", [Color(0xff58DCFA), Color(0xff3CB9D5)]), +]; diff --git a/pubspec.lock b/pubspec.lock index 302ac7a..56d2f3f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -14,7 +14,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.2" + version: "2.8.1" boolean_selector: dependency: transitive description: @@ -28,7 +28,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.1.0" charcode: dependency: transitive description: @@ -202,7 +202,7 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.11" + version: "0.12.10" meta: dependency: transitive description: @@ -445,7 +445,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.3" + version: "0.4.2" typed_data: dependency: transitive description: @@ -466,7 +466,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.0" win32: dependency: transitive description: