From 785554e5fad378fd17726e74b408d615419e3789 Mon Sep 17 00:00:00 2001 From: RoaaGhali98 Date: Mon, 21 Mar 2022 11:24:08 +0300 Subject: [PATCH 1/6] Edit some design issues in the 4th page --- lib/core/base/app_scaffold_widget.dart | 3 - lib/core/config/config.dart | 1 + lib/header/app_header.dart | 8 +- lib/home/home_screen.dart | 61 +++-- lib/home/que_item.dart | 112 +++++--- lib/home/que_item_list.dart | 22 +- lib/main.dart | 3 - lib/utils/utils.dart | 4 + pubspec.lock | 341 ------------------------- 9 files changed, 144 insertions(+), 411 deletions(-) delete mode 100644 pubspec.lock diff --git a/lib/core/base/app_scaffold_widget.dart b/lib/core/base/app_scaffold_widget.dart index 6d457ee..3443537 100644 --- a/lib/core/base/app_scaffold_widget.dart +++ b/lib/core/base/app_scaffold_widget.dart @@ -1,11 +1,8 @@ - import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:queuing_system/core/base/project_view_model.dart'; import 'package:queuing_system/widget/app_loader_widget.dart'; import 'package:queuing_system/widget/data_display/app_texts_widget.dart'; - - import 'base_view_model.dart'; import 'network_base_view.dart'; diff --git a/lib/core/config/config.dart b/lib/core/config/config.dart index 130d644..31b19f0 100644 --- a/lib/core/config/config.dart +++ b/lib/core/config/config.dart @@ -18,5 +18,6 @@ class AppGlobal { static Color appTextColor = const Color(0xFF2B353E); static Color scheduleTextColor = const Color(0xFF2E303A); static Color inProgressColor = const Color(0xFFCC9B14); + static Color appLightGreyColor = const Color(0xFF575757); } diff --git a/lib/header/app_header.dart b/lib/header/app_header.dart index 480dd39..8863be1 100644 --- a/lib/header/app_header.dart +++ b/lib/header/app_header.dart @@ -1,7 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:provider/provider.dart'; -import 'package:queuing_system/core/base/project_view_model.dart'; import 'package:queuing_system/core/config/config.dart'; import 'package:queuing_system/core/config/size_config.dart'; import 'package:queuing_system/widget/data_display/app_texts_widget.dart'; @@ -29,11 +27,11 @@ class AppHeader extends StatelessWidget with PreferredSizeWidget { children: [ AppText( " Current Serving", - letterSpacing: -2.48, color: Colors.white, + fontFamily: 'Poppins-SemiBold.ttf', ), - SvgPicture.asset( "assets/images/hmglogo.svg", height: 120,), + SvgPicture.asset( "assets/images/hmglogo.svg", height: 60,), ], ), ), @@ -43,5 +41,5 @@ class AppHeader extends StatelessWidget with PreferredSizeWidget { @override Size get preferredSize => Size( double.maxFinite, - 280); + SizeConfig.getHeightMultiplier()*10); } diff --git a/lib/home/home_screen.dart b/lib/home/home_screen.dart index 7039cde..7f3f277 100644 --- a/lib/home/home_screen.dart +++ b/lib/home/home_screen.dart @@ -6,6 +6,7 @@ import 'package:queuing_system/header/app_header.dart'; import 'package:queuing_system/home/que_item.dart'; import 'package:queuing_system/home/que_item_list.dart'; import 'package:queuing_system/utils/signalR_utils.dart'; +import 'package:queuing_system/utils/utils.dart'; import 'package:queuing_system/widget/data_display/app_texts_widget.dart'; class MyHomePage extends StatefulWidget { @@ -30,34 +31,48 @@ class _MyHomePageState extends State { body: Column( children: [ SizedBox(height: SizeConfig.getHeightMultiplier() * (widget.haveOnePatient?20: 5)), - widget.haveListOfPatient?Row( + widget.haveListOfPatient? + Row( children: [ - FirstColumn(haveLessThan3Patient: widget.haveLessThan3Patient,), - - Container(width: 20,height:SizeConfig.getHeightMultiplier() *40,color: Colors.grey, margin: EdgeInsets.only(left: 30),), - QueItemList() + FirstColumn( + haveLessThan3Patient: widget.haveLessThan3Patient, + ), + const SizedBox( + width: 40, + ), + Container( + width: 10, + height:SizeConfig.getHeightMultiplier()*40, + color: Colors.grey, + ), + const SizedBox( + width: 40, + ), + const QueItemList() ], ): FirstColumn(haveLessThan3Patient: widget.haveLessThan3Patient,), ], ), bottomSheet: Container( color: Colors.transparent, - height: 280, + height: Utils.getHeight(), width: double.infinity, - padding: const EdgeInsets.only(left: 50, right: 50, bottom: 10,), child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.center , children: [ - AppText( - "Powered By", - letterSpacing: -2.48, - color: AppGlobal.appTextColor, - fontSize: SizeConfig.getWidthMultiplier() * 3, - + Padding( + padding: const EdgeInsets.only(top: 30, left: 30), + child: AppText( + "Powered By", + letterSpacing: -1.1, + color: AppGlobal.appTextColor, + fontSize: SizeConfig.getWidthMultiplier() * 2.5, + fontFamily: 'Poppins-Medium.ttf', + ), + ), + Padding( + padding: const EdgeInsets.only(top: 40, left: 18), + child: Image.asset( "assets/images/cloud_logo.png", height: SizeConfig.getHeightMultiplier()*5,), ), - const SizedBox(width: 40,), - Image.asset( "assets/images/cloud_logo.png",), ], ), ),// This trailing comma makes auto-formatting nicer for build methods. @@ -75,17 +90,17 @@ class FirstColumn extends StatelessWidget { return Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - QueItem(queNo: "OBG-T45", isFirstLine: true, isNurseVisit: true,), - SizedBox(height: SizeConfig.getHeightMultiplier() * 5,), + const QueItem(queNo: "OBG-T45", isFirstLine: true, isNurseVisit: true, haveListOfPatient: true,), + SizedBox( + height: SizeConfig.getHeightMultiplier() * 5,), if(haveLessThan3Patient) Row( mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - QueItem(queNo: "OBG-T45", isSecondLine: true, isNurseVisit: true,), - QueItem(queNo: "OBG-T45", isSecondLine: true, isNurseVisit: false,), + children: const [ + QueItem(queNo: "OBG-T45", isSecondLine: true, isNurseVisit: true, haveListOfPatient: true,), + QueItem(queNo: "OBG-T45", isSecondLine: true, isNurseVisit: false, haveListOfPatient: true,), ], ), - ], ); } diff --git a/lib/home/que_item.dart b/lib/home/que_item.dart index da9d30e..6ddf07c 100644 --- a/lib/home/que_item.dart +++ b/lib/home/que_item.dart @@ -12,7 +12,7 @@ class QueItem extends StatelessWidget { this.isInListLine = false, this.queNo, this.isNurseVisit = false, - this.idDoctorVisit = false, + this.idDoctorVisit = false, this.haveListOfPatient }) : super(key: key); final bool isFirstLine; final bool isSecondLine; @@ -20,46 +20,100 @@ class QueItem extends StatelessWidget { final bool isNurseVisit; final bool idDoctorVisit; final String queNo; + final bool haveListOfPatient; @override Widget build(BuildContext context) { - return Column( - children: [ - AppText( - queNo, - fontSize: SizeConfig.getWidthMultiplier() * - (isFirstLine - ? 13 + return haveListOfPatient? + Padding( + padding: const EdgeInsets.all(30.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + AppText( + queNo, + fontSize: SizeConfig.getWidthMultiplier() * + (isFirstLine + ? 13 + : isSecondLine + ? 8.5 + : 5.5), + letterSpacing: -5.00, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins-Bold.ttf', + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SvgPicture.asset( + isNurseVisit + ? "assets/images/nurseicon.svg" + : "assets/images/doctoricon.svg", height:(isFirstLine + ? 40 : isSecondLine - ? 8.5 - : 5.5), - letterSpacing: -9.32, - fontWeight: FontWeight.bold, + ? 40 + : 40) ,), + const SizedBox(width: 8,), + AppText( + isNurseVisit ? "Please visit Nurse" : "Please visit doctor", + color: isNurseVisit + ? AppGlobal.appGreenColor + : AppGlobal.appRedColor, + fontSize: SizeConfig.getWidthMultiplier() * (isFirstLine + ? 3.3 + : isSecondLine + ? 3.3 + : 3.3), + letterSpacing: -2.6, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins-Bold.ttf', + ), + ], + ) + ], + ), + ) + :Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.only(right: 20.0, left: 20.0), + child: AppText( + queNo, + fontSize: SizeConfig.getWidthMultiplier() * + (isFirstLine + ? 13 + : isSecondLine + ? 8.5 + : 5.5), + letterSpacing: -2.6, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + ), ), Row( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - SvgPicture.asset(isNurseVisit - ? "assets/images/nurseicon.svg" - : "assets/images/doctoricon.svg", height:(isFirstLine - ? 120 + SvgPicture.asset( + isNurseVisit + ? "assets/images/nurseicon.svg" + : "assets/images/doctoricon.svg", height:(isFirstLine + ? 40 : isSecondLine - ? 80 - : 70) ,), - SizedBox(width: 10,), + ? 40 + : 40) ,), + const SizedBox(width: 8,), AppText( - isNurseVisit ? "Please visit Nurse" : "Please visit doctor", - color: isNurseVisit - ? AppGlobal.appGreenColor - : AppGlobal.appRedColor, + isNurseVisit ? " Please visit Nurse" : " Please visit doctor", + color: AppGlobal.appLightGreyColor, fontSize: SizeConfig.getWidthMultiplier() * (isFirstLine - ? 4 + ? 3.3 : isSecondLine - ? 3 - : 3.2), - letterSpacing: -2.6, - fontWeight: FontWeight.w600, + ? 3.3 + : 3.3), + letterSpacing: -1.6, + fontFamily: 'Poppins-Medium.ttf', ), ], ) diff --git a/lib/home/que_item_list.dart b/lib/home/que_item_list.dart index 7f2a5d0..359d88e 100644 --- a/lib/home/que_item_list.dart +++ b/lib/home/que_item_list.dart @@ -6,13 +6,21 @@ class QueItemList extends StatelessWidget { @override Widget build(BuildContext context) { - return Column(children: [ - QueItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true,), - QueItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true,), - QueItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true,), - QueItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true,), - QueItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true,), + return SizedBox( + child: Expanded( + child: Column( + children: const [ + QueItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true, haveListOfPatient: false,), + QueItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true, haveListOfPatient: false,), + QueItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true, haveListOfPatient: false,), + QueItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true, haveListOfPatient: false,), + QueItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true, haveListOfPatient: false,), + QueItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true, haveListOfPatient: false,), + QueItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true, haveListOfPatient: false,), + QueItem(queNo: "OBG-T45", isInListLine: true, isNurseVisit: true, haveListOfPatient: false,), - ],); + ],), + ), + ); } } diff --git a/lib/main.dart b/lib/main.dart index ffcdf1f..ed701d3 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,8 +1,5 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:queuing_system/utils/signalR_utils.dart'; - -import 'core/base/app_scaffold_widget.dart'; import 'core/base/project_view_model.dart'; import 'core/config/size_config.dart'; import 'home/home_screen.dart'; diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index c585496..73ac5f3 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -176,4 +176,8 @@ class Utils { // Join/Merge all words back to one String return capitalizedWords.join(' '); } + + static getHeight() { + return SizeConfig.getHeightMultiplier()*10; + } } diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index b88033d..0000000 --- a/pubspec.lock +++ /dev/null @@ -1,341 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.8.2" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - connectivity: - dependency: "direct main" - description: - name: connectivity - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.6" - connectivity_for_web: - dependency: transitive - description: - name: connectivity_for_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.0+1" - connectivity_macos: - dependency: transitive - description: - name: connectivity_macos - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.1+2" - connectivity_platform_interface: - dependency: transitive - description: - name: connectivity_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - equatable: - dependency: transitive - description: - name: equatable - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_gifimage: - dependency: "direct main" - description: - name: flutter_gifimage - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - flutter_svg: - dependency: "direct main" - description: - name: flutter_svg - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - get_it: - dependency: "direct main" - description: - name: get_it - url: "https://pub.dartlang.org" - source: hosted - version: "7.2.0" - http: - dependency: "direct main" - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.4" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.0" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3" - lints: - dependency: transitive - description: - name: lints - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.11" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - nested: - dependency: transitive - description: - name: nested - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - path_drawing: - dependency: transitive - description: - name: path_drawing - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - path_parsing: - dependency: transitive - description: - name: path_parsing - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "4.4.0" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.2" - provider: - dependency: "direct main" - description: - name: provider - url: "https://pub.dartlang.org" - source: hosted - version: "6.0.2" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1+1" - signalr_core: - dependency: "direct main" - description: - name: signalr_core - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.1" - sse_client: - dependency: transitive - description: - name: sse_client - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.3" - tuple: - dependency: transitive - description: - name: tuple - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "5.3.1" -sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.4.0-0.0.pre" From d304493b4b276cad6e9517bb4c81f83b8c4fd5e8 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 21 Mar 2022 11:42:37 +0300 Subject: [PATCH 2/6] add the fonts enum --- lib/core/enum/font_enum.dart | 0 lib/header/app_header.dart | 5 ++--- lib/home/home_screen.dart | 2 +- lib/widget/data_display/app_texts_widget.dart | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 lib/core/enum/font_enum.dart diff --git a/lib/core/enum/font_enum.dart b/lib/core/enum/font_enum.dart new file mode 100644 index 0000000..e69de29 diff --git a/lib/header/app_header.dart b/lib/header/app_header.dart index 8863be1..5b1697e 100644 --- a/lib/header/app_header.dart +++ b/lib/header/app_header.dart @@ -19,8 +19,7 @@ class AppHeader extends StatelessWidget with PreferredSizeWidget { , border: const Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))), child: Container( - padding: const EdgeInsets.only(left: 30, right: 50, bottom: 10,), - margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort ? 30 : 50), + padding: const EdgeInsets.only(left: 30, right: 50, bottom: 0,), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, @@ -41,5 +40,5 @@ class AppHeader extends StatelessWidget with PreferredSizeWidget { @override Size get preferredSize => Size( double.maxFinite, - SizeConfig.getHeightMultiplier()*10); + SizeConfig.getHeightMultiplier()*8); } diff --git a/lib/home/home_screen.dart b/lib/home/home_screen.dart index 7f3f277..7841de3 100644 --- a/lib/home/home_screen.dart +++ b/lib/home/home_screen.dart @@ -30,7 +30,7 @@ class _MyHomePageState extends State { appBar: AppHeader(), body: Column( children: [ - SizedBox(height: SizeConfig.getHeightMultiplier() * (widget.haveOnePatient?20: 5)), + SizedBox(height: SizeConfig.getHeightMultiplier() * (widget.haveOnePatient?20: 3)), widget.haveListOfPatient? Row( children: [ diff --git a/lib/widget/data_display/app_texts_widget.dart b/lib/widget/data_display/app_texts_widget.dart index 9708e36..9fe77a2 100644 --- a/lib/widget/data_display/app_texts_widget.dart +++ b/lib/widget/data_display/app_texts_widget.dart @@ -300,7 +300,7 @@ class _AppTextState extends State { case "date": return 24.0; default: - return SizeConfig.textMultiplier * 2.5; + return SizeConfig.textMultiplier * 2.8; } } From f75291d6021ca11643903bb7c74b798861426cb7 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 21 Mar 2022 12:21:32 +0300 Subject: [PATCH 3/6] fix issue --- lib/home/home_screen.dart | 2 +- lib/home/{ => que_item}/que_item.dart | 0 lib/home/que_item_list.dart | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename lib/home/{ => que_item}/que_item.dart (100%) diff --git a/lib/home/home_screen.dart b/lib/home/home_screen.dart index 7841de3..ed77e22 100644 --- a/lib/home/home_screen.dart +++ b/lib/home/home_screen.dart @@ -3,7 +3,7 @@ import 'package:queuing_system/core/base/app_scaffold_widget.dart'; import 'package:queuing_system/core/config/config.dart'; import 'package:queuing_system/core/config/size_config.dart'; import 'package:queuing_system/header/app_header.dart'; -import 'package:queuing_system/home/que_item.dart'; +import 'package:queuing_system/home/que_item/que_item.dart'; import 'package:queuing_system/home/que_item_list.dart'; import 'package:queuing_system/utils/signalR_utils.dart'; import 'package:queuing_system/utils/utils.dart'; diff --git a/lib/home/que_item.dart b/lib/home/que_item/que_item.dart similarity index 100% rename from lib/home/que_item.dart rename to lib/home/que_item/que_item.dart diff --git a/lib/home/que_item_list.dart b/lib/home/que_item_list.dart index 359d88e..4dea15c 100644 --- a/lib/home/que_item_list.dart +++ b/lib/home/que_item_list.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:queuing_system/home/que_item.dart'; +import 'package:queuing_system/home/que_item/que_item.dart'; class QueItemList extends StatelessWidget { const QueItemList({Key key}) : super(key: key); From 449b0f30149f7e6c400410193949ca8dc7e1874e Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 21 Mar 2022 12:29:39 +0300 Subject: [PATCH 4/6] fix the row option --- lib/home/home_screen.dart | 17 ++++++++++------- lib/home/que_item/que_item.dart | 1 + 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/home/home_screen.dart b/lib/home/home_screen.dart index ed77e22..17e6afb 100644 --- a/lib/home/home_screen.dart +++ b/lib/home/home_screen.dart @@ -14,8 +14,8 @@ class MyHomePage extends StatefulWidget { String title ="MyHomePage"; bool haveOnePatient = false; - bool haveLessThan3Patient = true; - bool haveListOfPatient = true; + bool have3Patient = true; + bool haveListOfPatient = false; @override @@ -35,22 +35,25 @@ class _MyHomePageState extends State { Row( children: [ FirstColumn( - haveLessThan3Patient: widget.haveLessThan3Patient, + have3Patient: widget.have3Patient, ), const SizedBox( width: 40, ), + if(widget.haveListOfPatient) Container( width: 10, height:SizeConfig.getHeightMultiplier()*40, color: Colors.grey, ), + if(widget.haveListOfPatient) const SizedBox( width: 40, ), + if(widget.haveListOfPatient) const QueItemList() ], - ): FirstColumn(haveLessThan3Patient: widget.haveLessThan3Patient,), + ): FirstColumn(have3Patient: widget.have3Patient,), ], ), bottomSheet: Container( @@ -81,9 +84,9 @@ class _MyHomePageState extends State { } class FirstColumn extends StatelessWidget { - final bool haveLessThan3Patient; + final bool have3Patient; - const FirstColumn({Key key, this.haveLessThan3Patient = false}) : super(key: key); + const FirstColumn({Key key, this.have3Patient = false}) : super(key: key); @override Widget build(BuildContext context) { @@ -93,7 +96,7 @@ class FirstColumn extends StatelessWidget { const QueItem(queNo: "OBG-T45", isFirstLine: true, isNurseVisit: true, haveListOfPatient: true,), SizedBox( height: SizeConfig.getHeightMultiplier() * 5,), - if(haveLessThan3Patient) + if(have3Patient) Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: const [ diff --git a/lib/home/que_item/que_item.dart b/lib/home/que_item/que_item.dart index 6ddf07c..c7b38d7 100644 --- a/lib/home/que_item/que_item.dart +++ b/lib/home/que_item/que_item.dart @@ -44,6 +44,7 @@ class QueItem extends StatelessWidget { ), Row( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, children: [ SvgPicture.asset( isNurseVisit From d0f67e88d96cdf615f1d3ee4b8bf105d30d85ca8 Mon Sep 17 00:00:00 2001 From: Elham Rababh Date: Mon, 21 Mar 2022 12:56:17 +0300 Subject: [PATCH 5/6] add timer --- lib/home/home_screen.dart | 138 +++++++++++++++++++++++++++----------- 1 file changed, 97 insertions(+), 41 deletions(-) diff --git a/lib/home/home_screen.dart b/lib/home/home_screen.dart index 17e6afb..587e833 100644 --- a/lib/home/home_screen.dart +++ b/lib/home/home_screen.dart @@ -10,50 +10,87 @@ import 'package:queuing_system/utils/utils.dart'; import 'package:queuing_system/widget/data_display/app_texts_widget.dart'; class MyHomePage extends StatefulWidget { - - - String title ="MyHomePage"; + String title = "MyHomePage"; bool haveOnePatient = false; bool have3Patient = true; bool haveListOfPatient = false; - @override State createState() => _MyHomePageState(); } class _MyHomePageState extends State { + int remainingTime = 600; + + startTimer() { + this.remainingTime--; + if (remainingTime > 400) { + setState(() { + widget.haveOnePatient = true; + widget.have3Patient = false; + widget.haveListOfPatient = false; + }); + } else if (remainingTime > 200) { + setState(() { + widget.haveOnePatient = false; + widget.have3Patient = true; + widget.haveListOfPatient = false; + }); + } else { + setState(() { + widget.haveOnePatient = false; + widget.have3Patient = true; + widget.haveListOfPatient = true; + }); + } + + + Future.delayed(Duration(seconds: 1), () { + if (this.remainingTime > 0) { + startTimer(); + } else { + + } + + }); + } + @override Widget build(BuildContext context) { - SignalRHelper signalRHelper= SignalRHelper(); + SignalRHelper signalRHelper = SignalRHelper(); + startTimer(); return AppScaffold( appBar: AppHeader(), body: Column( children: [ - SizedBox(height: SizeConfig.getHeightMultiplier() * (widget.haveOnePatient?20: 3)), - widget.haveListOfPatient? - Row( - children: [ - FirstColumn( - have3Patient: widget.have3Patient, - ), - const SizedBox( - width: 40, - ), - if(widget.haveListOfPatient) - Container( - width: 10, - height:SizeConfig.getHeightMultiplier()*40, - color: Colors.grey, - ), - if(widget.haveListOfPatient) - const SizedBox( - width: 40, - ), - if(widget.haveListOfPatient) - const QueItemList() - ], - ): FirstColumn(have3Patient: widget.have3Patient,), + SizedBox( + height: SizeConfig.getHeightMultiplier() * + (widget.haveOnePatient ? 20 : 3)), + widget.haveListOfPatient + ? Row( + children: [ + FirstColumn( + have3Patient: widget.have3Patient, + ), + const SizedBox( + width: 40, + ), + if (widget.haveListOfPatient) + Container( + width: 10, + height: SizeConfig.getHeightMultiplier() * 40, + color: Colors.grey, + ), + if (widget.haveListOfPatient) + const SizedBox( + width: 40, + ), + if (widget.haveListOfPatient) const QueItemList() + ], + ) + : FirstColumn( + have3Patient: widget.have3Patient, + ), ], ), bottomSheet: Container( @@ -74,11 +111,14 @@ class _MyHomePageState extends State { ), Padding( padding: const EdgeInsets.only(top: 40, left: 18), - child: Image.asset( "assets/images/cloud_logo.png", height: SizeConfig.getHeightMultiplier()*5,), + child: Image.asset( + "assets/images/cloud_logo.png", + height: SizeConfig.getHeightMultiplier() * 5, + ), ), ], ), - ),// This trailing comma makes auto-formatting nicer for build methods. + ), // This trailing comma makes auto-formatting nicer for build methods. ); } } @@ -92,18 +132,34 @@ class FirstColumn extends StatelessWidget { Widget build(BuildContext context) { return Column( mainAxisAlignment: MainAxisAlignment.start, - children: [ - const QueItem(queNo: "OBG-T45", isFirstLine: true, isNurseVisit: true, haveListOfPatient: true,), + children: [ + const QueItem( + queNo: "OBG-T45", + isFirstLine: true, + isNurseVisit: true, + haveListOfPatient: true, + ), SizedBox( - height: SizeConfig.getHeightMultiplier() * 5,), - if(have3Patient) - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: const [ - QueItem(queNo: "OBG-T45", isSecondLine: true, isNurseVisit: true, haveListOfPatient: true,), - QueItem(queNo: "OBG-T45", isSecondLine: true, isNurseVisit: false, haveListOfPatient: true,), - ], + height: SizeConfig.getHeightMultiplier() * 5, ), + if (have3Patient) + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: const [ + QueItem( + queNo: "OBG-T45", + isSecondLine: true, + isNurseVisit: true, + haveListOfPatient: true, + ), + QueItem( + queNo: "OBG-T45", + isSecondLine: true, + isNurseVisit: false, + haveListOfPatient: true, + ), + ], + ), ], ); } From e1b39df1533d250301f8447e784bb3a221a52a63 Mon Sep 17 00:00:00 2001 From: RoaaGhali98 Date: Sun, 27 Mar 2022 12:41:46 +0300 Subject: [PATCH 6/6] Edit some design issues --- lib/core/config/config.dart | 3 +- lib/core/enum/font_enum.dart | 6 ++++ lib/home/home_screen.dart | 13 ++++---- lib/home/que_item/que_item.dart | 56 +++++++-------------------------- 4 files changed, 25 insertions(+), 53 deletions(-) diff --git a/lib/core/config/config.dart b/lib/core/config/config.dart index 31b19f0..7221b93 100644 --- a/lib/core/config/config.dart +++ b/lib/core/config/config.dart @@ -18,6 +18,7 @@ class AppGlobal { static Color appTextColor = const Color(0xFF2B353E); static Color scheduleTextColor = const Color(0xFF2E303A); static Color inProgressColor = const Color(0xFFCC9B14); - static Color appLightGreyColor = const Color(0xFF575757); + static Color appGreyColor = const Color(0xFF575757); + static Color appLightGreyColor = const Color(0xFFE6E6E6); } diff --git a/lib/core/enum/font_enum.dart b/lib/core/enum/font_enum.dart index e69de29..8852b2e 100644 --- a/lib/core/enum/font_enum.dart +++ b/lib/core/enum/font_enum.dart @@ -0,0 +1,6 @@ +enum FontType { + Poppins_Bold, + poppins_Medium, + poppins_Regular, + poppins_SemiBold, +} \ No newline at end of file diff --git a/lib/home/home_screen.dart b/lib/home/home_screen.dart index 17e6afb..101a14d 100644 --- a/lib/home/home_screen.dart +++ b/lib/home/home_screen.dart @@ -11,11 +11,10 @@ import 'package:queuing_system/widget/data_display/app_texts_widget.dart'; class MyHomePage extends StatefulWidget { - String title ="MyHomePage"; - bool haveOnePatient = false; - bool have3Patient = true; - bool haveListOfPatient = false; + bool haveOnePatient = true; + bool have3Patient = false; + bool haveListOfPatient = true; @override @@ -30,7 +29,7 @@ class _MyHomePageState extends State { appBar: AppHeader(), body: Column( children: [ - SizedBox(height: SizeConfig.getHeightMultiplier() * (widget.haveOnePatient?20: 3)), + SizedBox(height: SizeConfig.getHeightMultiplier() * (widget.haveOnePatient?20: 2)), widget.haveListOfPatient? Row( children: [ @@ -44,7 +43,7 @@ class _MyHomePageState extends State { Container( width: 10, height:SizeConfig.getHeightMultiplier()*40, - color: Colors.grey, + color: AppGlobal.appLightGreyColor, ), if(widget.haveListOfPatient) const SizedBox( @@ -58,7 +57,7 @@ class _MyHomePageState extends State { ), bottomSheet: Container( color: Colors.transparent, - height: Utils.getHeight(), + height: Utils.getHeight()* 0.9, width: double.infinity, child: Row( children: [ diff --git a/lib/home/que_item/que_item.dart b/lib/home/que_item/que_item.dart index c7b38d7..94020d5 100644 --- a/lib/home/que_item/que_item.dart +++ b/lib/home/que_item/que_item.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:queuing_system/core/config/config.dart'; import 'package:queuing_system/core/config/size_config.dart'; +import 'package:queuing_system/home/que_item/que_item_widget.dart'; import 'package:queuing_system/widget/data_display/app_texts_widget.dart'; class QueItem extends StatelessWidget { @@ -26,51 +27,16 @@ class QueItem extends StatelessWidget { Widget build(BuildContext context) { return haveListOfPatient? Padding( - padding: const EdgeInsets.all(30.0), + padding: const EdgeInsets.all(45.0), child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - AppText( - queNo, - fontSize: SizeConfig.getWidthMultiplier() * - (isFirstLine - ? 13 - : isSecondLine - ? 8.5 - : 5.5), - letterSpacing: -5.00, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins-Bold.ttf', + QueItemWidget( + isFirstLine: isFirstLine, + isNurseVisit: isNurseVisit, + isSecondLine: isSecondLine, + queNo: queNo, ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SvgPicture.asset( - isNurseVisit - ? "assets/images/nurseicon.svg" - : "assets/images/doctoricon.svg", height:(isFirstLine - ? 40 - : isSecondLine - ? 40 - : 40) ,), - const SizedBox(width: 8,), - AppText( - isNurseVisit ? "Please visit Nurse" : "Please visit doctor", - color: isNurseVisit - ? AppGlobal.appGreenColor - : AppGlobal.appRedColor, - fontSize: SizeConfig.getWidthMultiplier() * (isFirstLine - ? 3.3 - : isSecondLine - ? 3.3 - : 3.3), - letterSpacing: -2.6, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins-Bold.ttf', - ), - ], - ) ], ), ) @@ -100,14 +66,14 @@ class QueItem extends StatelessWidget { isNurseVisit ? "assets/images/nurseicon.svg" : "assets/images/doctoricon.svg", height:(isFirstLine - ? 40 + ? SizeConfig.getHeightMultiplier()*3 : isSecondLine - ? 40 - : 40) ,), + ? SizeConfig.getHeightMultiplier()*3 + : SizeConfig.getHeightMultiplier()*3) ,), const SizedBox(width: 8,), AppText( isNurseVisit ? " Please visit Nurse" : " Please visit doctor", - color: AppGlobal.appLightGreyColor, + color: AppGlobal.appGreyColor, fontSize: SizeConfig.getWidthMultiplier() * (isFirstLine ? 3.3 : isSecondLine