Merge branch 'medicine_desgin' into 'development'

Medicine desgin

See merge request Cloud_Solution/doctor_app_flutter!160
pull/163/head
Elham 4 years ago
commit 3bf9467915

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

@ -142,4 +142,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69
COCOAPODS: 1.10.0.beta.1 COCOAPODS: 1.9.3

@ -1,17 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/interceptor/http_interceptor.dart';
import 'package:http/http.dart';
// OWNER : Ibrahim albitar
// DATE : 22-04-2020
// DESCRIPTION : Custom App client to pin base url for all srvices
class AppClient {
static Client client = HttpInterceptor().getClient();
static Future<Response> post(dynamic path, {dynamic body}) async {
String _fullUrl = BASE_URL + path;
final response = await client.post(_fullUrl, body: body);
return response;
}
}

@ -59,7 +59,7 @@ class BaseAppClient {
body['stamp'] = STAMP; body['stamp'] = STAMP;
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;
if (body['Channel'] == null) body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
body['SessionID'] = SESSION_ID; body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
body['PatientOutSA'] = 0; // PATIENT_OUT_SA; body['PatientOutSA'] = 0; // PATIENT_OUT_SA;

@ -2,8 +2,8 @@ const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]"; const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL = 'https://hmgwebservices.com/'; //const BASE_URL = 'https://hmgwebservices.com/';
//const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh";
const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList";
const PATIENT_PROGRESS_NOTE_URL = const PATIENT_PROGRESS_NOTE_URL =

@ -56,11 +56,8 @@ const Map<String, Map<String, String>> localizedValues = {
'en': 'Only Arrived Patient', 'en': 'Only Arrived Patient',
'ar': 'المريض الذي حضر للموعد' 'ar': 'المريض الذي حضر للموعد'
}, },
'searchMedicineNameHere': { 'searchMedicineNameHere': {'en': 'Search Medicine ', 'ar': 'ابحث هنا'},
'en': 'Search Medicine Name Here', 'youCanFind': {'en': 'You Can Find ', 'ar': 'تستطيع ان تجد '},
'ar': 'ابحث عن الدواء هنا'
},
'youCanFind': {'en': 'You Can Find', 'ar': 'تستطيع ان تجد '},
'itemsInSearch': {'en': 'items in search', 'ar': 'عناصر في البحث'}, 'itemsInSearch': {'en': 'items in search', 'ar': 'عناصر في البحث'},
'qrReader': {'en': 'QR Reader', 'ar': 'قارىء رمز الQR'}, 'qrReader': {'en': 'QR Reader', 'ar': 'قارىء رمز الQR'},
'startScanning': {'en': 'Start Scanning', 'ar': 'بدء المسح'}, 'startScanning': {'en': 'Start Scanning', 'ar': 'بدء المسح'},
@ -220,4 +217,19 @@ const Map<String, Map<String, String>> localizedValues = {
'endcallwithcharge': {'en': 'End with charge', 'ar': 'ينتهي مع الشحن'}, 'endcallwithcharge': {'en': 'End with charge', 'ar': 'ينتهي مع الشحن'},
'endcall': {'en': 'End Call', 'ar': 'إنهاء المكالمة'}, 'endcall': {'en': 'End Call', 'ar': 'إنهاء المكالمة'},
'transfertoadmin': {'en': 'Transfer to admin', 'ar': 'نقل إلى المسؤول'}, 'transfertoadmin': {'en': 'Transfer to admin', 'ar': 'نقل إلى المسؤول'},
"searchMedicineImageCaption": {
'en': 'Type or speak the medicine name to search',
'ar': ' اكتب أو انطق اسم الدواء للبحث'
},
"type": {'en': 'Type or Speak', 'ar': 'اكتب أو تحدث '},
"fromDate": {'en': 'From Date', 'ar': 'من تاريخ'},
"toDate": {'en': 'To Date', 'ar': 'الى تاريخ'},
"searchPatientImageCaptionTitle": {
'en': 'SEARCH PATIENT',
'ar': 'البحث عن المريض'
},
"searchPatientImageCaptionBody": {
'en': 'Add Details Of Patient To search',
'ar': ' أضف تفاصيل المريض للبحث'
},
}; };

