From 317742b55a9f4ead3dd2c9d950f7bee9eae37f77 Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Sun, 31 May 2020 11:56:45 +0300 Subject: [PATCH 1/4] Svg component --- assets/images/femaleIcon.svg | 18 +++++++++++++++ assets/images/profile.svg | 17 ++++++++++++++ lib/screens/patients/patients_screen.dart | 28 +++++++++++++++++------ pubspec.yaml | 4 +++- 4 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 assets/images/femaleIcon.svg create mode 100644 assets/images/profile.svg diff --git a/assets/images/femaleIcon.svg b/assets/images/femaleIcon.svg new file mode 100644 index 00000000..c08fc259 --- /dev/null +++ b/assets/images/femaleIcon.svg @@ -0,0 +1,18 @@ + + + + + + + + + + diff --git a/assets/images/profile.svg b/assets/images/profile.svg new file mode 100644 index 00000000..02b2dc19 --- /dev/null +++ b/assets/images/profile.svg @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index d945e38d..d9fe97c6 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/providers/patients_provider.dart'; import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; @@ -20,13 +21,13 @@ import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.d import 'package:doctor_app_flutter/widgets/shared/profile_image_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import '../../config/size_config.dart'; import 'package:hexcolor/hexcolor.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/card_with_bg_widget.dart'; - import 'package:doctor_app_flutter/config/config.dart'; class PatientsScreen extends StatefulWidget { @@ -45,6 +46,10 @@ class _PatientsScreenState extends State { Color sideColor = Colors.black; List responseModelList; List responseModelList2; + final String url = "assets/images/"; + final String avatarMale = 'profile.svg';//'user.svg'; + final String avatarFemale = 'femaleIcon.svg'; + final String assetName = 'assets/image.svg'; // List _locations = ['Today', 'Old Date', 'YESTERDAY']; List _locations = ['Today', 'Tomorrow', 'Next Week']; @@ -372,12 +377,21 @@ class _PatientsScreenState extends State { mainAxisAlignment: MainAxisAlignment .start, - children: [ - Image.network( - "https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png", - height: 100, - width: 100), - ], + children: + item.genderDescription == + "Male" + ? [ + SvgPicture.asset( + url + avatarMale, + semanticsLabel: + 'Male Logo') + ] + : [ + SvgPicture.asset( + url + avatarFemale, + semanticsLabel: + 'Female Logo') + ], ), Column( crossAxisAlignment: diff --git a/pubspec.yaml b/pubspec.yaml index df33348e..4336bacd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -37,7 +37,7 @@ dependencies: url_launcher: ^5.4.5 charts_flutter: ^0.9.0 eva_icons_flutter: ^2.0.0 - + # Qr code Scanner barcode_scan: ^3.0.1 # permissions @@ -49,6 +49,8 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.2 + # SVG + flutter_svg: ^0.17.4 percent_indicator: "^2.1.1" dev_dependencies: From d3c2efc45d249f2f1637c9dda518b0f67c3479eb Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Sun, 31 May 2020 16:32:11 +0300 Subject: [PATCH 2/4] svg avatar Icon and library --- assets/images/user_female.svg | 13 +++++++++++++ assets/images/user_male.svg | 11 +++++++++++ lib/screens/patients/patients_screen.dart | 18 ++++++++++++++---- 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 assets/images/user_female.svg create mode 100644 assets/images/user_male.svg diff --git a/assets/images/user_female.svg b/assets/images/user_female.svg new file mode 100644 index 00000000..4c9d8cd2 --- /dev/null +++ b/assets/images/user_female.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/images/user_male.svg b/assets/images/user_male.svg new file mode 100644 index 00000000..bdf4987f --- /dev/null +++ b/assets/images/user_male.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index d9fe97c6..87bc84a2 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -47,8 +47,8 @@ class _PatientsScreenState extends State { List responseModelList; List responseModelList2; final String url = "assets/images/"; - final String avatarMale = 'profile.svg';//'user.svg'; - final String avatarFemale = 'femaleIcon.svg'; + final String avatarMale = "user_male.svg"; //'working_male.svg';//'user.svg'; + final String avatarFemale = 'user_female.svg'; final String assetName = 'assets/image.svg'; // List _locations = ['Today', 'Old Date', 'YESTERDAY']; @@ -382,13 +382,23 @@ class _PatientsScreenState extends State { "Male" ? [ SvgPicture.asset( - url + avatarMale, + url + + avatarMale, + height: + 100.0, + width: + 100.0, semanticsLabel: 'Male Logo') ] : [ SvgPicture.asset( - url + avatarFemale, + url + + avatarFemale, + height: + 100.0, + width: + 100.0, semanticsLabel: 'Female Logo') ], From 33fe5e8263fe90a4653d9ce6bc434e822f6c4020 Mon Sep 17 00:00:00 2001 From: Mohammad ALjammal Date: Mon, 1 Jun 2020 10:31:41 +0300 Subject: [PATCH 3/4] create vital sign details --- lib/client/base_app_client.dart | 2 +- .../patients/vital_sign_details_wideget.dart | 13 ++++++++++++ pubspec.lock | 21 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 lib/widgets/patients/vital_sign_details_wideget.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 10164c4b..28c30e90 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -12,7 +12,7 @@ import 'package:http/http.dart'; *@Date:28/5/2020 *@param: url, onSuccess callBack, onFailure callBack *@return: - *@desc: convert DateTime to data formatted + *@desc: */ class BaseAppClient { static Client client = HttpInterceptor().getClient(); diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart new file mode 100644 index 00000000..adb3f1c8 --- /dev/null +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -0,0 +1,13 @@ +import 'package:flutter/cupertino.dart'; + +class VitalSignDetailsWidget extends StatefulWidget { + @override + _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); +} + +class _VitalSignDetailsWidgetState extends State { + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/pubspec.lock b/pubspec.lock index 7cf1a612..afe0aa60 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -277,6 +277,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.7" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.4" flutter_test: dependency: "direct dev" description: flutter @@ -462,6 +469,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.6.4" + path_drawing: + dependency: transitive + description: + name: path_drawing + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4" pedantic: dependency: transitive description: From bf094136ab1a488aa29dd946cf5e16d9f11ba700 Mon Sep 17 00:00:00 2001 From: Mohammad ALjammal Date: Mon, 1 Jun 2020 15:30:07 +0300 Subject: [PATCH 4/4] create vital sign details --- .../patients/vital_sign_details_wideget.dart | 107 +++++++++++++++++- 1 file changed, 106 insertions(+), 1 deletion(-) diff --git a/lib/widgets/patients/vital_sign_details_wideget.dart b/lib/widgets/patients/vital_sign_details_wideget.dart index adb3f1c8..35e85699 100644 --- a/lib/widgets/patients/vital_sign_details_wideget.dart +++ b/lib/widgets/patients/vital_sign_details_wideget.dart @@ -1,6 +1,18 @@ +import 'package:doctor_app_flutter/models/patient/vital_sign_res_model.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; class VitalSignDetailsWidget extends StatefulWidget { + final List vitalList; + final String title1; + final String title2; + final String viewKey; + + VitalSignDetailsWidget({Key key, this.vitalList, this.title1, this.title2,this.viewKey}); + @override _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); } @@ -8,6 +20,99 @@ class VitalSignDetailsWidget extends StatefulWidget { class _VitalSignDetailsWidgetState extends State { @override Widget build(BuildContext context) { - return Container(); + return Container( + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + margin: EdgeInsets.all(20), + child: Container( + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + widget.title1, + color: Colors.white, + ), + ), + height: 60, + ), + ), + Expanded( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts(widget.title2, color: Colors.white), + ), + height: 60), + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: widget.vitalList.map((vital) { + return Column( + children: [ + Row( + children: [ + Expanded( + child: Container( + height: 50, + color: Colors.white, + child: Center( + child: Texts( + '${Helpers.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${Helpers.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + textAlign: TextAlign.center, + ), + ), + ), + ), + SizedBox( + width: 2, + ), + Expanded( + child: Container( + height: 50, + color: Colors.white, + child: Center( + child: Texts( + '${vital.toJson()[widget.viewKey]}', + textAlign: TextAlign.center, + ), + ), + ), + ), + ], + ), + SizedBox( + height: 2, + ), + ], + ); + }).toList(), + ), + ], + ), + ), + ); } }