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 19901ba9..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'; @@ -34,7 +35,9 @@ class _PatientsScreenState extends State { List litems; //******************* List responseModelList; - //List> litems2; + List _locations = ['Today', 'Tomorrow', 'Next Week']; + int _activeLocation = 0; + //******************* bool _isInit = true; @@ -68,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']; @@ -99,15 +99,21 @@ class _PatientsScreenState extends State { appBarTitle: 'Patients', //***********Modify by amjad (create List view to insert all new data webservise in scroll )************* body: Container( - child: ListView( - scrollDirection: Axis.vertical, - children: [ - Container( + child: ListView(scrollDirection: Axis.vertical, children: [ + 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,43 +129,43 @@ class _PatientsScreenState extends State { ), ), Column( - children: - responseModelList.map((PatiantInformtion item) { - return InkWell( - child: CardWithBgWidget( - widget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - item.nationalityName, - fontSize: 2.5 * SizeConfig.textMultiplier, - ), - SizedBox( - height: 8, - ), - AppText(item.lastName, - fontSize: - 2.5 * SizeConfig.textMultiplier), - SizedBox( - height: 8, - ), - AppText(item.middleName, - fontSize: - 2.5 * SizeConfig.textMultiplier), - ], + children: + responseModelList.map((PatiantInformtion item) { + return InkWell( + child: CardWithBgWidget( + widget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + item.nationalityName, + fontSize: 2.5 * SizeConfig.textMultiplier, + ), + SizedBox( + height: 8, + ), + AppText(item.lastName, + fontSize: + 2.5 * SizeConfig.textMultiplier), + SizedBox( + height: 8, + ), + AppText(item.middleName, + fontSize: + 2.5 * SizeConfig.textMultiplier), + ], + ), ), - ), - onTap: () { - Navigator.of(context).pushNamed(PATIENTS_PROFILE, - arguments: {"patient": item}); - }, - ); - }).toList()) + onTap: () { + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: {"patient": item}); + }, + ); + }).toList(), + ), ], - ), - ), - ], - ))); + )) + ]))); } //***********amjad update************* @@ -185,6 +191,52 @@ class _PatientsScreenState extends State { borderSide: BorderSide(color: Theme.of(context).primaryColor), )); } + //************* + 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(), + )); + } } //*********************** 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: