patient header & app drawer desigining

merge-requests/917/head
hussam al-habibeh 4 years ago
parent 4760d4ae50
commit 67a5bcff91

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/model/search_drug/get_medication_respons
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.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/screens/patients/patient_search/patient_search_header.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';
@ -124,7 +125,10 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
return AppScaffold( return AppScaffold(
// baseViewModel: model, // baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).searchMedicine, appBar: PatientSearchHeader(
title: TranslationBase.of(context).searchMedicine,
),
//appBarTitle: TranslationBase.of(context).searchMedicine + "6",
body: SingleChildScrollView( body: SingleChildScrollView(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.97, widthFactor: 0.97,

@ -37,15 +37,16 @@ class InPatientHeader extends StatelessWidget with PreferredSizeWidget {
child: Row(children: [ child: Row(children: [
IconButton( IconButton(
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black, color: Color(0xFF2B353E), //Colors.black,
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
TranslationBase.of(context).inPatient, TranslationBase.of(context).inPatient,
fontSize: SizeConfig.textMultiplier * 2.8, fontSize: 24.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.w700,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
letterSpacing: -1.44,
), ),
), ),
if (model.specialClinicalCareMappingList.isNotEmpty && if (model.specialClinicalCareMappingList.isNotEmpty &&
@ -53,71 +54,72 @@ class InPatientHeader extends StatelessWidget with PreferredSizeWidget {
activeTab != 2) activeTab != 2)
Container( Container(
width: MediaQuery.of(context).size.width * .3, width: MediaQuery.of(context).size.width * .3,
child child: DropdownButtonHideUnderline(
: DropdownButtonHideUnderline( child: DropdownButton(
child: DropdownButton( dropdownColor: Colors.white,
dropdownColor: Colors.white, iconEnabledColor: Colors.black,
iconEnabledColor: Colors.black, isExpanded: true,
isExpanded: true, value: selectedMapId ??
value: selectedMapId??model.specialClinicalCareMappingList[0].nursingStationID, model.specialClinicalCareMappingList[0].nursingStationID,
iconSize: 25, iconSize: 25,
elevation: 16, elevation: 16,
selectedItemBuilder: (BuildContext context) { selectedItemBuilder: (BuildContext context) {
return model.specialClinicalCareMappingList.map((item) { return model.specialClinicalCareMappingList.map((item) {
return Row( return Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Column( Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Container( Container(
padding: EdgeInsets.all(2), padding: EdgeInsets.all(2),
margin: EdgeInsets.all(2), margin: EdgeInsets.all(2),
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: Colors.red[800], color: Colors.red[800],
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
), ),
constraints: BoxConstraints( constraints: BoxConstraints(
minWidth: 20, minWidth: 20,
minHeight: 20, minHeight: 20,
), ),
child: Center( child: Center(
child: AppText( child: AppText(
model.specialClinicalCareMappingList model.specialClinicalCareMappingList.length
.length .toString(),
.toString(), color: Colors.white,
color: Colors.white, fontSize:
fontSize: projectsProvider.isArabic projectsProvider.isArabic ? 10 : 11,
? 10 textAlign: TextAlign.center,
: 11, ),
textAlign: TextAlign.center, )),
), ],
)), ),
], AppText(
), selectedMapId == null
AppText(selectedMapId == null?TranslationBase.of(context).all:item.description, ? TranslationBase.of(context).all
fontSize: 12, : item.description,
color: Colors.black, fontSize: 12,
fontWeight: FontWeight.bold, color: Colors.black,
textAlign: TextAlign.end), fontWeight: FontWeight.bold,
], textAlign: TextAlign.end),
); ],
}).toList(); );
}, }).toList();
onChanged: (newValue) async { },
onChangeFunc(newValue); onChanged: (newValue) async {
}, onChangeFunc(newValue);
items: model.specialClinicalCareMappingList.map((item) { },
return DropdownMenuItem( items: model.specialClinicalCareMappingList.map((item) {
child: AppText( return DropdownMenuItem(
item.description, child: AppText(
textAlign: TextAlign.left, item.description,
), textAlign: TextAlign.left,
value: item.nursingStationID, ),
); value: item.nursingStationID,
}).toList(), );
)), }).toList(),
)),
), ),
]), ]),
), ),

