diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 816a208..fee81e6 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -49,6 +49,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 816a208..fee81e6 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -49,6 +49,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 20e6cc1..f20e621 100644 --- a/lib/classes/colors.dart +++ b/lib/classes/colors.dart @@ -3,6 +3,8 @@ import 'package:flutter/cupertino.dart'; class MyColors { static const Color darkIconColor = Color(0xff28323A); static const Color darkTextColor = Color(0xff2B353E); + static const Color normalTextColor = Color(0xff5A5A5A); + static const Color lightTextColor = Color(0xffBFBFBF); static const Color gradiantStartColor = Color(0xff33c0a5); static const Color gradiantEndColor = Color(0xff259db7 ); static const Color textMixColor = Color(0xff2BB8A6); @@ -18,4 +20,7 @@ class MyColors { static const Color redColor = Color(0xffD02127); static const Color yellowColor = Color(0xffF4E31C); static const Color backgroundBlackColor = Color(0xff202529); + static const Color black = Color(0xff000000); + static const Color white = Color(0xffffffff); + static const Color green = Color(0xffffffff); } diff --git a/lib/config/routes.dart b/lib/config/routes.dart index ac167c6..4e72b26 100644 --- a/lib/config/routes.dart +++ b/lib/config/routes.dart @@ -4,6 +4,8 @@ import 'package:mohem_flutter_app/ui/landing/today_attendance_screen.dart'; import 'package:mohem_flutter_app/ui/login/login_screen.dart'; import 'package:mohem_flutter_app/ui/login/new_password_screen.dart'; import 'package:mohem_flutter_app/ui/login/verify_login_screen.dart'; +import 'package:mohem_flutter_app/ui/work_list/missing_swipe/missing_swipe_screen.dart'; +import 'package:mohem_flutter_app/ui/work_list/work_list_screen.dart'; class AppRoutes { static const String splash = "/splash"; @@ -17,11 +19,19 @@ class AppRoutes { static const String todayAttendance = "/todayAttendance"; static const String initialRoute = login; + //Work List + static const String workList = "/workList"; + static const String missingSwipe = "/missingSwipe"; + static final Map routes = { login: (context) => LoginScreen(), verifyLogin: (context) => VerifyLoginScreen(), dashboard: (context) => Dashboard(), newPassword: (context) => NewPasswordScreen(), todayAttendance: (context) => TodayAttendanceScreen(), + + //Work List + workList: (context) => WorkListScreen(), + missingSwipe: (context) => MissingSwipeScreen(), }; } 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/work_list/missing_swipe/fragments/actions_fragment.dart b/lib/ui/work_list/missing_swipe/fragments/actions_fragment.dart new file mode 100644 index 0000000..05cf9ce --- /dev/null +++ b/lib/ui/work_list/missing_swipe/fragments/actions_fragment.dart @@ -0,0 +1,126 @@ +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/widgets/circular_avatar.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'; +import 'dart:math' as math; + +class ActionsFragment extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + height: double.infinity, + child: Column( + children: [ + showItem(), + ], + ), + ); + } + + Widget showItem() { + return Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withOpacity(.05), + blurRadius: 26, + offset: const Offset(0, -3), + ), + ], + ), + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.all(21), + child: Stack( + clipBehavior: Clip.antiAlias, + children: [ + Positioned( + left: -21, + child: Transform.rotate( + angle: 125, + child: Container( + width: 60, + height: 20, + color: Colors.black, + ), + ), + ), + Column( + children: [ + Padding( + padding: const EdgeInsets.only(left: 12, right: 12, top: 12), + child: Column( + children: [ + Row( + children: [ + CircularAvatar(), + 12.width, + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + "Mahmoud Shrouf".toText16(), + 6.height, + "Missing Swipe Request for Hussain, Mohammad has been approved" + .toText12(), + 3.height, + Row( + children: [ + "Submitted".toText10(), + 12.width, + "On 07 Jan 2021" + .toText12(color: MyColors.lightTextColor) + ], + ) + ], + ), + ) + ], + ), + ], + ), + ), + 12.height, + Container( + width: double.infinity, + height: 1, + color: MyColors.lightTextColor, + ), + Row( + children: [ + Expanded( + child: Center( + child: "Request Info" + .toText12(isBold: true) + .paddingOnly(left: 21, right: 21, top: 16, bottom: 8), + ), + ), + Center( + child: Container( + width: 1, + height: 45, + color: MyColors.lightTextColor, + ), + ), + Expanded( + child: Center( + child: "Delegate" + .toText12( + color: MyColors.gradiantEndColor, isBold: true) + .paddingOnly(left: 21, right: 21, top: 16, bottom: 8), + ), + ), + ], + ), + ], + ), + ], + ), + ); + } +} diff --git a/lib/ui/work_list/missing_swipe/fragments/attachments_fragment.dart b/lib/ui/work_list/missing_swipe/fragments/attachments_fragment.dart new file mode 100644 index 0000000..652eba8 --- /dev/null +++ b/lib/ui/work_list/missing_swipe/fragments/attachments_fragment.dart @@ -0,0 +1,61 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; + +class AttachmentsFragment extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + height: double.infinity, + child: ListView.separated( + itemCount: 2, + padding: EdgeInsets.all(21), + itemBuilder: (context, index) { + return showItem(attachmentsList[index]); + }, + separatorBuilder: (BuildContext context, int index) { + return 21.height; + }, + ), + ); + } + + Widget showItem(Attachments attachments) { + return Container( + width: double.infinity, + padding: EdgeInsets.all(21), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withOpacity(.05), + blurRadius: 26, + offset: const Offset(0, -3), + ), + ], + ), + child: Row( + children: [ + SvgPicture.asset(attachments.icon), + 12.width, + attachments.title.toText16() + ], + ), + ); + } +} + +class Attachments { + String title; + String icon; + + Attachments(this.title, this.icon); +} + +List attachmentsList = [ + Attachments("Attachment File Name.png", "assets/images/png.svg"), + Attachments("Attachment File Name.pdf", "assets/images/pdf.svg"), +]; diff --git a/lib/ui/work_list/missing_swipe/fragments/info_fragments.dart b/lib/ui/work_list/missing_swipe/fragments/info_fragments.dart new file mode 100644 index 0000000..b115df9 --- /dev/null +++ b/lib/ui/work_list/missing_swipe/fragments/info_fragments.dart @@ -0,0 +1,69 @@ +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; + +class InfoFragment extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + height: double.infinity, + child: Column( + children: [ + Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withOpacity(.05), + blurRadius: 26, + offset: const Offset(0, -3), + ), + ], + ), + margin: EdgeInsets.all(21), + padding: EdgeInsets.only(top: 21, bottom: 21, right: 16, left: 16), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: "Info Details".toText16(), + ), + // Icon(Icons.keyboard_arrow_down_rounded), + ], + ), + Column( + children: [ + 12.height, + showItem("From:", "Alma Linde Mendoza"), + showItem("To:", "Al Yabis, Norah"), + showItem("Sent:", "1/26/2020 10:41:07 AM"), + showItem("ID:", "30581045"), + showItem("Closed:", "-"), + ], + ), + ], + ), + ), + ], + ), + ); + } + + Widget showItem(String title, String value) { + return Padding( + padding: const EdgeInsets.only(top: 2, bottom: 2), + child: Row( + children: [ + title.toText12(isBold: true), + 6.width, + title.toText12(isBold: false, color: MyColors.normalTextColor), + ], + ), + ); + } +} diff --git a/lib/ui/work_list/missing_swipe/fragments/request_fragment.dart b/lib/ui/work_list/missing_swipe/fragments/request_fragment.dart new file mode 100644 index 0000000..f87995a --- /dev/null +++ b/lib/ui/work_list/missing_swipe/fragments/request_fragment.dart @@ -0,0 +1,87 @@ +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; + +class RequestFragment extends StatefulWidget { + @override + State createState() => _RequestFragmentState(); +} + +class _RequestFragmentState extends State { + bool isOpened = false; + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + height: double.infinity, + child: Column( + children: [ + Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15), + boxShadow: [ + BoxShadow( + color: const Color(0xff000000).withOpacity(.05), + blurRadius: 26, + offset: const Offset(0, -3), + ), + ], + ), + margin: EdgeInsets.all(21), + padding: EdgeInsets.only(top: 21, bottom: 21, right: 16, left: 16), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: "Hardware Mobility 161 Messenger".toText16(), + ), + Icon(Icons.keyboard_arrow_down_rounded), + ], + ), + Column( + children: [ + 12.height, + showItem("Code:", "3188000067"), + showItem("Quantity:", "1"), + showItem("Line Status:", "Pending Approval"), + showItem("Transection Type:", "Move Order Issue:"), + showItem("Organization Code:", "SWD"), + showItem("From Subinventory:", "SWD_MSPS"), + showItem("To Subinventory:", "SWD_MSPS"), + showItem("Ship To Location :", + "SWD 11206-E.R. (Emergency Room)"), + showItem("Unit:", "Each"), + showItem("Date Required:", "12/23/2019 4:54:04 PM"), + showItem("Status Date:", "12/23/2019 4:54:04 PM"), + showItem("Operation Unit:", "Sehat Al Sewedi"), + showItem("Organization:", "Sehat Al Sewedi"), + showItem("From Locator:", "-"), + showItem("To Locator :", "-"), + ], + ), + ], + ), + ), + ], + ), + ); + } + + Widget showItem(String title, String value) { + return Padding( + padding: const EdgeInsets.only(top: 2, bottom: 2), + child: Row( + children: [ + title.toText12(isBold: true), + 6.width, + title.toText12(isBold: false, color: MyColors.normalTextColor), + ], + ), + ); + } +} diff --git a/lib/ui/work_list/missing_swipe/missing_swipe_screen.dart b/lib/ui/work_list/missing_swipe/missing_swipe_screen.dart new file mode 100644 index 0000000..850f565 --- /dev/null +++ b/lib/ui/work_list/missing_swipe/missing_swipe_screen.dart @@ -0,0 +1,104 @@ +import 'package:flutter/material.dart'; +import 'package:mohem_flutter_app/classes/colors.dart'; +import 'package:mohem_flutter_app/ui/app_bar.dart'; +import 'package:mohem_flutter_app/extensions/string_extensions.dart'; +import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/actions_fragment.dart'; +import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/attachments_fragment.dart'; +import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/info_fragments.dart'; +import 'package:mohem_flutter_app/ui/work_list/missing_swipe/fragments/request_fragment.dart'; +import 'package:mohem_flutter_app/widgets/button/default_button.dart'; +import 'package:mohem_flutter_app/extensions/int_extensions.dart'; + +class MissingSwipeScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + return DefaultTabController( + length: 4, + child: Scaffold( + appBar: appBar(context, title: "Missing Swipe Request"), + body: Container( + width: double.infinity, + height: double.infinity, + child: Column( + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(20), + bottomRight: Radius.circular(20)), + gradient: LinearGradient( + transform: GradientRotation(.46), + begin: Alignment.topRight, + end: Alignment.bottomRight, + colors: [ + MyColors.gradiantEndColor, + MyColors.gradiantStartColor, + ]), + ), + clipBehavior: Clip.antiAlias, + child: TabBar( + indicatorColor: Colors.white, + labelColor: Colors.white, + tabs: [ + Tab( + text: "Request", + ), + Tab( + text: "Actions", + ), + Tab( + text: "Attachments", + ), + Tab( + text: "Info.", + ), + ], + ), + ), + Expanded( + child: TabBarView( + children: [ + RequestFragment(), + ActionsFragment(), + AttachmentsFragment(), + InfoFragment(), + ], + ), + ), + Container( + width: double.infinity, + height: 60, + padding: EdgeInsets.only(left: 21, right: 21), + child: Row( + children: [ + Expanded( + child: DefaultButton( + "Reject", + () {}, + colors: [ + Color(0xffEB8C90), + Color(0xffDE6C70), + ], + ), + ), + 12.width, + Expanded( + child: DefaultButton( + "Approve", + () {}, + colors: [ + Color(0xff32D892), + Color(0xff1AB170), + ], + ), + ), + ], + ), + ) + ], + ), + ), + ), + ); + } +} 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..c3de75f --- /dev/null +++ b/lib/ui/work_list/work_list_screen.dart @@ -0,0 +1,206 @@ +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/config/routes.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 InkWell( + onTap: (){ + Navigator.pushNamed(context, AppRoutes.missingSwipe); + }, + child: 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/lib/widgets/button/default_button.dart b/lib/widgets/button/default_button.dart index 9e0fd23..77d1c61 100644 --- a/lib/widgets/button/default_button.dart +++ b/lib/widgets/button/default_button.dart @@ -3,7 +3,10 @@ import 'package:flutter_svg/svg.dart'; import 'package:mohem_flutter_app/classes/colors.dart'; extension WithContainer on Widget { - Widget get insideContainer => Container(color: Colors.white, padding: const EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: this); + Widget get insideContainer => Container( + color: Colors.white, + padding: const EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: this); } class DefaultButton extends StatelessWidget { @@ -17,8 +20,18 @@ class DefaultButton extends StatelessWidget { final double? fontSize; final bool isTextExpanded; final int count; + final List? colors; - DefaultButton(this.text, this.onPress, {this.color, this.isTextExpanded = true, this.svgIcon, this.disabledColor, this.count = 0, this.textColor = Colors.white, this.iconData, this.fontSize}); + DefaultButton(this.text, this.onPress, + {this.color, + this.isTextExpanded = true, + this.svgIcon, + this.disabledColor, + this.count = 0, + this.textColor = Colors.white, + this.iconData, + this.fontSize, + this.colors}); @override Widget build(BuildContext context) { @@ -29,24 +42,36 @@ class DefaultButton extends StatelessWidget { decoration: BoxDecoration( borderRadius: BorderRadius.circular(6.0), gradient: onPress == null - ? const LinearGradient(colors: [Color(0xffEAEAEA), Color(0xffEAEAEA)]) - : const LinearGradient(transform: GradientRotation(.83), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [ - MyColors.gradiantEndColor, - MyColors.gradiantStartColor, - ]), + ? const LinearGradient( + colors: [Color(0xffEAEAEA), Color(0xffEAEAEA)]) + : LinearGradient( + transform: GradientRotation(.83), + begin: Alignment.topRight, + end: Alignment.bottomLeft, + colors: colors ?? + [ + MyColors.gradiantEndColor, + MyColors.gradiantStartColor, + ]), ), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ if (iconData != null) Icon(iconData, color: textColor), - if (svgIcon != null) SvgPicture.asset(svgIcon ?? "", color: textColor), + if (svgIcon != null) + SvgPicture.asset(svgIcon ?? "", color: textColor), if (!isTextExpanded) Padding( - padding: EdgeInsets.only(left: (iconData ?? svgIcon) != null ? 6 : 0), + padding: EdgeInsets.only( + left: (iconData ?? svgIcon) != null ? 6 : 0), child: Text( text, textAlign: TextAlign.center, - style: TextStyle(fontSize: fontSize ?? 16, fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48), + style: TextStyle( + fontSize: fontSize ?? 16, + fontWeight: FontWeight.w600, + color: textColor, + letterSpacing: -0.48), ), ), if (isTextExpanded) @@ -54,7 +79,11 @@ class DefaultButton extends StatelessWidget { child: Text( text, textAlign: TextAlign.center, - style: TextStyle(fontSize: fontSize ?? 16, fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48), + style: TextStyle( + fontSize: fontSize ?? 16, + fontWeight: FontWeight.w600, + color: textColor, + letterSpacing: -0.48), ), ), if (count > 0) @@ -65,11 +94,17 @@ class DefaultButton extends StatelessWidget { padding: const EdgeInsets.only(left: 5, right: 5), alignment: Alignment.center, height: 16, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(10.0), color: Colors.white), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10.0), + color: Colors.white), child: Text( "$count", textAlign: TextAlign.center, - style: const TextStyle(fontSize: 12, fontWeight: FontWeight.w700, color: Color(0xffD02127), letterSpacing: -0.6), + style: const TextStyle( + fontSize: 12, + fontWeight: FontWeight.w700, + color: Color(0xffD02127), + letterSpacing: -0.6), ), ), ) 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: