diff --git a/assets/images/cs_logo_container.png b/assets/images/cs_logo_container.png new file mode 100644 index 00000000..5f938580 Binary files /dev/null and b/assets/images/cs_logo_container.png differ diff --git a/assets/images/logo.png b/assets/images/logo.png new file mode 100644 index 00000000..bf41f8e8 Binary files /dev/null and b/assets/images/logo.png differ diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 174a38ab..261d2897 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -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 { 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 { }, ), 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 { ], ), bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), - ); } @@ -85,7 +78,6 @@ class _LandingPageState extends State { return "SCHEDULE"; case 3: return 'SERVICES'; - } } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index b2cd3dd9..d269398c 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -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 { 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 { 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 { // 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: [ + Expanded( + flex: 4, child: ListView(padding: EdgeInsets.zero, children: [ - Container( - height: SizeConfig.heightMultiplier * 30, - child: InkWell( - child: DrawerHeader( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - 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: [ + 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: [ + Container( + // This align moves the children to the bottom + child: Align( + alignment: FractionalOffset.bottomCenter, + child: Container( + child: Column( + children: [ + 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, ); } diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index a52d8812..c4fe25c1 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -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 { children: [ 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: [ 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, - ), ], ), ],