@ -9,27 +9,28 @@ class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
), ),
child: Container( child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), padding: EdgeInsets.only(left: 10, right: 10, bottom: 5),
margin: EdgeInsets.only(top: 35), margin: EdgeInsets.only(top: 35),
child: Row(children: [ child: Row(children: [
IconButton( IconButton(
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black, color: Color(0xFF2B353E), //Colors.black,
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
), ),
Expanded( Expanded(
child: AppText( child: AppText(
title, title,
fontSize: SizeConfig.textMultiplier * 2.8, fontSize: 24.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.w700,
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
fontFamily: 'Poppins', fontFamily: 'Poppins',
letterSpacing: -1.44,
), ),
), ),
]), ]),
@ -38,5 +39,5 @@ class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget {
} }
@override @override
Size get preferredSize => Size(double.maxFinite,65); Size get preferredSize => Size(double.maxFinite, 65);
} }

@ -17,7 +17,6 @@ import 'app_texts_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class AppDrawer extends StatefulWidget { class AppDrawer extends StatefulWidget {
@override @override
_AppDrawerState createState() => _AppDrawerState(); _AppDrawerState createState() => _AppDrawerState();
@ -37,7 +36,7 @@ class _AppDrawerState extends State<AppDrawer> {
child: Drawer( child: Drawer(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
flex: 4, flex: 7,
child: ListView(padding: EdgeInsets.zero, children: <Widget>[ child: ListView(padding: EdgeInsets.zero, children: <Widget>[
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 15), margin: EdgeInsets.symmetric(horizontal: 15),
@ -50,6 +49,8 @@ class _AppDrawerState extends State<AppDrawer> {
Container( Container(
child: Image.asset( child: Image.asset(
'assets/images/dr_app_logo.png', 'assets/images/dr_app_logo.png',
width: MediaQuery.of(context).size.width * 0.16,
height: MediaQuery.of(context).size.height * 0.16,
), ),
margin: EdgeInsets.only(top: 10, bottom: 10), margin: EdgeInsets.only(top: 10, bottom: 10),
), ),
@ -61,6 +62,7 @@ class _AppDrawerState extends State<AppDrawer> {
child: Icon( child: Icon(
DoctorApp.close_1, DoctorApp.close_1,
size: 20, size: 20,
color: Color(0xff2B353E),
), ),
), ),
margin: EdgeInsets.only(top: 20, bottom: 10), margin: EdgeInsets.only(top: 20, bottom: 10),
@ -83,24 +85,29 @@ class _AppDrawerState extends State<AppDrawer> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(top: 10), padding: EdgeInsets.only(top: 8.0),
child: AppText( child: AppText(
TranslationBase.of(context).dr + TranslationBase.of(context).dr +
authenticationViewModel.doctorProfile?.doctorName, authenticationViewModel
fontWeight: FontWeight.bold, .doctorProfile?.doctorName,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: 17, fontSize: 25.0,
letterSpacing: -1.5,
), ),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 0), padding: EdgeInsets.only(top: 0),
child: AppText( child: AppText(
authenticationViewModel.doctorProfile?.clinicDescription, authenticationViewModel
fontWeight: FontWeight.w600, .doctorProfile?.clinicDescription,
fontWeight: FontWeight.w500,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: 15, fontSize: 16,
fontFamily: 'Poppins', fontFamily: 'Poppins',
letterSpacing: -0.96,
//textAlign: TextAlign.left,
)) ))
], ],
), ),
@ -110,6 +117,7 @@ class _AppDrawerState extends State<AppDrawer> {
child: DrawerItem( child: DrawerItem(
TranslationBase.of(context).applyOrRescheduleLeave, TranslationBase.of(context).applyOrRescheduleLeave,
icon: DoctorApp.reschedule__1, icon: DoctorApp.reschedule__1,
// subTitle: , // subTitle: ,
), ),
onTap: () { onTap: () {
@ -117,10 +125,11 @@ class _AppDrawerState extends State<AppDrawer> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AddRescheduleLeavScreen(), builder: (context) => AddRescheduleLeavScreen(),
settings: RouteSettings(name: 'AddRescheduleLeaveScreen') settings: RouteSettings(
// MyReferredPatient(), name: 'AddRescheduleLeaveScreen')
)); // MyReferredPatient(),
));
}, },
), ),
SizedBox(height: 15), SizedBox(height: 15),
@ -131,10 +140,11 @@ class _AppDrawerState extends State<AppDrawer> {
// subTitle: , // subTitle: ,
), ),
), ),
SizedBox(height: 15), SizedBox(height: MediaQuery.of(context).size.height * 0.02),
InkWell( InkWell(
child: Container( child: Container(
height: 80, height: MediaQuery.of(context).size.height * 0.16,
width: MediaQuery.of(context).size.width * 0.16,
child: Image.asset('assets/images/qr_code.png'), child: Image.asset('assets/images/qr_code.png'),
), ),
onTap: () {}, onTap: () {},
@ -143,7 +153,7 @@ class _AppDrawerState extends State<AppDrawer> {
), ),
), ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.09, height: MediaQuery.of(context).size.height * 0.02,
), ),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 20), margin: EdgeInsets.symmetric(horizontal: 20),
@ -174,8 +184,8 @@ class _AppDrawerState extends State<AppDrawer> {
), ),
onTap: () async { onTap: () async {
Navigator.pop(context); Navigator.pop(context);
await authenticationViewModel.logout(isFromLogin: false); await authenticationViewModel.logout(
isFromLogin: false);
}, },
), ),
], ],
@ -191,38 +201,44 @@ class _AppDrawerState extends State<AppDrawer> {
child: Align( child: Align(
alignment: FractionalOffset.bottomCenter, alignment: FractionalOffset.bottomCenter,
child: Container( child: Container(
child: Row( child: Padding(
mainAxisAlignment: MainAxisAlignment.center, padding: EdgeInsets.only(
children: <Widget>[ left: projectsProvider.isArabic ? 0 : 15.0,
Container( right: projectsProvider.isArabic ? 15.0 : 0),
width: MediaQuery.of(context).size.width * 0.3, child: Row(
child: RichText( mainAxisAlignment: MainAxisAlignment.start,
text: TextSpan( children: <Widget>[
text: 'Powered by', Container(
style: TextStyle( width: MediaQuery.of(context).size.width * 0.3,
color: Color(0xFF989898), child: RichText(
fontWeight: FontWeight.bold, text: TextSpan(
fontSize: 14, text: 'Powered by',
fontFamily: 'Poppins', style: TextStyle(
), color: Color(0xFF989898),
children: <TextSpan>[ fontWeight: FontWeight.w600,
TextSpan( fontSize: 14,
text: ' Cloud Solutions', fontFamily: 'Poppins',
style: TextStyle( letterSpacing: -0.56,
color: Color(0xFF2E303A), ),
fontSize: 15, children: <TextSpan>[
fontFamily: 'Poppins', TextSpan(
), text: ' Cloud Solutions',
) style: TextStyle(
]), color: Color(0xFF2E303A),
fontSize: 14,
fontFamily: 'Poppins',
letterSpacing: -0.56,
fontWeight: FontWeight.w700),
)
]),
),
), ),
), // Text("Powered by"),
// Text("Powered by"), Image.asset('assets/images/cs_logo_container.png',
Image.asset( width:
'assets/images/cs_logo_container.png', MediaQuery.of(context).size.width * 0.13)
width: SizeConfig.imageSizeMultiplier * 20, ],
) ),
],
)))) ))))
])) ]))
])), ])),