@ -1,65 +0,0 @@
import 'dart:convert';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/providers/auth_provider.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:http/http.dart';
import 'package:http_interceptor/http_interceptor.dart';
import '../providers/auth_provider.dart';
import '../util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/config/config.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
List<String> publicUrls = [
LOGIN_URL,
SELECT_DEVICE_IMEI,
MEMBER_CHECK_ACTIVATION_CODE_NEW,
SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE
];
class HttpInterceptor extends InterceptorContract {
Client getClient() {
return HttpClientWithInterceptor.build(interceptors: [this]);
}
Future<RequestData> interceptRequest({RequestData data}) async {
print('RequestData ${data.body}');
print('RequestData ${data.url}');
try {
data.headers["Content-Type"] = "application/json";
data.headers["Accept"] = "application/json";
// if (publicUrls.contains(data.url)) {
// var loggedUserInfo = await sharedPref.getObj(LOGGED_IN_USER);
// var token = await sharedPref.getString(TOKEN);
// // print("token"+token);
// // print('loggedUserInfo${loggedUserInfo["LogInTokenID"]}');
// // // the sevices handel the token in differat name so I ask to be change
// // // we must change the imple
// var body = json.decode(data.body);
// body['LogInTokenID']=token;
// data.body = json.encode(body);
// // data.body['LogInTokenID'] = '';
// } else {
// if (data.body['LogInTokenID']) {
// data.body['LogInTokenID'] = '';
// }
// if (data.body['TokenID']) {
// data.body['TokenID'] = '';
// }
// }
} catch (e) {
print(e);
}
// print('data.body${data.body}');
return data;
}
@override
Future<ResponseData> interceptResponse({ResponseData data}) async {
// print('ResponseData ${data.body}');
return data;
}
}

