drawer design updated

merge-requests/125/head
Sultan Khan 5 years ago
parent 79c2de3f96
commit b26e750abb

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

@ -9,7 +9,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class LandingPage extends StatefulWidget {
@override
_LandingPageState createState() => _LandingPageState();
@ -39,7 +38,8 @@ class _LandingPageState extends State<LandingPage> {
elevation: 0,
backgroundColor: Hexcolor('#515B5D'),
textTheme: TextTheme(
headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold)),
headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold)),
title: Text(getText(currentTab).toUpperCase()),
leading: Builder(
builder: (BuildContext context) {
@ -51,14 +51,8 @@ class _LandingPageState extends State<LandingPage> {
},
),
centerTitle: true,
),
drawer: Theme(
data: Theme.of(context).copyWith(
canvasColor: Colors.transparent,
),
child: SafeArea(child: AppDrawer()),
),
drawer: SafeArea(child: AppDrawer()),
extendBody: true,
body: PageView(
physics: NeverScrollableScrollPhysics(),
@ -71,7 +65,6 @@ class _LandingPageState extends State<LandingPage> {
],
),
bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab),
);
}
@ -85,7 +78,6 @@ class _LandingPageState extends State<LandingPage> {
return "SCHEDULE";
case 3:
return 'SERVICES';
}
}
}
}

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/presentation/doctor_app_icons.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -31,7 +32,7 @@ class _AppDrawerState extends State<AppDrawer> {
void didChangeDependencies() {
super.didChangeDependencies();
// if (_isInit) {
getDocProfile();// TODO: Refactor this code to prevent errors in the cosole.
getDocProfile(); // TODO: Refactor this code to prevent errors in the cosole.
// }
_isInit = false;
}
@ -40,7 +41,7 @@ class _AppDrawerState extends State<AppDrawer> {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
// doctorProfile = DoctorProfileModel.fromJson(profile);
setState(() {
doctorProfile = DoctorProfileModel.fromJson(profile);
doctorProfile = DoctorProfileModel.fromJson(profile);
});
String token = await sharedPref.getString(TOKEN);
@ -51,75 +52,118 @@ class _AppDrawerState extends State<AppDrawer> {
// var x = getDocProfile();
return RoundedContainer(
child: Container(
margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 9),
color: Colors.white,
// margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2),
child: Drawer(
child: Column(children: <Widget>[
Expanded(
flex: 4,
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
Container(
height: SizeConfig.heightMultiplier * 30,
child: InkWell(
child: DrawerHeader(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12,
backgroundImage:
NetworkImage(doctorProfile.doctorImageURL),
backgroundColor: Colors.transparent,
Container(
height: SizeConfig.heightMultiplier * 50,
child: InkWell(
child: DrawerHeader(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
child: Image.asset('assets/images/logo.png'),
margin: EdgeInsets.only(top: 10, bottom: 15),
),
SizedBox(
height: 1,
child: Container(
color: Colors.black26,
),
),
SizedBox(height: 15),
CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12,
backgroundImage:
NetworkImage(doctorProfile.doctorImageURL),
backgroundColor: Colors.white,
),
Padding(
padding: EdgeInsets.only(top: 10),
child: AppText(
doctorProfile.doctorName,
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: SizeConfig.textMultiplier * 2,
)),
AppText(
"Director of medical records", //TODO: Make The Dr Title Dynamic and check overflow issue.
fontWeight: FontWeight.normal,
color: Colors.black87),
RaisedButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
side: BorderSide(color: Colors.red)),
child: AppText(
'Logout',
color: Colors.white,
),
onPressed: () async {
await Helpers.clearSharedPref();
Navigator.pop(context);
Navigator.of(context).pushNamed(LOGIN);
},
),
],
),
Padding(
padding: EdgeInsets.only(top: 10),
child: AppText(
doctorProfile.doctorName,
fontWeight: FontWeight.bold,
color: Colors.white,
fontSize: SizeConfig.textMultiplier * 2,
)),
AppText("Director of medical records",//TODO: Make The Dr Title Dynamic and check overflow issue.
fontWeight: FontWeight.normal, color: Colors.white)
],
),
onTap: () {
//Navigator.of(context).pushNamed(PROFILE);
Navigator.of(context).pushNamed(PROFILE, arguments: {
'title': doctorProfile.doctorName,
"doctorProfileall": doctorProfile
});
},
),
),
onTap: () {
//Navigator.of(context).pushNamed(PROFILE);
Navigator.of(context).pushNamed(PROFILE, arguments: {'title':doctorProfile.doctorName,
"doctorProfileall": doctorProfile
});
},
),
),
InkWell(
child: DrawerItem("Settings", Icons.settings),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(SETTINGS);
},
),
InkWell(
child: DrawerItem("QR Reader", Icons.search),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(QR_READER);
},
),
InkWell(
child: DrawerItem("lOGOUT", Icons.exit_to_app),
onTap: () async {
await Helpers.clearSharedPref();
Navigator.pop(context);
Navigator.of(context).pushNamed(LOGIN);
},
InkWell(
child: DrawerItem("Settings", Icons.settings),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(SETTINGS);
},
),
InkWell(
child: DrawerItem("QR Reader", DoctorApp.qr_code),
onTap: () {
Navigator.pop(context);
Navigator.of(context).pushNamed(QR_READER);
},
),
]),
),
Expanded(
flex: 1,
child: Column(children: <Widget>[
Container(
// This align moves the children to the bottom
child: Align(
alignment: FractionalOffset.bottomCenter,
child: Container(
child: Column(
children: <Widget>[
Text("Powered by"),
Image.asset(
'assets/images/cs_logo_container.png',
width: SizeConfig.imageSizeMultiplier * 30,
)
],
))))
]))
])),
),
width: SizeConfig.realScreenWidth * 0.55,
width: SizeConfig.realScreenWidth * 0.60,
margin: 0,
customCornerRaduis: true,
topRight: 30,
bottomRight: 30,
backgroundColor: Color(0xff58434F),
customCornerRaduis: false,
// topRight: 30,
// bottomRight: 30,
backgroundColor: Colors.white,
);
}

