From f231228e71273e6438d6b7ba360642084a66597f Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 12 Apr 2020 13:06:06 +0300 Subject: [PATCH] dashboard screen and rounded container widget --- fonts/DoctorApp.ttf | Bin 2652 -> 2732 bytes .../rounded_container_widget.dart | 42 --- lib/main.dart | 1 + lib/presentation/doctor_app_icons.dart | 33 ++- lib/routes.dart | 2 +- lib/screens/dashboard.dart | 213 ------------- lib/screens/dashboard_screen.dart | 279 ++++++++++++++++++ .../dashboard_item_icons_texts.dart | 9 +- .../dashboard_item_texts_widget.dart | 2 +- lib/widgets/shared/app_drawer_widget.dart | 54 ++++ lib/widgets/shared/drawer_item_widget.dart | 25 ++ .../shared/rounded_container_widget.dart | 72 +++++ 12 files changed, 457 insertions(+), 275 deletions(-) delete mode 100644 lib/custom_widgets/rounded_container_widget.dart delete mode 100644 lib/screens/dashboard.dart create mode 100644 lib/screens/dashboard_screen.dart rename lib/{custom_widgets => widgets/dashboard}/dashboard_item_icons_texts.dart (85%) rename lib/{custom_widgets => widgets/dashboard}/dashboard_item_texts_widget.dart (95%) create mode 100644 lib/widgets/shared/app_drawer_widget.dart create mode 100644 lib/widgets/shared/drawer_item_widget.dart create mode 100644 lib/widgets/shared/rounded_container_widget.dart diff --git a/fonts/DoctorApp.ttf b/fonts/DoctorApp.ttf index 75e43d06a893356ab92dfb2379e21999f4e7bc70..5102acc686b6e3cfb36403807ef091fc085a11d7 100644 GIT binary patch delta 595 zcmXw#PiqrV6vfY-_mY`OrcGN~niNM&8aHC0Al8kLZUonYE)8RhiPA|@tWZI5p(~M4 znc`9+-HI0KG9SRNpcGLk@|JFlg2D0348Gy_-u-*HbB`C_F72&8xdg}y05@7;FnF$; zzX5BJ3_4p6@0|RaIRx~G{;6&|xb0t9zslOLWTVSKF?Oo7$E4m3cXl^w@sxTe^w+og ztw2rGclJM{zY+$!11Y1!e3|~4UJ$m&pH{F07N}@bTpBJ5$ZFw5)N!L;)n#h{JpC*7I zRBD~)TVVA*G;T$kmVd=Io~g%iDw16S4|7;R8MRc{Vvi;{l84RPAucJ9BGvK-Z!B3z zCP)>IGabxFhpMq=1BS32#>rqCjGIA87><+xJDStWm85DmBdsjaCUB!oy?imLt!Jd! zv$RPvNP33+*&$xzOZLgEQ0wTC_QmIt;(N+)bsDHhb-t?1v@AFOdff8St6WJ}Jh4QH hmYn3p7DrquNKrhQiNn4~H}k%?-+OP_JsSHu+L>xE0l-`k-FxqPfWJ#mKU+&zZ%)=SdcTwTjEOi8D~##Eovg9lnp?>G z^!}ip-Po+9>aP00`c>+QM%rph8FfCNpsqYk8*9DKlNbXEEkGsB&F9; zyS=Gu3}HxqEq{9Pq;&reVr7`Ym$!#M|KE8(uZPEKg*t?1vs|_=*0kH_>UuHHAE2~1>0%ygau2F5p`Ne0Tcc1!3U#tn?4LM@!D*hO&% zDDWI2At|~E1zV%vd%yLW7nc&NaPCf^q(7>vR{m%^;55FEg*{;Cv#<-ywE^r4bA5oz zmlzYyg5iI&xcmrX!uc@M1MHi)bpX3B{_QJV*{_z@Pu}=tIr$bOemNFTl=u=zL53uh PqC^r)qP?i9A4KV2H3W44 diff --git a/lib/custom_widgets/rounded_container_widget.dart b/lib/custom_widgets/rounded_container_widget.dart deleted file mode 100644 index a962b335..00000000 --- a/lib/custom_widgets/rounded_container_widget.dart +++ /dev/null @@ -1,42 +0,0 @@ - -import 'package:flutter/material.dart'; - -// OWNER : Ibrahim albitar -// DATE : 05-04-2020 -// DESCRIPTION : Custom widget for rounded container and custom decoration - -class RoundedContainer extends StatefulWidget { - - final double raduis; - final Color backgroundColor; - final double margin; - final double elevation; - final bool showBorder; - final Color borderColor; - final Widget widget; - -RoundedContainer(this.widget ,{this.raduis = 10,this.backgroundColor = Colors.white, this.margin = 10, this.elevation = 1, this.showBorder = false, this.borderColor = Colors.red}); - - @override - _RoundedContainerState createState() => _RoundedContainerState(); -} - -class _RoundedContainerState extends State { - @override - Widget build(BuildContext context) { - return Container( - margin: EdgeInsets.all(widget.margin), - decoration: widget.showBorder == true ? BoxDecoration( - border: Border.all(color: Colors.red, width:1 ), - borderRadius: BorderRadius.circular(widget.raduis), - ):null, - child: Card( - margin: EdgeInsets.all(0), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(widget.raduis), - ), - color: widget.backgroundColor, - child: widget.widget , - )); - } -} diff --git a/lib/main.dart b/lib/main.dart index e752234a..a89541b8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -27,6 +27,7 @@ class MyApp extends StatelessWidget { child: MaterialApp( title: 'Flutter Demo', theme: ThemeData( + canvasColor: Colors.transparent, primarySwatch: Colors.blue, primaryColor: Hexcolor('#B8382C'), buttonColor: Hexcolor('#B8382C'), diff --git a/lib/presentation/doctor_app_icons.dart b/lib/presentation/doctor_app_icons.dart index 5c3c80bf..1ee49644 100644 --- a/lib/presentation/doctor_app_icons.dart +++ b/lib/presentation/doctor_app_icons.dart @@ -19,20 +19,23 @@ class DoctorApp { DoctorApp._(); static const _kFontFam = 'DoctorApp'; + static const _kFontPkg = null; - static const IconData discharge_patient = IconData(0xe800, fontFamily: _kFontFam); - static const IconData home_icon = IconData(0xe801, fontFamily: _kFontFam); - static const IconData home_icon_active = IconData(0xe802, fontFamily: _kFontFam); - static const IconData in_patient_white = IconData(0xe804, fontFamily: _kFontFam); - static const IconData lab_results = IconData(0xe805, fontFamily: _kFontFam); - static const IconData menu_icon_active = IconData(0xe808, fontFamily: _kFontFam); - static const IconData message_icon = IconData(0xe809, fontFamily: _kFontFam); - static const IconData message_icon_active = IconData(0xe80a, fontFamily: _kFontFam); - static const IconData out_patient = IconData(0xe80c, fontFamily: _kFontFam); - static const IconData radiology = IconData(0xe80d, fontFamily: _kFontFam); - static const IconData referral = IconData(0xe80e, fontFamily: _kFontFam); - static const IconData scdedule_icon_active = IconData(0xe80f, fontFamily: _kFontFam); - static const IconData search_patient = IconData(0xe810, fontFamily: _kFontFam); - static const IconData schedule_icon = IconData(0xe811, fontFamily: _kFontFam); - static const IconData menu_bar_icon = IconData(0xe825, fontFamily: _kFontFam); + static const IconData discharge_patient = const IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon = const IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon_active = const IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData in_patient_white = const IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData lab_results = const IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon = const IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon_active = const IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon = const IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon_active = const IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData out_patient = const IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData radiology = const IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral = const IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData scdedule_icon_active = const IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_patient = const IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData schedule_icon = const IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData image2vector = const IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_bar_icon = const IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/lib/routes.dart b/lib/routes.dart index 45b45945..60e40fbd 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -4,7 +4,7 @@ import './screens/QR_reader_screen.dart'; import './screens/auth/login_screen.dart'; import './screens/blood_bank_screen.dart'; import './screens/doctor_reply_screen.dart'; -import './screens/dashboard.dart'; +import './screens/dashboard_screen.dart'; import './screens/medicine/medicine_search_screen.dart'; import './screens/my_schedule_screen.dart'; import './screens/patients/patient_search_screen.dart'; diff --git a/lib/screens/dashboard.dart b/lib/screens/dashboard.dart deleted file mode 100644 index b54a5627..00000000 --- a/lib/screens/dashboard.dart +++ /dev/null @@ -1,213 +0,0 @@ -import 'package:doctor_app_flutter/custom_widgets/dashboard_item_icons_texts.dart'; -import 'package:doctor_app_flutter/custom_widgets/dashboard_item_texts_widget.dart'; -import 'package:doctor_app_flutter/custom_widgets/rounded_container_widget.dart'; -import 'package:doctor_app_flutter/presentation/doctor_app_icons.dart'; -import 'package:flutter/material.dart'; -import 'package:percent_indicator/circular_percent_indicator.dart'; - - -class DashboardPage extends StatefulWidget { - DashboardPage({Key key, this.title}) : super(key: key); - - final String title; - - @override - _MyHomePageState createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - elevation: 0, - backgroundColor: Colors.red[100], - textTheme: TextTheme( - title: - TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), - title: Text(widget.title), - leading: IconButton( - icon: Icon(Icons.menu), - color: Colors.black, - onPressed: () => Scaffold.of(context).openDrawer(), - ), - centerTitle: true, - actions: [ - IconButton(icon: Icon(Icons.person), onPressed: null) - ], - ), - drawer: Container( - child: Card(), - ), - bottomNavigationBar: BottomNavigationBar(items:[ - BottomNavigationBarItem( - icon: Icon(DoctorApp.home_icon), - title: Text('Home'), - backgroundColor: Colors.red, - activeIcon: Icon(Icons.home) - ), - BottomNavigationBarItem( - icon: new Icon(Icons.mail), - title: new Text('Messages'), - ), - BottomNavigationBarItem( - icon: Icon(Icons.apps), - title: Text('Menu') - ) - ]), - body: Container( - decoration: new BoxDecoration( - gradient: LinearGradient( - colors: [Colors.red[100], Colors.white], - begin: Alignment.topLeft, - end: Alignment.bottomRight, - ), - ), - child: Column( - children: [ - Expanded( - flex: 1, - child: Container( - margin: EdgeInsets.all(10), - child: Text( - "Today's Statistics", - style: TextStyle( - fontWeight: FontWeight.bold, fontSize: 18), - ), - alignment: Alignment.centerLeft, - )), - Expanded( - flex: 3, - child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Expanded( - flex: 2, - child: RoundedContainer( - CircularPercentIndicator( - radius: 90.0, - animation: true, - animationDuration: 1200, - lineWidth: 7.0, - percent: .75, - center: Column( mainAxisAlignment: MainAxisAlignment.center, - children: [ - new Text( - "38", - style: new TextStyle( - fontWeight: FontWeight.bold, - fontSize: 24.0), - ), - new Text( - "Out-Patients", - style: new TextStyle( - fontWeight: FontWeight.normal, - fontSize: 11.0, - color: Colors.grey[800]), - ), - ],), - circularStrokeCap: CircularStrokeCap.butt, - backgroundColor: Colors.blueGrey[100], - progressColor: Colors.red, - ) - )), - Expanded( - flex: 2, - child: Row( - children: [ - Expanded( - flex: 1, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - Expanded( - child: DashboardItemTexts("Arrived","23",)), - Expanded( - child: DashboardItemTexts("Not Arrived","23",)), - ], - )), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - Expanded( - child: DashboardItemTexts("ER","23",)), - Expanded( - child: DashboardItemTexts("Walk-in","23",)), - ], - )), - ], - )) - ])), - Expanded( - flex: 2, - child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Expanded( - flex: 2, - child: new DashboardItemIconText(DoctorApp.home_icon,"08", "Lab Result", backgroundColor: Colors.red,)), - Expanded( - flex: 2, - child: new DashboardItemIconText(DoctorApp.home_icon, "10","Radiology", backgroundColor: Colors.red,)), - Expanded( - flex: 2, - child: new DashboardItemIconText(DoctorApp.home_icon,"05", "Referral", backgroundColor: Colors.red,)), - ], - )), - Expanded( - flex: 2, - child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Expanded( - flex: 2, - child: new DashboardItemIconText(DoctorApp.home_icon,"23","In-Patient", showBorder: true,)), - Expanded( - flex: 2, - child: new DashboardItemIconText(DoctorApp.home_icon,"23","Operations", showBorder: true,)), - ], - )), - Expanded( - flex: 1, - child: Container( - margin: EdgeInsets.all(10), - child: Text( - "Patient Services", - style: TextStyle( - fontWeight: FontWeight.bold, fontSize: 15), - ), - alignment: Alignment.centerLeft, - )), - Expanded( - flex: 2, - child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Expanded( - flex: 2, - child: new DashboardItemIconText(DoctorApp.home_icon,"","Search Patient", showBorder: false,backgroundColor: Colors.green[200],)), - Expanded( - flex: 2, - child: new DashboardItemIconText(DoctorApp.home_icon,"","Out Patient", showBorder: false,backgroundColor: Colors.deepPurple[300],)), - ], - )), - Expanded( - flex: 2, - child: Row( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Expanded( - flex: 2, - child: new DashboardItemIconText(DoctorApp.home_icon,"","In Patient", showBorder: false, backgroundColor: Colors.blueGrey[900],)), - Expanded( - flex: 2, - child: new DashboardItemIconText(DoctorApp.home_icon,"","Discharge Patient", showBorder: false,backgroundColor: Colors.brown[400],)), - ], - )), - ], - ))); - } -} diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart new file mode 100644 index 00000000..93db7ea8 --- /dev/null +++ b/lib/screens/dashboard_screen.dart @@ -0,0 +1,279 @@ + +import 'package:doctor_app_flutter/presentation/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/dashboard_item_icons_texts.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/dashboard_item_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:percent_indicator/circular_percent_indicator.dart'; + +class DashboardPage extends StatefulWidget { + DashboardPage({Key key, this.title}) : super(key: key); + + final String title; + + @override + _MyHomePageState createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + elevation: 0, + backgroundColor: Colors.red[100], + textTheme: TextTheme( + title: + TextStyle(color: Colors.black, fontWeight: FontWeight.bold)), + title: Text(widget.title), + leading: Builder(builder: (BuildContext context) { + return new GestureDetector( + onTap: () { + Scaffold.of(context).openDrawer(); + }, + child: IconButton( + icon: Icon(Icons.menu), + color: Colors.black, + onPressed: () => Scaffold.of(context).openDrawer(), + ), + ); + }), + centerTitle: true, + actions: [ + IconButton(icon: Icon(Icons.person), onPressed: null) + ], + ), + drawer: SafeArea( child: AppDrawer()), + bottomNavigationBar: BottomNavigationBar(items: [ + BottomNavigationBarItem( + icon: Icon(DoctorApp.home_icon), + title: Text('Home'), + backgroundColor: Colors.red, + activeIcon: Icon(Icons.home)), + BottomNavigationBarItem( + icon: new Icon(Icons.mail), + title: new Text('Messages'), + ), + BottomNavigationBarItem(icon: Icon(Icons.apps), title: Text('Menu')) + ]), + body: Container( + decoration: new BoxDecoration( + gradient: LinearGradient( + colors: [Colors.red[100], Colors.white], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + ), + child: Column( + children: [ + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.all(10), + child: Text( + "Today's Statistics", + style: TextStyle( + fontWeight: FontWeight.bold, fontSize: 18), + ), + alignment: Alignment.centerLeft, + )), + Expanded( + flex: 3, + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Expanded( + flex: 2, + child: RoundedContainer( + CircularPercentIndicator( + radius: 90.0, + animation: true, + animationDuration: 1200, + lineWidth: 7.0, + percent: .75, + center: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + new Text( + "38", + style: new TextStyle( + fontWeight: FontWeight.bold, + fontSize: 24.0), + ), + new Text( + "Out-Patients", + style: new TextStyle( + fontWeight: FontWeight.normal, + fontSize: 11.0, + color: Colors.grey[800]), + ), + ], + ), + circularStrokeCap: CircularStrokeCap.butt, + backgroundColor: Colors.blueGrey[100], + progressColor: Colors.red, + ) + ) + ), + Expanded( + flex: 2, + child: Row( + children: [ + Expanded( + flex: 1, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + Expanded( + child: DashboardItemTexts( + "Arrived", + "23", + )), + Expanded( + child: DashboardItemTexts( + "Not Arrived", + "23", + )), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + Expanded( + child: DashboardItemTexts( + "ER", + "23", + )), + Expanded( + child: DashboardItemTexts( + "Walk-in", + "23", + )), + ], + )), + ], + )) + ])), + Expanded( + flex: 2, + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Expanded( + flex: 2, + child: new DashboardItemIconText( + DoctorApp.home_icon, + "08", + "Lab Result", + backgroundColor: Colors.red, + )), + Expanded( + flex: 2, + child: new DashboardItemIconText( + DoctorApp.home_icon, + "10", + "Radiology", + backgroundColor: Colors.red, + )), + Expanded( + flex: 2, + child: new DashboardItemIconText( + DoctorApp.home_icon, + "05", + "Referral", + backgroundColor: Colors.red, + )), + ], + )), + Expanded( + flex: 2, + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Expanded( + flex: 2, + child: new DashboardItemIconText( + DoctorApp.home_icon, + "23", + "In-Patient", + showBorder: true, + )), + Expanded( + flex: 2, + child: new DashboardItemIconText( + DoctorApp.home_icon, + "23", + "Operations", + showBorder: true, + )), + ], + )), + Expanded( + flex: 1, + child: Container( + margin: EdgeInsets.all(10), + child: Text( + "Patient Services", + style: TextStyle( + fontWeight: FontWeight.bold, fontSize: 15), + ), + alignment: Alignment.centerLeft, + )), + Expanded( + flex: 2, + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Expanded( + flex: 2, + child: new DashboardItemIconText( + DoctorApp.home_icon, + "", + "Search Patient", + showBorder: false, + backgroundColor: Colors.green[200], + )), + Expanded( + flex: 2, + child: new DashboardItemIconText( + DoctorApp.home_icon, + "", + "Out Patient", + showBorder: false, + backgroundColor: Colors.deepPurple[300], + )), + ], + )), + Expanded( + flex: 2, + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Expanded( + flex: 2, + child: new DashboardItemIconText( + DoctorApp.home_icon, + "", + "In Patient", + showBorder: false, + backgroundColor: Colors.blueGrey[900], + )), + Expanded( + flex: 2, + child: new DashboardItemIconText( + DoctorApp.home_icon, + "", + "Discharge Patient", + showBorder: false, + backgroundColor: Colors.brown[400], + )), + ], + )), + ], + ))); + } +} diff --git a/lib/custom_widgets/dashboard_item_icons_texts.dart b/lib/widgets/dashboard/dashboard_item_icons_texts.dart similarity index 85% rename from lib/custom_widgets/dashboard_item_icons_texts.dart rename to lib/widgets/dashboard/dashboard_item_icons_texts.dart index 1693868a..feee3e93 100644 --- a/lib/custom_widgets/dashboard_item_icons_texts.dart +++ b/lib/widgets/dashboard/dashboard_item_icons_texts.dart @@ -1,5 +1,5 @@ -import 'package:doctor_app_flutter/custom_widgets/rounded_container_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; class DashboardItemIconText extends StatefulWidget { @@ -22,7 +22,8 @@ DashboardItemIconText(this.icon, this.value, this.label, {this.backgroundColor = class _DashboardItemTextsState extends State { @override Widget build(BuildContext context) { - return new RoundedContainer(Stack( + return new RoundedContainer( + Stack( children: [ Align( alignment: FractionalOffset.topLeft, @@ -39,6 +40,8 @@ class _DashboardItemTextsState extends State { ],)) ), - ],) ,backgroundColor: widget.backgroundColor, showBorder: widget.showBorder, borderColor: widget.borderColor,); + ], + ) ,backgroundColor: widget.backgroundColor, + showBorder: widget.showBorder, borderColor: widget.borderColor,); } } \ No newline at end of file diff --git a/lib/custom_widgets/dashboard_item_texts_widget.dart b/lib/widgets/dashboard/dashboard_item_texts_widget.dart similarity index 95% rename from lib/custom_widgets/dashboard_item_texts_widget.dart rename to lib/widgets/dashboard/dashboard_item_texts_widget.dart index 71d705a8..9bfff90f 100644 --- a/lib/custom_widgets/dashboard_item_texts_widget.dart +++ b/lib/widgets/dashboard/dashboard_item_texts_widget.dart @@ -1,5 +1,5 @@ -import 'package:doctor_app_flutter/custom_widgets/rounded_container_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; class DashboardItemTexts extends StatefulWidget { diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart new file mode 100644 index 00000000..042f6751 --- /dev/null +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -0,0 +1,54 @@ +import 'package:doctor_app_flutter/widgets/shared/drawer_item_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/material.dart'; + +// OWNER : Ibrahim albitar +// DATE : 06-04-2020 +// DESCRIPTION : Custom App Drawer for app. + +class AppDrawer extends StatefulWidget { + @override + _AppDrawerState createState() => _AppDrawerState(); +} + +class _AppDrawerState extends State { + @override + Widget build(BuildContext context) { + return + + RoundedContainer( + Drawer( + child: ListView( + padding: EdgeInsets.zero, + children: [ + DrawerHeader( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + CircleAvatar( + radius: 40, + backgroundImage: NetworkImage("https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png"), + backgroundColor: Colors.transparent, + ), + Padding(padding: EdgeInsets.only(top: 10), child: Text("Dr. Chris evans", style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold , color: Colors.white), )), + Text("Director of medical records", style: TextStyle(fontSize: 14, fontWeight: FontWeight.normal, color: Colors.white),) + ], + ), + decoration: BoxDecoration( + color: Color(0x58434F) + ), + ), + DrawerItem() + ]) + ), + margin: 0, + customCornerRaduis: true, + topRight: 30, + bottomRight: 30, + backgroundColor: Color(0xff58434F), + ); + } + drawerNavigator(context, routeName) { + Navigator.of(context).pushNamed(routeName); + } +} diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart new file mode 100644 index 00000000..7200082d --- /dev/null +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -0,0 +1,25 @@ +import 'dart:ui'; + +import 'package:doctor_app_flutter/presentation/doctor_app_icons.dart'; +import 'package:flutter/material.dart'; + +// OWNER : Ibrahim albitar +// DATE : 08-04-2020 +// DESCRIPTION : Custom Drawer item for app. + +class DrawerItem extends StatefulWidget { + @override + _DrawerItemState createState() => _DrawerItemState(); +} + +class _DrawerItemState extends State { + @override + Widget build(BuildContext context) { + return Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Icon(DoctorApp.home_icon,color: Colors.white,), + Text("data",style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),), + ],); + } +} \ No newline at end of file diff --git a/lib/widgets/shared/rounded_container_widget.dart b/lib/widgets/shared/rounded_container_widget.dart new file mode 100644 index 00000000..a4f89bf5 --- /dev/null +++ b/lib/widgets/shared/rounded_container_widget.dart @@ -0,0 +1,72 @@ +import 'package:flutter/material.dart'; + +// OWNER : Ibrahim albitar +// DATE : 05-04-2020 +// DESCRIPTION : Custom widget for rounded container and custom decoration + +class RoundedContainer extends StatefulWidget { + final double raduis; + final Color backgroundColor; + final double margin; + final double elevation; + final bool showBorder; + final Color borderColor; + final bool customCornerRaduis; + final double topLeft; + final double bottomRight; + final double topRight; + final double bottomLeft; + final Widget widget; + + RoundedContainer( + this.widget, + {this.raduis = 10, + this.backgroundColor = Colors.white, + this.margin = 10, + this.elevation = 1, + this.showBorder = false, + this.borderColor = Colors.red, + this.customCornerRaduis = false, + this.topLeft = 0, + this.topRight = 0, + this.bottomRight = 0, + this.bottomLeft = 0, + }); + + @override + _RoundedContainerState createState() => _RoundedContainerState(); +} + +class _RoundedContainerState extends State { + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.all(widget.margin), + decoration: widget.showBorder == true + ? BoxDecoration( + border: Border.all(color: Colors.red, width: 1), + borderRadius: widget.customCornerRaduis + ? BorderRadius.only( + topLeft: Radius.circular(widget.topLeft), + topRight: Radius.circular(widget.topRight), + bottomRight: Radius.circular(widget.bottomRight), + bottomLeft: Radius.circular(widget.bottomLeft)) + : BorderRadius.circular(widget.raduis), + ) + : null, + child: Card( + margin: EdgeInsets.all(0), + shape: RoundedRectangleBorder( + borderRadius: widget.customCornerRaduis + ? BorderRadius.only( + topLeft: Radius.circular(widget.topLeft), + topRight: Radius.circular(widget.topRight), + bottomRight: Radius.circular(widget.bottomRight), + bottomLeft: Radius.circular(widget.bottomLeft)) + : BorderRadius.circular(widget.raduis), + ), + color: widget.backgroundColor, + child: widget.widget, + )); + } +}