@ -41,7 +41,7 @@ class _LandingPageState extends State<LandingPage> {
backgroundColor: Hexcolor('#515B5D'), backgroundColor: Hexcolor('#515B5D'),
textTheme: TextTheme( textTheme: TextTheme(
headline6: headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold)), TextStyle(color: Colors.white)),
title: Text(getText(currentTab).toUpperCase()), title: Text(getText(currentTab).toUpperCase()),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {

@ -1,6 +1,5 @@
import 'dart:convert'; import 'dart:convert';
import 'package:doctor_app_flutter/client/app_client.dart';
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';

@ -85,7 +85,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
Column( Column(
children: <Widget>[ children: <Widget>[
Container( Container(
height: 150, height: 140,
color: Hexcolor('#515B5D'), color: Hexcolor('#515B5D'),
width: double.infinity, width: double.infinity,
child: FractionallySizedBox( child: FractionallySizedBox(
@ -101,7 +101,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: <Widget>[ children: <Widget>[
AppText( AppText(
"Welcome", "Welcome",
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.white, color: Colors.white,
) )
], ],
@ -130,7 +130,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
: authProvider.doctorProfile : authProvider.doctorProfile
.clinicDescription, .clinicDescription,
fontSize: fontSize:
SizeConfig.textMultiplier * 2, SizeConfig.textMultiplier * 1.7,
color: Colors.white, color: Colors.white,
), ),
alignment: projectsProvider.isArabic alignment: projectsProvider.isArabic
@ -201,14 +201,14 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
Container( Container(
color: Colors.white, color: Colors.white,
height: 150, height: 90,
), ),
], ],
), ),
Positioned( Positioned(
right: 0.0, right: 9.0,
left: 0, left: 9,
bottom: 40, bottom: 19,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor("#DED8CF"), color: Hexcolor("#DED8CF"),
@ -376,10 +376,11 @@ class _DashboardScreenState extends State<DashboardScreen> {
) )
]), ]),
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.95, widthFactor: 0.90,
child: Container( child: Container(
color: Colors.white, color: Colors.white,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -544,7 +545,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
width: MediaQuery width: MediaQuery
.of(context) .of(context)
.size .size
.width * 0.45, .width * 0.44,
height: MediaQuery height: MediaQuery
.of(context) .of(context)
.orientation == Orientation.portrait .orientation == Orientation.portrait
@ -598,7 +599,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
width: MediaQuery width: MediaQuery
.of(context) .of(context)
.size .size
.width * 0.45, .width * 0.44,
height: MediaQuery height: MediaQuery
.of(context) .of(context)
.orientation == Orientation.portrait .orientation == Orientation.portrait

@ -1,10 +1,12 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart'; import 'package:doctor_app_flutter/providers/medicine_provider.dart';
import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -13,7 +15,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../util/extenstions.dart'; import '../../util/extenstions.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
@ -89,14 +90,43 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).searchMedicine, appBarTitle: TranslationBase.of(context).searchMedicine,
body: Column( body: FractionallySizedBox(
widthFactor: 0.97,
child: ListView(
children: <Widget>[
Column(
children: <Widget>[ children: <Widget>[
Container(
child: Icon(
DoctorApp.medicinesearch,
size: 100,
color: Colors.black,
),
margin: EdgeInsets.only(top: 50),
),
Padding( Padding(
padding: EdgeInsets.only( padding: const EdgeInsets.only(top: 12.0),
bottom: SizeConfig.heightMultiplier * 1, child: AppText(
right: SizeConfig.heightMultiplier * 2, TranslationBase.of(context).type.toUpperCase(),
left: SizeConfig.heightMultiplier * 2, fontWeight: FontWeight.bold,
top: SizeConfig.heightMultiplier * 3), fontSize: SizeConfig.heightMultiplier * 2.5,
),
),
Padding(
padding: const EdgeInsets.only(top: 5.0),
child: AppText(
TranslationBase.of(context).searchMedicineImageCaption,
fontSize: SizeConfig.heightMultiplier * 2,
),
)
],
),
SizedBox(height: 15,),
FractionallySizedBox(
widthFactor: 0.9,
child: Column(
children: <Widget>[
Container(
child: AppTextFormField( child: AppTextFormField(
hintText: TranslationBase.of(context).searchMedicineNameHere, hintText: TranslationBase.of(context).searchMedicineNameHere,
controller: myController, controller: myController,
@ -119,18 +149,16 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
}), }),
inputFormatter: ONLY_LETTERS), inputFormatter: ONLY_LETTERS),
), ),
SizedBox(height: 15,),
Container( Container(
margin: EdgeInsets.only(
bottom: SizeConfig.heightMultiplier * 1,
right: SizeConfig.heightMultiplier * 2,
left: SizeConfig.heightMultiplier * 2,
top: SizeConfig.heightMultiplier * 1),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: TranslationBase.of(context).search, title: TranslationBase
color: Color(PRIMARY_COLOR), .of(context)
.search,
onPressed: () { onPressed: () {
searchMedicine(context); searchMedicine(context);
}, },
@ -144,21 +172,20 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).youCanFind + TranslationBase
(_medicineProvider.pharmacyItemsList == null .of(context)
? "0" .youCanFind +
: _medicineProvider.pharmacyItemsList.length _medicineProvider.pharmacyItemsList.length
.toString()) + .toString() +" "+
TranslationBase.of(context).itemsInSearch, TranslationBase
.of(context)
.itemsInSearch,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
margin: 5,
), ),
], ],
), ),
), ),
Expanded( Container(
child: Container(
width: SizeConfig.screenWidth * 0.90,
child: !_medicineProvider.isFinished child: !_medicineProvider.isFinished
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: _medicineProvider.hasError : _medicineProvider.hasError
@ -184,7 +211,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
["ItemDescription"], ["ItemDescription"],
url: url:
_medicineProvider.pharmacyItemsList[index] _medicineProvider.pharmacyItemsList[index]
["ImageThumbUrl"], ["ProductImageBase64"],
), ),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -205,8 +232,12 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
}, },
), ),
), ),
],
),
), ),
], ],
),
)); ));
} }

