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.
386 lines
16 KiB
Dart
386 lines
16 KiB
Dart
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart';
|
|
import 'package:doctor_app_flutter/providers/medicine_provider.dart';
|
|
import 'package:doctor_app_flutter/providers/hospital_provider.dart';
|
|
import 'package:doctor_app_flutter/providers/referral_patient_provider.dart';
|
|
import 'package:doctor_app_flutter/providers/referred_patient_provider.dart';
|
|
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
import 'package:provider/provider.dart';
|
|
import '../routes.dart';
|
|
import '../widgets/shared/app_texts_widget.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:percent_indicator/circular_percent_indicator.dart';
|
|
|
|
import '../presentation/doctor_app_icons.dart';
|
|
import '../widgets/dashboard/dashboard_item_icons_texts.dart';
|
|
import '../widgets/dashboard/dashboard_item_texts_widget.dart';
|
|
import '../widgets/shared/rounded_container_widget.dart';
|
|
import 'doctor/doctor_reply_screen.dart';
|
|
import 'doctor/my_referral_patient_screen.dart';
|
|
|
|
import 'doctor/my_referred_patient_screen.dart';
|
|
|
|
class DashboardScreen extends StatefulWidget {
|
|
DashboardScreen({Key key, this.title}) : super(key: key);
|
|
|
|
final String title;
|
|
|
|
@override
|
|
_DashboardScreenState createState() => _DashboardScreenState();
|
|
}
|
|
|
|
class _DashboardScreenState extends State<DashboardScreen> {
|
|
HospitalProvider projectsProvider;
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
projectsProvider = Provider.of(context);
|
|
return AppScaffold(
|
|
appBarTitle: TranslationBase.of(context).dashboardScreenToolbarTitle,
|
|
current: 0,
|
|
body: Container(
|
|
child: new SingleChildScrollView(
|
|
child: SizedBox(
|
|
height: MediaQuery.of(context).size.height,
|
|
child: Column(
|
|
children: <Widget>[
|
|
Expanded(
|
|
flex: 1,
|
|
child: Container(
|
|
margin: EdgeInsets.all(10),
|
|
child: AppText(
|
|
"Today's Statistics",
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
alignment: Alignment.centerLeft,
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 3,
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: <Widget>[
|
|
Expanded(
|
|
flex: 2,
|
|
child: RoundedContainer(
|
|
child: CircularPercentIndicator(
|
|
radius: 115.0,
|
|
animation: true,
|
|
animationDuration: 1200,
|
|
lineWidth: 7.0,
|
|
percent: .75,
|
|
center: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: <Widget>[
|
|
AppText("38",
|
|
fontWeight: FontWeight.bold,
|
|
fontSize: SizeConfig.textMultiplier * 4),
|
|
AppText("Out-Patients",
|
|
fontWeight: FontWeight.normal,
|
|
fontSize: SizeConfig.textMultiplier * 1.2,
|
|
color: Colors.grey[800]),
|
|
],
|
|
),
|
|
circularStrokeCap: CircularStrokeCap.butt,
|
|
backgroundColor: Colors.blueGrey[100],
|
|
progressColor: Colors.red,
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 2,
|
|
child: Padding(
|
|
padding: EdgeInsets.all(8),
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
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.black45,
|
|
// valueFontColor: Colors.white,
|
|
// titleFontColor: Colors.white,
|
|
// iconColor: Colors.white,
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 2,
|
|
child: new DashboardItemIconText(
|
|
DoctorApp.home_icon,
|
|
"10",
|
|
"Radiology",
|
|
backgroundColor: Colors.black45,
|
|
// valueFontColor: Colors.white,
|
|
// titleFontColor: Colors.white,
|
|
// iconColor: Colors.white,
|
|
)),
|
|
Expanded(
|
|
flex: 2,
|
|
child: new DashboardItemIconText(
|
|
DoctorApp.home_icon,
|
|
"05",
|
|
"Referral",
|
|
backgroundColor: Colors.black45,
|
|
// valueFontColor: Colors.white,
|
|
// titleFontColor: Colors.white,
|
|
// iconColor: Colors.white,
|
|
)),
|
|
],
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 2,
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: <Widget>[
|
|
Expanded(
|
|
flex: 2,
|
|
child: new DashboardItemIconText(
|
|
DoctorApp.home_icon,
|
|
"23",
|
|
"In-Patient",
|
|
showBorder: true,
|
|
backgroundColor: Colors.red[900],
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 2,
|
|
child: new DashboardItemIconText(
|
|
DoctorApp.home_icon,
|
|
"23",
|
|
"Operations",
|
|
showBorder: true,
|
|
backgroundColor: Colors.red[900],
|
|
)),
|
|
],
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: Container(
|
|
margin: EdgeInsets.all(10),
|
|
child: AppText(
|
|
"Patient Services",
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
alignment: Alignment.centerLeft,
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 2,
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: <Widget>[
|
|
Expanded(
|
|
flex: 2,
|
|
child: InkWell(
|
|
child: DashboardItemIconText(
|
|
DoctorApp.home_icon,
|
|
"",
|
|
"Search Patient",
|
|
showBorder: true,
|
|
backgroundColor: Colors.white,
|
|
valueFontColor: Colors.black,
|
|
titleFontColor: Colors.black,
|
|
iconColor: Colors.black,
|
|
titleFontSize: 16,
|
|
),
|
|
onTap: () {
|
|
Navigator.of(context).pushNamed(PATIENT_SEARCH);
|
|
},
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 2,
|
|
child: InkWell(
|
|
onTap: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => ChangeNotifierProvider(
|
|
create: (_) => DoctorReplyProvider(),
|
|
child: DoctorReplyScreen(),
|
|
),
|
|
),
|
|
);
|
|
},
|
|
child: DashboardItemIconText(
|
|
DoctorApp.home_icon,
|
|
"",
|
|
"Doctor Reply",
|
|
showBorder: true,
|
|
backgroundColor: Colors.white,
|
|
valueFontColor: Colors.black,
|
|
titleFontColor: Colors.black,
|
|
iconColor: Colors.black,
|
|
titleFontSize: 16,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 2,
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: <Widget>[
|
|
Expanded(
|
|
flex: 1,
|
|
child: InkWell(
|
|
child: DashboardItemIconText(
|
|
DoctorApp.home_icon,
|
|
"",
|
|
"Search Medicine",
|
|
showBorder: true,
|
|
backgroundColor: Colors.white,
|
|
valueFontColor: Colors.black,
|
|
titleFontColor: Colors.black,
|
|
iconColor: Colors.black,
|
|
titleFontSize: 16,
|
|
),
|
|
onTap: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => ChangeNotifierProvider(
|
|
create: (_) => MedicineProvider(),
|
|
child: MedicineSearchScreen(),
|
|
),
|
|
),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 1,
|
|
child: InkWell(
|
|
onTap: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => ChangeNotifierProvider(
|
|
create: (_) => MyReferralPatientProvider(),
|
|
child: MyReferralPatient(),
|
|
),
|
|
),
|
|
);
|
|
},
|
|
child: DashboardItemIconText(
|
|
DoctorApp.home_icon,
|
|
"",
|
|
"My Referral Patient",
|
|
showBorder: true,
|
|
backgroundColor: Colors.white,
|
|
valueFontColor: Colors.black,
|
|
titleFontColor: Colors.black,
|
|
iconColor: Colors.black,
|
|
titleFontSize: 16,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
Expanded(
|
|
flex: 2,
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: <Widget>[
|
|
Expanded(
|
|
flex: 1,
|
|
child: InkWell(
|
|
onTap: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => ChangeNotifierProvider(
|
|
create: (_) => MyReferredPatientProvider(),
|
|
child: MyReferredPatient(),
|
|
),
|
|
),
|
|
);
|
|
},
|
|
child: DashboardItemIconText(
|
|
DoctorApp.home_icon,
|
|
"",
|
|
"My Referred Patient",
|
|
showBorder: true,
|
|
backgroundColor: Colors.white,
|
|
valueFontColor: Colors.black,
|
|
titleFontColor: Colors.black,
|
|
iconColor: Colors.black,
|
|
titleFontSize: 16,
|
|
),
|
|
),
|
|
),
|
|
Expanded(flex: 1, child: Container())
|
|
],
|
|
)),
|
|
],
|
|
),
|
|
//)
|
|
|
|
// ,
|
|
//constraints: new BoxConstraints(),
|
|
),
|
|
)));
|
|
|
|
// Container(
|
|
|
|
// );
|
|
}
|
|
}
|