@ -11,15 +11,13 @@ import '../shared/app_texts_widget.dart';
// DESCRIPTION : Custom Drawer item for app.
class DrawerItem extends StatefulWidget {
final String title;
final String subTitle;
final IconData icon;
final Color color;
DrawerItem(this.title, this.icon, {this.color, this.subTitle = ''});
DrawerItem(this.title, this.icon,{this.color, this.subTitle = ''});
@override
_DrawerItemState createState() => _DrawerItemState();
}
@ -34,26 +32,26 @@ class _DrawerItemState extends State<DrawerItem> {
children: <Widget>[
Icon(
widget.icon,
color: widget.color??Colors.white,
size: SizeConfig.imageSizeMultiplier * 7,
color: widget.color ?? Colors.black87,
size: SizeConfig.imageSizeMultiplier * 5,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
widget.title,
color: widget.color??Colors.white,
fontWeight: FontWeight.bold,
widget.title,
color: widget.color ?? Colors.black,
// fontWeight: FontWeight.bold,
margin: 5,
fontSize: SizeConfig.textMultiplier * 2.3,
),
AppText(
widget.subTitle,
visibility: !widget.subTitle.isNullOrEmpty(),
color: widget.color ?? Colors.black,
marginLeft: 5,
fontSize: SizeConfig.textMultiplier * 2.5,
),
AppText(
widget.subTitle,
visibility: !widget.subTitle.isNullOrEmpty(),
color: widget.color??Colors.white,
marginLeft: 5,
fontSize: SizeConfig.textMultiplier * 2.5,
),
],
),
],

Loading…
Cancel
Save