@ -1,26 +1,27 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../config/config.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
import '../../lookups/patient_lookup.dart';
import '../../models/doctor/doctor_profile_model.dart';
import '../../widgets/patients/dynamic_elements.dart';
import '../../widgets/shared/app_buttons_widget.dart'; import '../../widgets/shared/app_buttons_widget.dart';
import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart';
import '../../widgets/shared/app_text_form_field.dart'; import '../../widgets/shared/app_text_form_field.dart';
import '../../widgets/shared/app_texts_widget.dart'; import '../../widgets/shared/app_texts_widget.dart';
import '../../widgets/shared/rounded_container_widget.dart'; import '../../widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import '../../lookups/patient_lookup.dart';
import '../../widgets/patients/dynamic_elements.dart';
import '../../config/config.dart';
import '../../models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:provider/provider.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = Helpers(); Helpers helpers = Helpers();
@ -126,10 +127,35 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
RoundedContainer( RoundedContainer(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Icon( Column(
Icons.search, children: <Widget>[
size: SizeConfig.imageSizeMultiplier * 15, Container(
child: Icon(
DoctorApp.search_patient,
size: 100,
color: Colors.black,
), ),
margin: EdgeInsets.only(top: 10),
),
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: AppText(
TranslationBase.of(context).searchPatientImageCaptionTitle.toUpperCase(),
fontWeight: FontWeight.bold,
fontSize: SizeConfig.heightMultiplier * 2.5,
),
),
Padding(
padding: const EdgeInsets.only(top: 5.0),
child: AppText(
TranslationBase.of(context)
.searchPatientImageCaptionBody,
fontSize: SizeConfig.heightMultiplier * 2,
),
)
],
),
Container( Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
width: SizeConfig.screenWidth * 1, width: SizeConfig.screenWidth * 1,
@ -143,20 +169,18 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
height: 5, height: 5,
), ),
Container( Container(
height: 40.0,
decoration: ShapeDecoration( decoration: ShapeDecoration(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: BorderSide( side: BorderSide(
width: 1.0, width: 1.0,
style: BorderStyle.solid, style: BorderStyle.solid,
color: Color(0xff707070)), color: Hexcolor("#CCCCCC")),
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(5.0)), BorderRadius.all(Radius.circular(6.0)),
), ),
), ),
// margin: 0,
// showBorder: true,
// raduis: 30,
// borderColor: Color(0xff707070),
width: double.infinity, width: double.infinity,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
@ -173,7 +197,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
child: DropdownButton( child: DropdownButton(
isExpanded: true, isExpanded: true,
value: _selectedType, value: _selectedType,
iconSize: 40, iconSize: 25,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder:
(BuildContext context) { (BuildContext context) {
@ -198,7 +222,8 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
); );
}).toList(); }).toList();
}, },
onChanged: (String newValue) => { onChanged: (String newValue) =>
{
setState(() { setState(() {
_selectedType = newValue; _selectedType = newValue;
selectedPatientType = selectedPatientType =
@ -226,8 +251,21 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppTextFormField( Container(
hintText: TranslationBase.of(context).firstName, decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))
),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: TranslationBase
.of(context)
.firstName,
borderColor: Colors.white,
onSaved: (value) { onSaved: (value) {
value == null value == null
? _patientSearchFormValues.setFirstName = ? _patientSearchFormValues.setFirstName =
@ -235,7 +273,10 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
: _patientSearchFormValues.setFirstName = : _patientSearchFormValues.setFirstName =
value; value;
if (value.toString().trim().isEmpty) { if (value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues.setFirstName = "0"; _patientSearchFormValues.setFirstName = "0";
} }
}, },
@ -243,49 +284,90 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
// return TextValidator().validateName(value); // return TextValidator().validateName(value);
// }, // },
inputFormatter: ONLY_LETTERS), inputFormatter: ONLY_LETTERS),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppTextFormField( Container(
hintText: TranslationBase.of(context).middleName, decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))
),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: TranslationBase
.of(context)
.middleName,
borderColor: Colors.white,
onSaved: (value) { onSaved: (value) {
value == null value == null
? _patientSearchFormValues.setMiddleName = ? _patientSearchFormValues.setMiddleName =
"0" "0"
: _patientSearchFormValues.setMiddleName = : _patientSearchFormValues.setMiddleName =
value; value;
if (value.toString().trim().isEmpty) { if (value
_patientSearchFormValues.setMiddleName = "0"; .toString()
.trim()
.isEmpty) {
_patientSearchFormValues.setMiddleName =
"0";
} }
}, },
// validator: (value) { // validator: (value) {
// return TextValidator().validateName(value); // return TextValidator().validateName(value);
// }, // },
inputFormatter: ONLY_LETTERS), inputFormatter: ONLY_LETTERS),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppTextFormField( Container(
hintText: TranslationBase.of(context).lastName, decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))
),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: TranslationBase
.of(context)
.lastName,
borderColor: Colors.white,
onSaved: (value) { onSaved: (value) {
value == null value == null
? _patientSearchFormValues.setLastName = "0" ?
_patientSearchFormValues.setLastName = "0"
: _patientSearchFormValues.setLastName = : _patientSearchFormValues.setLastName =
value; value;
if (value.toString().trim().isEmpty) { if (value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues.setLastName = "0"; _patientSearchFormValues.setLastName = "0";
} }
}, },
inputFormatter: ONLY_LETTERS), inputFormatter: ONLY_LETTERS),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppTextFormField( Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))
),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: TranslationBase
.of(context)
.phoneNumber,
borderColor: Colors.white,
textInputType: TextInputType.number, textInputType: TextInputType.number,
hintText: TranslationBase.of(context).phoneNumber,
// validator: (value) {
// return TextValidator().validateMobile(value);
// },
inputFormatter: ONLY_NUMBERS, inputFormatter: ONLY_NUMBERS,
onSaved: (value) { onSaved: (value) {
value == null value == null
@ -294,44 +376,68 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
: _patientSearchFormValues : _patientSearchFormValues
.setPatientMobileNumber = value; .setPatientMobileNumber = value;
if (value.toString().trim().isEmpty) { if (value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues _patientSearchFormValues
.setPatientMobileNumber = "0"; .setPatientMobileNumber = "0";
} }
}, },
), ),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppTextFormField( Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))
),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: TranslationBase
.of(context)
.patientID,
borderColor: Colors.white,
textInputType: TextInputType.number, textInputType: TextInputType.number,
hintText: TranslationBase.of(context).patientID,
//
inputFormatter: ONLY_NUMBERS, inputFormatter: ONLY_NUMBERS,
onSaved: (value) { onSaved: (value) {
// _patientSearchFormValues.PatientID = 89000;
value == null value == null
? _patientSearchFormValues.setPatientID = 0 ?
_patientSearchFormValues.setPatientID = 0
: _patientSearchFormValues.setPatientID = : _patientSearchFormValues.setPatientID =
int.parse(value); int.parse(value);
if (value.toString().trim().isEmpty) { if (value
.toString()
.trim()
.isEmpty) {
_patientSearchFormValues.setPatientID = 0; _patientSearchFormValues.setPatientID = 0;
} }
}), }),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppTextFormField( Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))
),
padding: EdgeInsets.only(top: 5),
child: AppTextFormField(
labelText: TranslationBase
.of(context)
.patientFile,
borderColor: Colors.white,
textInputType: TextInputType.number, textInputType: TextInputType.number,
hintText: TranslationBase.of(context).patientFile,
// validator: (value) {
// return TextValidator().validateIdNumber(value);
// },
inputFormatter: ONLY_NUMBERS, inputFormatter: ONLY_NUMBERS,
onSaved: (value) { onSaved: (value) {},
//_patientSearchFormValues. = value; ),
},
), ),
(!(_selectedType == '2' || _selectedType == '4')) (!(_selectedType == '2' || _selectedType == '4'))
? DynamicElements(_patientSearchFormValues) ? DynamicElements(_patientSearchFormValues)
@ -342,18 +448,15 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
height: 10, height: 10,
), ),
Container( Container(
// margin: 0, height: 40.0,
// showBorder: true,
// raduis: 30,
// borderColor: Color(0xff707070),
decoration: ShapeDecoration( decoration: ShapeDecoration(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
side: BorderSide( side: BorderSide(
width: 1.0, width: 1.0,
style: BorderStyle.solid, style: BorderStyle.solid,
color: Color(0xff707070)), color: Hexcolor("#CCCCCC")),
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(5.0)), BorderRadius.all(Radius.circular(6.0)),
), ),
), ),
width: double.infinity, width: double.infinity,
@ -372,7 +475,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
child: DropdownButton( child: DropdownButton(
isExpanded: true, isExpanded: true,
value: _selectedLocation, value: _selectedLocation,
iconSize: 40, iconSize: 25,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder:
(BuildContext context) { (BuildContext context) {
@ -420,18 +523,36 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
), ),
), ),
), ),
SizedBox(
height: 10,
),
Container( Container(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Checkbox( Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: Hexcolor("#CCCCCC"))
),
height: 25,
width: 25,
child: Checkbox(
value: true, value: true,
activeColor: Color(0xffFFDDD9), checkColor: Hexcolor("#2A930A"),
activeColor: Colors.white,
onChanged: (bool newValue) {}), onChanged: (bool newValue) {}),
),
SizedBox(width: 12,),
AppText( AppText(
TranslationBase.of(context) TranslationBase
.of(context)
.onlyArrivedPatient, .onlyArrivedPatient,
fontSize: SizeConfig.textMultiplier * 2), fontSize: SizeConfig.textMultiplier *
2),
])), ])),
SizedBox( SizedBox(
height: 10, height: 10,
@ -450,7 +571,6 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
children: <Widget>[ children: <Widget>[
AppButton( AppButton(
title: TranslationBase.of(context).search, title: TranslationBase.of(context).search,
color: Color(0xff58434F),
onPressed: () { onPressed: () {
_validateInputs(); _validateInputs();
}, },

@ -233,14 +233,35 @@ class TranslationBase {
String get livecare => localizedValues['livecare'][locale.languageCode]; String get livecare => localizedValues['livecare'][locale.languageCode];
String get beingBad => localizedValues['beingBad'][locale.languageCode]; String get beingBad => localizedValues['beingBad'][locale.languageCode];
String get beingGreat => localizedValues['beingGreat'][locale.languageCode]; String get beingGreat => localizedValues['beingGreat'][locale.languageCode];
String get cancel => localizedValues['cancel'][locale.languageCode]; String get cancel => localizedValues['cancel'][locale.languageCode];
String get done => localizedValues['done'][locale.languageCode]; String get done => localizedValues['done'][locale.languageCode];
String get searchMedicineImageCaption =>
localizedValues['searchMedicineImageCaption'][locale.languageCode];
String get type => localizedValues['type'][locale.languageCode];
String get resumecall => localizedValues['resumecall'][locale.languageCode]; String get resumecall => localizedValues['resumecall'][locale.languageCode];
String get endcallwithcharge => String get endcallwithcharge =>
localizedValues['endcallwithcharge'][locale.languageCode]; localizedValues['endcallwithcharge'][locale.languageCode];
String get endcall => localizedValues['endcall'][locale.languageCode]; String get endcall => localizedValues['endcall'][locale.languageCode];
String get transfertoadmin => String get transfertoadmin =>
localizedValues['transfertoadmin'][locale.languageCode]; localizedValues['transfertoadmin'][locale.languageCode];
String get fromDate => localizedValues['toDate'][locale.languageCode];
String get toDate => localizedValues['toDate'][locale.languageCode];
String get searchPatientImageCaptionTitle =>
localizedValues['searchPatientImageCaptionTitle'][locale.languageCode];
String get searchPatientImageCaptionBody =>
localizedValues['searchPatientImageCaptionBody'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -67,15 +67,7 @@ class AuthHeader extends StatelessWidget {
} }
Image buildImageLogo() { Image buildImageLogo() {
String img = 'assets/images/login_icon.png'; String img = 'assets/images/dr_app_logo.png';
if (userType == loginType.unknownUser) {
img = 'assets/images/welcome_login_icon.png';
}
if (userType == loginType.verifyPassword ||
userType == loginType.verificationMethods) {
img = 'assets/images/verified_icon.png';
}
return Image.asset( return Image.asset(
img, img,
fit: BoxFit.cover, fit: BoxFit.cover,

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -68,34 +69,17 @@ class _DynamicElementsState extends State<DynamicElements> {
), ),
AppTextFormField( AppTextFormField(
textInputType: TextInputType.number, textInputType: TextInputType.number,
hintText: 'From', hintText: TranslationBase.of(context).fromDate,
controller: _fromDateController, controller: _fromDateController,
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onTap: () { onTap: () {
_presentDatePicker('_selectedFromDate'); _presentDatePicker('_selectedFromDate');
}, },
// validator: (value) {
// return TextValidator().validateDate(_fromDateController.text);
// },
/*
*@author: Amjad Amireh
*@Date:13/5/2020
*@param:
*@return:check if field empty added static value
*@desc:
*/
onSaved: (value) { onSaved: (value) {
if (_fromDateController.text.toString().trim().isEmpty) { if (_fromDateController.text.toString().trim().isEmpty) {
widget._patientSearchFormValues.From = "0"; widget._patientSearchFormValues.From = "0";
} else { } else {
widget._patientSearchFormValues.From = _fromDateController.text.replaceAll("/", "-"); widget._patientSearchFormValues.From = _fromDateController.text.replaceAll("/", "-");
// _fromDateController.text;
} }
}, },
), ),
@ -104,28 +88,23 @@ class _DynamicElementsState extends State<DynamicElements> {
), ),
AppTextFormField( AppTextFormField(
textInputType: TextInputType.number, textInputType: TextInputType.number,
hintText: 'TO', hintText: TranslationBase
.of(context)
.toDate,
controller: _toDateController, controller: _toDateController,
onTap: () { onTap: () {
_presentDatePicker('_selectedToDate'); _presentDatePicker('_selectedToDate');
}, },
// validator: (value) {
// return TextValidator().validateDate(_toDateController.text);
// },
/*
*@author: Amjad Amireh
*@Date:13/5/2020
*@param:
*@return:check if field empty added static value
*@desc:
*/
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onSaved: (value) { onSaved: (value) {
if (_toDateController.text.toString().trim().isEmpty) { if (_toDateController.text
.toString()
.trim()
.isEmpty) {
widget._patientSearchFormValues.To = "0"; widget._patientSearchFormValues.To = "0";
} else { } else {
widget._patientSearchFormValues.To = _toDateController.text.replaceAll("/", "-"); widget._patientSearchFormValues.To =
_toDateController.text.replaceAll("/", "-");
} }
}, },
), ),

@ -1,6 +1,7 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'app_texts_widget.dart'; import 'app_texts_widget.dart';
@ -14,7 +15,7 @@ class AppButton extends StatefulWidget {
final double fontSize; final double fontSize;
final double padding; final double padding;
AppButton({@required this.onPressed, this.title, this.icon, this.color, this.fontSize = 2.5, this.padding = 15}); AppButton({@required this.onPressed, this.title, this.icon, this.color, this.fontSize = 2, this.padding = 5});
_AppButtonState createState() => _AppButtonState(); _AppButtonState createState() => _AppButtonState();
@ -25,12 +26,12 @@ class AppButton extends StatefulWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return return
RawMaterialButton( RawMaterialButton(
fillColor: widget.color, fillColor: widget.color != null ? widget.color : Hexcolor("#B8382C"),
splashColor: widget.color, splashColor: widget.color,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 15, top: widget.padding,
bottom: 15, bottom: widget.padding,
//right: SizeConfig.widthMultiplier * widget.padding, //right: SizeConfig.widthMultiplier * widget.padding,
//left: SizeConfig.widthMultiplier * widget.padding //left: SizeConfig.widthMultiplier * widget.padding
), ),
@ -38,24 +39,25 @@ class AppButton extends StatefulWidget {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
if (widget.icon != null) Icon( if (widget.icon != null)
Icon(
widget.icon, widget.icon,
color: Colors.white, color: Colors.white,
), ),
if (widget.icon != null) SizedBox( if (widget.icon != null)
SizedBox(
width: 5.0, width: 5.0,
), ),
AppText( AppText(
widget.title, widget.title.toUpperCase(),
color: Colors.white, color: Colors.white,
fontSize: SizeConfig.textMultiplier * widget.fontSize , fontSize: SizeConfig.textMultiplier * widget.fontSize ,
fontWeight: FontWeight.bold,
), ),
], ],
), ),
), ),
onPressed: widget.onPressed, onPressed: widget.onPressed,
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10))), shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(6))),
); );
} }
} }

