diff --git a/assets/images/dr_app_logo.png b/assets/images/dr_app_logo.png new file mode 100644 index 00000000..cc9186c2 Binary files /dev/null and b/assets/images/dr_app_logo.png differ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 508397e5..5b4adba1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -56,10 +56,7 @@ const Map> localizedValues = { 'en': 'Only Arrived Patient', 'ar': 'المريض الذي حضر للموعد' }, - 'searchMedicineNameHere': { - 'en': 'Search Medicine Name Here', - 'ar': 'ابحث عن الدواء هنا' - }, + 'searchMedicineNameHere': {'en': 'Search Medicine ', 'ar': 'ابحث هنا'}, 'youCanFind': {'en': 'You Can Find', 'ar': 'تستطيع ان تجد '}, 'itemsInSearch': {'en': 'items in search', 'ar': 'عناصر في البحث'}, 'qrReader': {'en': 'QR Reader', 'ar': 'قارىء رمز الQR'}, @@ -216,4 +213,12 @@ const Map> localizedValues = { 'beingGreat': {'en': 'being great', 'ar': 'رائع'}, 'cancel': {'en': 'CANCEL', 'ar': 'الغاء'}, 'done': {'en': 'DONE', 'ar': 'تأكيد'}, + "searchMedicineImageCaption": { + 'en': 'Type the medicine name to search', + 'ar': 'اكتب اسم الدواء الذي تبحت عنه ' + }, + "type": { + 'en': 'Type', + 'ar': 'اكتب اسم الدواء ' + } }; diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index af1eb11d..506122e3 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -1,10 +1,12 @@ import 'package:doctor_app_flutter/config/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/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_toast_msg.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/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -13,8 +15,8 @@ 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:flutter/material.dart'; import 'package:provider/provider.dart'; + import '../../util/extenstions.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); @@ -50,6 +52,33 @@ class _MedicineSearchState extends State { appBarTitle: TranslationBase.of(context).searchMedicine, body: Column( children: [ + Column( + children: [ + Container( + child: Icon( + DoctorApp.medicinesearch, + size: 100, + color: Colors.black, + ), + margin: EdgeInsets.only(top: 50), + ), + Padding( + padding: const EdgeInsets.only(top: 12.0), + child: AppText( + TranslationBase.of(context).type.toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: SizeConfig.heightMultiplier * 2.5, + ), + ), + Padding( + padding: const EdgeInsets.only(top: 5.0), + child: AppText( + TranslationBase.of(context).searchMedicineImageCaption, + fontSize: SizeConfig.heightMultiplier * 2, + ), + ) + ], + ), Padding( padding: EdgeInsets.only( bottom: SizeConfig.heightMultiplier * 1, @@ -76,8 +105,9 @@ class _MedicineSearchState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: TranslationBase.of(context).search, - color: Color(PRIMARY_COLOR), + title: TranslationBase + .of(context) + .search, onPressed: () { searchMedicine(context); }, @@ -91,12 +121,16 @@ class _MedicineSearchState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).youCanFind + + TranslationBase + .of(context) + .youCanFind + (_medicineProvider.pharmacyItemsList == null - ? "0" + ? " 0 " : _medicineProvider.pharmacyItemsList.length - .toString()) + - TranslationBase.of(context).itemsInSearch, + .toString()) + + TranslationBase + .of(context) + .itemsInSearch, fontWeight: FontWeight.bold, margin: 5, ), diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 54eaf5ee..e60bd238 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -450,7 +450,6 @@ class _PatientSearchScreenState extends State { children: [ AppButton( title: TranslationBase.of(context).search, - color: Color(0xff58434F), onPressed: () { _validateInputs(); }, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index ad52edd8..0b7ba3e2 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -235,6 +235,8 @@ class TranslationBase { String get beingGreat => localizedValues['beingGreat'][locale.languageCode]; String get cancel => localizedValues['cancel'][locale.languageCode]; String get done => localizedValues['done'][locale.languageCode]; + String get searchMedicineImageCaption => localizedValues['searchMedicineImageCaption'][locale.languageCode]; + String get type => localizedValues['type'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/auth_header.dart b/lib/widgets/auth/auth_header.dart index e577d8b1..fb2cf322 100644 --- a/lib/widgets/auth/auth_header.dart +++ b/lib/widgets/auth/auth_header.dart @@ -67,15 +67,7 @@ class AuthHeader extends StatelessWidget { } Image buildImageLogo() { - String img = 'assets/images/login_icon.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'; - } - + String img = 'assets/images/dr_app_logo.png'; return Image.asset( img, fit: BoxFit.cover, diff --git a/lib/widgets/shared/app_buttons_widget.dart b/lib/widgets/shared/app_buttons_widget.dart index 7b911d9a..53f4eda4 100644 --- a/lib/widgets/shared/app_buttons_widget.dart +++ b/lib/widgets/shared/app_buttons_widget.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'app_texts_widget.dart'; @@ -14,7 +15,7 @@ class AppButton extends StatefulWidget { final double fontSize; 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 = 4}); _AppButtonState createState() => _AppButtonState(); @@ -25,37 +26,38 @@ class AppButton extends StatefulWidget { Widget build(BuildContext context) { return RawMaterialButton( - fillColor: widget.color, - splashColor: widget.color, - child: Padding( - padding: EdgeInsets.only( - top: 15, - bottom: 15, - //right: SizeConfig.widthMultiplier * widget.padding, - //left: SizeConfig.widthMultiplier * widget.padding - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - if (widget.icon != null) Icon( + fillColor: widget.color != null ? widget.color : Hexcolor("#B8382C"), + splashColor: widget.color, + child: Padding( + padding: EdgeInsets.only( + top: widget.padding, + bottom: widget.padding, + //right: SizeConfig.widthMultiplier * widget.padding, + //left: SizeConfig.widthMultiplier * widget.padding + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (widget.icon != null) + Icon( widget.icon, color: Colors.white, ), - if (widget.icon != null) SizedBox( + if (widget.icon != null) + SizedBox( width: 5.0, ), - AppText( - widget.title, - color: Colors.white, + AppText( + widget.title.toUpperCase(), + color: Colors.white, fontSize: SizeConfig.textMultiplier * widget.fontSize , - fontWeight: FontWeight.bold, ), ], ), ), onPressed: widget.onPressed, - shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10))), + shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(6))), ); } } \ No newline at end of file diff --git a/lib/widgets/shared/app_text_form_field.dart b/lib/widgets/shared/app_text_form_field.dart index b0b9a8ec..fedc38d1 100644 --- a/lib/widgets/shared/app_text_form_field.dart +++ b/lib/widgets/shared/app_text_form_field.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:hexcolor/hexcolor.dart'; // OWNER : Ibrahim albitar // DATE : 19-04-2020 @@ -29,30 +30,34 @@ class AppTextFormField extends FormField { builder: (FormFieldState state) { return Column( children: [ - TextFormField( - focusNode: focusNode, - keyboardType: textInputType, - inputFormatters: [WhitelistingTextInputFormatter(RegExp(inputFormatter)),], - onChanged: onChanged?? (value){ - state.didChange(value); - }, - textInputAction: textInputAction, - onFieldSubmitted: onFieldSubmitted, - decoration: InputDecoration( - hintText: hintText, - hintStyle: TextStyle(fontSize: SizeConfig.textMultiplier * 2), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10)), - borderSide: BorderSide(color: Color(0xff707070)), - ), - focusedBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(10)), - ) - //BorderRadius.all(Radius.circular(20)); - ), - onTap: onTap, - controller: controller, + SizedBox( + height: 40.0, + child: TextFormField( + focusNode: focusNode, + keyboardType: textInputType, + inputFormatters: [WhitelistingTextInputFormatter(RegExp(inputFormatter)),], + onChanged: onChanged?? (value){ + state.didChange(value); + }, + textInputAction: textInputAction, + onFieldSubmitted: onFieldSubmitted, + decoration: InputDecoration( + hintText: hintText, + hintStyle: TextStyle(fontSize: SizeConfig.textMultiplier * 1.8,), + contentPadding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(6)), + borderSide: BorderSide(color: Hexcolor("#CCCCCC")), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(6)), + ) + //BorderRadius.all(Radius.circular(20)); + ), + onTap: onTap, + controller: controller, ), + ), state.hasError? Text( state.errorText,