@ -103,7 +103,10 @@ class _AppTextState extends State<AppText> {
margin: widget.margin != null margin: widget.margin != null
? EdgeInsets.all(widget.margin) ? EdgeInsets.all(widget.margin)
: EdgeInsets.only( : EdgeInsets.only(
top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), top: widget.marginTop,
right: widget.marginRight,
bottom: widget.marginBottom,
left: widget.marginLeft),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -118,16 +121,21 @@ class _AppTextState extends State<AppText> {
right: 0, right: 0,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient(colors: [ gradient: LinearGradient(
Theme.of(context).backgroundColor, colors: [
Theme.of(context).backgroundColor.withOpacity(0), Theme.of(context).backgroundColor,
], begin: Alignment.bottomCenter, end: Alignment.topCenter)), Theme.of(context).backgroundColor.withOpacity(0),
],
begin: Alignment.bottomCenter,
end: Alignment.topCenter)),
height: 30, height: 30,
), ),
) )
], ],
), ),
if (widget.allowExpand && widget.readMore && text.length > widget.maxLength) if (widget.allowExpand &&
widget.readMore &&
text.length > widget.maxLength)
Padding( Padding(
padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0),
child: InkWell( child: InkWell(
@ -164,7 +172,13 @@ class _AppTextState extends State<AppText> {
), ),
child: Container( child: Container(
child: SelectableText( child: SelectableText(
!hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), !hidden
? text
: (text.substring(
0,
text.length > widget.maxLength
? widget.maxLength
: text.length)),
textAlign: widget.textAlign, textAlign: widget.textAlign,
// overflow: widget.maxLines != null // overflow: widget.maxLines != null
// ? ((widget.maxLines > 1) // ? ((widget.maxLines > 1)
@ -180,9 +194,11 @@ class _AppTextState extends State<AppText> {
height: widget.fontHeight) height: widget.fontHeight)
: TextStyle( : TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Colors.black, color:
widget.color != null ? widget.color : Color(0xff2E303A),
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), letterSpacing: widget.letterSpacing ??
(widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins', fontFamily: widget.fontFamily ?? 'Poppins',
decoration: widget.textDecoration, decoration: widget.textDecoration,
@ -192,9 +208,19 @@ class _AppTextState extends State<AppText> {
); );
} else { } else {
return Text( return Text(
!hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), !hidden
? text
: (text.substring(
0,
text.length > widget.maxLength
? widget.maxLength
: text.length)),
textAlign: widget.textAlign, textAlign: widget.textAlign,
overflow: widget.maxLines != null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, overflow: widget.maxLines != null
? ((widget.maxLines > 1)
? TextOverflow.fade
: TextOverflow.ellipsis)
: null,
maxLines: widget.maxLines ?? null, maxLines: widget.maxLines ?? null,
style: widget.style != null style: widget.style != null
? _getFontStyle().copyWith( ? _getFontStyle().copyWith(
@ -206,7 +232,8 @@ class _AppTextState extends State<AppText> {
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Colors.black, color: widget.color != null ? widget.color : Colors.black,
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), letterSpacing: widget.letterSpacing ??
(widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins', fontFamily: widget.fontFamily ?? 'Poppins',
decoration: widget.textDecoration, decoration: widget.textDecoration,

@ -12,7 +12,8 @@ class DrawerItem extends StatefulWidget {
final Color color; final Color color;
final String assetLink; final String assetLink;
DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink}); DrawerItem(this.title,
{this.icon, this.color, this.subTitle = '', this.assetLink});
@override @override
_DrawerItemState createState() => _DrawerItemState(); _DrawerItemState createState() => _DrawerItemState();
@ -26,33 +27,34 @@ class _DrawerItemState extends State<DrawerItem> {
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
if(widget.assetLink!=null) if (widget.assetLink != null)
Container( Container(
height: 20, height: 20,
width: 20, width: 20,
child: Image.asset(widget.assetLink), child: Image.asset(widget.assetLink),
), ),
if(widget.assetLink==null) if (widget.assetLink == null)
Icon( Icon(
widget.icon, widget.icon,
color: widget.color ?? Colors.black87, color: widget.color ?? Colors.black87,
size: SizeConfig.imageSizeMultiplier * 5, size: SizeConfig.imageSizeMultiplier * 5,
), ),
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
width: MediaQuery.of(context).size.width *0.45, width: MediaQuery.of(context).size.width * 0.45,
child: AppText( child: AppText(
widget.title, widget.title,
marginLeft: 5, marginLeft: 5,
marginRight: 5, marginRight: 5,
color:widget.color ??Color(0xFF2E303A), color: widget.color ?? Color(0xFF2E303A),
fontSize: 14, fontSize: 14,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.84,
), ),
), ),
], ],

Loading…
Cancel
Save