@ -25,14 +25,14 @@ class AppScaffold extends StatelessWidget {
AppGlobal.CONTEX = context; AppGlobal.CONTEX = context;
ProjectProvider projectProvider = Provider.of(context); ProjectProvider projectProvider = Provider.of(context);
return Scaffold( return Scaffold(
backgroundColor: Hexcolor('#F5F5F5'), backgroundColor: Colors.white,
appBar: isShowAppBar appBar: isShowAppBar
? AppBar( ? AppBar(
elevation: 0, elevation: 0,
backgroundColor: Hexcolor('#515B5D'), backgroundColor: Hexcolor('#515B5D'),
textTheme: TextTheme( textTheme: TextTheme(
headline6: TextStyle( headline6: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold)), color: Colors.white)),
title: Text(appBarTitle.toUpperCase()), title: Text(appBarTitle.toUpperCase()),
leading: Builder(builder: (BuildContext context) { leading: Builder(builder: (BuildContext context) {
return IconButton( return IconButton(

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart';
// OWNER : Ibrahim albitar // OWNER : Ibrahim albitar
// DATE : 19-04-2020 // DATE : 19-04-2020
@ -21,7 +22,9 @@ class AppTextFormField extends FormField<String> {
FocusNode focusNode, FocusNode focusNode,
TextInputAction textInputAction, TextInputAction textInputAction,
ValueChanged<String> onFieldSubmitted, ValueChanged<String> onFieldSubmitted,
IconButton prefix}) IconButton prefix,
String labelText,
borderColor})
: super( : super(
onSaved: onSaved, onSaved: onSaved,
validator: validator, validator: validator,
@ -29,14 +32,13 @@ class AppTextFormField extends FormField<String> {
builder: (FormFieldState<String> state) { builder: (FormFieldState<String> state) {
return Column( return Column(
children: <Widget>[ children: <Widget>[
TextFormField( SizedBox(
height: 40.0,
child: TextFormField(
focusNode: focusNode, focusNode: focusNode,
keyboardType: textInputType, keyboardType: textInputType,
inputFormatters: [ inputFormatters: [WhitelistingTextInputFormatter(RegExp(inputFormatter)),
WhitelistingTextInputFormatter(RegExp(inputFormatter)), ],onChanged: onChanged?? (value){
],
onChanged: onChanged ??
(value) {
state.didChange(value); state.didChange(value);
}, },
textInputAction: textInputAction, textInputAction: textInputAction,
@ -44,20 +46,30 @@ class AppTextFormField extends FormField<String> {
decoration: InputDecoration( decoration: InputDecoration(
hintText: hintText, hintText: hintText,
suffixIcon: prefix, suffixIcon: prefix,
hintStyle: hintStyle: TextStyle(
TextStyle(fontSize: SizeConfig.textMultiplier * 2), fontSize: SizeConfig.textMultiplier * 1.8,),
contentPadding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
labelText: labelText,
labelStyle: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.7,),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)), borderRadius: BorderRadius.all(Radius.circular(6)),
borderSide: BorderSide(color: Color(0xff707070)), borderSide: BorderSide(
color: borderColor != null ? borderColor : Hexcolor(
"#CCCCCC")),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)), borderSide: BorderSide(
color: borderColor != null ? borderColor : Hexcolor(
"#CCCCCC")),
borderRadius: BorderRadius.all(Radius.circular(6)),
) )
//BorderRadius.all(Radius.circular(20)); //BorderRadius.all(Radius.circular(20));
), ),
onTap: onTap, onTap: onTap,
controller: controller, controller: controller,
), ),
),
state.hasError state.hasError
? Text( ? Text(
state.errorText, state.errorText,

Loading…
Cancel
Save