You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
214 lines
9.4 KiB
Dart
214 lines
9.4 KiB
Dart
|
6 years ago
|
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<DashboardPage> {
|
||
|
|
@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: <Widget>[
|
||
|
|
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: <Widget>[
|
||
|
|
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: <Widget>[
|
||
|
|
Expanded(
|
||
|
|
flex: 2,
|
||
|
|
child: RoundedContainer(
|
||
|
|
CircularPercentIndicator(
|
||
|
|
radius: 90.0,
|
||
|
|
animation: true,
|
||
|
|
animationDuration: 1200,
|
||
|
|
lineWidth: 7.0,
|
||
|
|
percent: .75,
|
||
|
|
center: Column( mainAxisAlignment: MainAxisAlignment.center,
|
||
|
|
children: <Widget>[
|
||
|
|
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: <Widget>[
|
||
|
|
Expanded(
|
||
|
|
flex: 1,
|
||
|
|
child: Column(
|
||
|
|
crossAxisAlignment:
|
||
|
|
CrossAxisAlignment.stretch,
|
||
|
|
children: <Widget>[
|
||
|
|
Expanded(
|
||
|
|
child: DashboardItemTexts("Arrived","23",)),
|
||
|
|
Expanded(
|
||
|
|
child: DashboardItemTexts("Not Arrived","23",)),
|
||
|
|
],
|
||
|
|
)),
|
||
|
|
Expanded(
|
||
|
|
child: Column(
|
||
|
|
crossAxisAlignment:
|
||
|
|
CrossAxisAlignment.stretch,
|
||
|
|
children: <Widget>[
|
||
|
|
Expanded(
|
||
|
|
child: DashboardItemTexts("ER","23",)),
|
||
|
|
Expanded(
|
||
|
|
child: DashboardItemTexts("Walk-in","23",)),
|
||
|
|
],
|
||
|
|
)),
|
||
|
|
],
|
||
|
|
))
|
||
|
|
])),
|
||
|
|
Expanded(
|
||
|
|
flex: 2,
|
||
|
|
child: Row(
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||
|
|
children: <Widget>[
|
||
|
|
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: <Widget>[
|
||
|
|
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: <Widget>[
|
||
|
|
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: <Widget>[
|
||
|
|
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],)),
|
||
|
|
],
|
||
|
|
)),
|
||
|
|
],
|
||
|
|
)));
|
||
|
|
}
|
||
|
|
}
|