From 35412fb0a5bee3b04fd64d18641196643c61a5f5 Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Tue, 28 Apr 2020 18:15:44 +0300 Subject: [PATCH 1/2] patient screen header --- lib/screens/patients/patients_screen.dart | 57 +++++++++++++++++++++-- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 5365e27e..99d51bf8 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -33,7 +33,9 @@ class _PatientsScreenState extends State { List litems; //******************* List responseModelList; - //List> litems2; + List _locations =['Today','Tomorrow','Next Week']; + int _activeLocation=0; + //******************* @@ -102,6 +104,13 @@ class _PatientsScreenState extends State { Container( //child:litems == null?Column():Column(children: [ child:litems == null?Column():Column(children: [ + //*********change to test screen************* */ + // child:Column(children: [ + Padding(padding: + EdgeInsets.only(top:MediaQuery.of(context).size.height*0.03), + + child:_locationBar(context),), + SizedBox(height: 10.0), Container( width: SizeConfig.screenWidth * 0.80, child: TextField( @@ -123,7 +132,7 @@ class _PatientsScreenState extends State { line1Text:item.nationalityName,//item['FirstName'],//patient.getFirstName(),//item['FirstName'], line2Text:item.lastName, //responseModelList['LastName'],//item['LastName'],//'12/04/2020 - 02:00 PM', line3Text: item.middleName, - heightPercentage: 0.15, + heightPercentage: MediaQuery.of(context).size.height*0.00025, widthPercentage: 0.80), onTap: (){ Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {"patient": responseModelList}); @@ -163,10 +172,50 @@ class _PatientsScreenState extends State { )); } //************* + Widget _locationBar(BuildContext _context){ + //********* + + //********* + return Container( + height: MediaQuery.of(context).size.height*0.065, + width:SizeConfig.screenWidth * 0.80, + decoration: BoxDecoration( + color:Color(0Xff59434f),//Color.fromARGB(89, 67, 79,0), + borderRadius: BorderRadius.circular(20) + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly,mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((l){ + bool _isActive=_locations[_activeLocation]==l ? true : false ; + return Column( + mainAxisSize: MainAxisSize.min, + children: [InkWell(child:Text(l , + style:TextStyle(fontSize: 15,color:Colors.white,fontWeight:FontWeight.bold), + ), + onTap: () { + print(l); + print(_locations.indexOf(l)); + setState(() { + _activeLocation=_locations.indexOf(l); + }); + } + + ), + + _isActive? Container( + decoration: BoxDecoration(borderRadius: BorderRadius.circular(10), + color: Colors.white), + height: 3, + width: 80, + ):Container() + ]); + }).toList(), + )); + } } //*********************** - - + //************************************ class CustomShapeClipper extends CustomClipper { @override Path getClip(Size size) { From 50b8d543bee9568bbf6b2d847a88d7c2c7577163 Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Tue, 28 Apr 2020 22:23:31 +0300 Subject: [PATCH 2/2] Patiant search filter design --- .../patient}/patiant_info_model.dart | 0 .../patient/topten_users_res_model.dart} | 15 +++--- lib/providers/patients_provider.dart | 3 +- lib/screens/patients/patients_screen.dart | 18 +++---- .../profile/vital_sign/vital_sign_screen.dart | 3 +- .../profile/Profile_general_info_Widget.dart | 3 +- .../profile/patient_profile_widget.dart | 3 +- .../profile/profile_header_widget.dart | 3 +- .../profile/profile_medical_info_widget.dart | 3 +- pubspec.lock | 49 +++++++++++-------- 10 files changed, 56 insertions(+), 44 deletions(-) rename lib/{screens/patients => models/patient}/patiant_info_model.dart (100%) rename lib/{screens/patients/TopTenUsersModelResponse.dart => models/patient/topten_users_res_model.dart} (54%) diff --git a/lib/screens/patients/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart similarity index 100% rename from lib/screens/patients/patiant_info_model.dart rename to lib/models/patient/patiant_info_model.dart diff --git a/lib/screens/patients/TopTenUsersModelResponse.dart b/lib/models/patient/topten_users_res_model.dart similarity index 54% rename from lib/screens/patients/TopTenUsersModelResponse.dart rename to lib/models/patient/topten_users_res_model.dart index ba4a5d97..3454568f 100644 --- a/lib/screens/patients/TopTenUsersModelResponse.dart +++ b/lib/models/patient/topten_users_res_model.dart @@ -7,23 +7,24 @@ *@desc: */ -import 'package:doctor_app_flutter/screens/patients/patiant_info_model.dart'; -class TopTenUsersModelResponse { +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +//ModelResponse +class ModelResponse { final List list; String firstName; - TopTenUsersModelResponse({ + ModelResponse({ this.list, this.firstName, }); - factory TopTenUsersModelResponse.fromJson(List parsedJson) { + factory ModelResponse.fromJson(List parsedJson) { - // List list = new List(); + List list = new List(); - //PatiantInformtion + list = parsedJson.map((i) => PatiantInformtion.fromJson(i)).toList(); - return new TopTenUsersModelResponse(list: list); + return new ModelResponse(list: list); } } diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index 1baf7786..69309178 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -1,5 +1,6 @@ import 'dart:convert'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart'; import 'package:http_interceptor/http_client_with_interceptor.dart'; @@ -8,7 +9,7 @@ import '../config/config.dart'; import '../interceptor/http_interceptor.dart'; import '../models/patient/patient_model.dart'; import '../models/patient/vital_sign_res_model.dart'; -import '../screens/patients/patiant_info_model.dart'; + import '../util/helpers.dart'; const GET_PATIENT_VITAL_SIGN = diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 30f88160..8b342581 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -6,11 +6,12 @@ *@desc: */ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; 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/screens/patients/TopTenUsersModelResponse.dart'; -import 'package:doctor_app_flutter/screens/patients/patiant_info_model.dart'; + import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -70,16 +71,13 @@ class _PatientsScreenState extends State { print('List_MyInPatient${(res['List_MyInPatient'])}'); setState(() { int val2 = int.parse(patientType); - litems = res[SERVICES_PATIANT2[val2]]; //res['List_MyInPatient']; + litems = res[SERVICES_PATIANT2[val2]]; //******************** - // litems2=res[SERVICES_PATIANT2[val2]]; - //PatiantInformtion - //List responseModelList = new PatiantInformtion.fromJson(litems).;//TopTenUsersModelResponse.fromJson(parsed).list; - final List parsed = litems; //json.decode(response.body); - //List responseModelList = new TopTenUsersModelResponse.fromJson(parsed).list; - // List responseModelList = new TopTenUsersModelResponse.fromJson(parsed).list; + + final List parsed = litems; + responseModelList = - new TopTenUsersModelResponse.fromJson(parsed).list; + new ModelResponse.fromJson(parsed).list; //******************** _isLoading = false; _hasError = res['ErrorEndUserMessage']; diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart index ab36a618..b5d6a23b 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -6,7 +7,7 @@ import 'package:provider/provider.dart'; import '../../../../config/shared_pref_kay.dart'; import '../../../../models/patient/vital_sign_req_model.dart'; import '../../../../providers/patients_provider.dart'; -import '../../../../screens/patients/patiant_info_model.dart'; + import '../../../../util/dr_app_shared_pref.dart'; import '../../../../widgets/shared/app_scaffold_widget.dart'; import '../../../../widgets/shared/card_with_bg_widget.dart'; diff --git a/lib/widgets/patients/profile/Profile_general_info_Widget.dart b/lib/widgets/patients/profile/Profile_general_info_Widget.dart index 767e5377..53b46884 100644 --- a/lib/widgets/patients/profile/Profile_general_info_Widget.dart +++ b/lib/widgets/patients/profile/Profile_general_info_Widget.dart @@ -1,5 +1,6 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/providers/patients_provider.dart'; -import 'package:doctor_app_flutter/screens/patients/patiant_info_model.dart'; + import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index 5dd70fb9..72d287b0 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -1,4 +1,5 @@ -import 'package:doctor_app_flutter/screens/patients/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + import 'package:flutter/material.dart'; import './Profile_general_info_Widget.dart'; diff --git a/lib/widgets/patients/profile/profile_header_widget.dart b/lib/widgets/patients/profile/profile_header_widget.dart index bceb8bfe..a745cf88 100644 --- a/lib/widgets/patients/profile/profile_header_widget.dart +++ b/lib/widgets/patients/profile/profile_header_widget.dart @@ -1,5 +1,6 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/providers/patients_provider.dart'; -import 'package:doctor_app_flutter/screens/patients/patiant_info_model.dart'; + import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 80175001..1621438c 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -1,5 +1,6 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.dart'; -import 'package:doctor_app_flutter/screens/patients/patiant_info_model.dart'; + import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; diff --git a/pubspec.lock b/pubspec.lock index 8cd1be91..f0f825ee 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -35,7 +35,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.1" + version: "2.4.0" bazel_worker: dependency: transitive description: @@ -49,7 +49,7 @@ packages: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "1.0.5" build: dependency: transitive description: @@ -126,7 +126,7 @@ packages: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.3" + version: "1.1.2" checked_yaml: dependency: transitive description: @@ -134,13 +134,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.2" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" code_builder: dependency: transitive description: @@ -154,7 +147,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.12" + version: "1.14.11" connectivity: dependency: "direct main" description: @@ -211,13 +204,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.4" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" fixnum: dependency: transitive description: @@ -324,6 +310,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.9.10" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.4" imei_plugin: dependency: "direct main" description: @@ -421,7 +414,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.6.4" pedantic: dependency: transitive description: @@ -436,6 +429,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.1+1" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" platform: dependency: transitive description: @@ -580,7 +580,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.5.5" stack_trace: dependency: transitive description: @@ -622,7 +622,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.15" + version: "0.2.11" timing: dependency: transitive description: @@ -658,6 +658,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "3.5.0" yaml: dependency: transitive description: