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/QR_reader_screen.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; final String iconURL = 'assets/images/dashboard_icon/'; @override _DashboardScreenState createState() => _DashboardScreenState(); } class _DashboardScreenState extends State { HospitalProvider projectsProvider; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); return SafeArea( bottom: true, child: Scaffold( body: SingleChildScrollView( child: SizedBox( height: MediaQuery.of(context).size.height * 1.09, child: Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( margin: EdgeInsets.only(left: 10, top: 10), child: AppText( TranslationBase.of(context).familyMedicine, fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.5, ), alignment: Alignment.centerLeft, ), Container( margin: EdgeInsets.only(left: 10, top: 10, right: 10), child: Icon( Icons.settings, size: SizeConfig.textMultiplier * 2.5, )) ]), Container( margin: EdgeInsets.only(left: 10, top: 5), child: AppText( TranslationBase.of(context).todayStatistics, fontWeight: FontWeight.bold, ), alignment: Alignment.centerLeft, ), Expanded( flex: 3, child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( flex: 2, child: RoundedContainer( child: CircularPercentIndicator( radius: 100, animation: true, animationDuration: 1200, lineWidth: 7.0, percent: .75, center: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ AppText("38", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 4), AppText(TranslationBase.of(context).outPatients, fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 1.1, 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: [ Expanded( flex: 1, child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( child: DashboardItemTexts( TranslationBase.of(context).arrived, "23", )), Expanded( child: DashboardItemTexts( TranslationBase.of(context) .notArrived, "23", ), ), ], ), ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( child: DashboardItemTexts( TranslationBase.of(context).er, "23", )), Expanded( child: DashboardItemTexts( TranslationBase.of(context).walkIn, "23", )), ], )), ], ), )) ], ), ), Expanded( flex: 2, child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( flex: 2, child: new DashboardItemIconText( widget.iconURL + 'lab_results.svg', "08", TranslationBase.of(context).labResult, backgroundColor: Colors.black45, // valueFontColor: Colors.white, // titleFontColor: Colors.white, // iconColor: Colors.white, ), ), Expanded( flex: 2, child: new DashboardItemIconText( widget.iconURL + 'radiology.svg', "10", TranslationBase.of(context).radiology, backgroundColor: Colors.black45, // valueFontColor: Colors.white, // titleFontColor: Colors.white, // iconColor: Colors.white, )), Expanded( flex: 2, child: new DashboardItemIconText( widget.iconURL + 'referral.svg', "05", TranslationBase.of(context).referral, backgroundColor: Colors.black45, // valueFontColor: Colors.white, // titleFontColor: Colors.white, // iconColor: Colors.white, )), ], ), ), Expanded( flex: 2, child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( flex: 2, child: new DashboardItemIconText( widget.iconURL + 'in_patient_white.svg', "23", "In-Patient", showBorder: true, backgroundColor: Colors.red[900], iconColor: Colors.white), ), Expanded( flex: 2, child: new DashboardItemIconText( widget.iconURL + 'operations.svg', "23", TranslationBase.of(context).operations, showBorder: true, backgroundColor: Colors.red[900], )), ], ), ), Expanded( flex: 1, child: Container( margin: EdgeInsets.all(10), child: AppText( TranslationBase.of(context).patientServices, fontWeight: FontWeight.bold, ), alignment: Alignment.centerLeft, ), ), Expanded( flex: 2, child: Row( children: [ Expanded( flex: 2, child: InkWell( child: DashboardItemIconText( widget.iconURL + 'search_patient.svg', "", TranslationBase.of(context).searchPatient, showBorder: true, backgroundColor: Colors.white, valueFontColor: Colors.black, titleFontColor: Colors.black, iconColor: Colors.black, titleFontSize: SizeConfig.textMultiplier * 2, ), 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( widget.iconURL + 'message_icon.svg', "", TranslationBase.of(context).doctorReply, showBorder: true, backgroundColor: Colors.white, valueFontColor: Colors.black, titleFontColor: Colors.black, iconColor: Colors.black, titleFontSize: SizeConfig.textMultiplier * 2, ), ), ), ], ), ), Expanded( flex: 2, child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( flex: 1, child: InkWell( child: DashboardItemIconText( widget.iconURL + 'search_patient.svg', "", "Search Medicine", showBorder: true, backgroundColor: Colors.white, valueFontColor: Colors.black, titleFontColor: Colors.black, iconColor: Colors.black, titleFontSize: SizeConfig.textMultiplier * 2, ), 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( widget.iconURL + 'referral.svg', "", "My Referral Patient", showBorder: true, backgroundColor: Colors.white, valueFontColor: Colors.black, titleFontColor: Colors.black, iconColor: Colors.black, titleFontSize: SizeConfig.textMultiplier * 2, ), ), ), ], ), ), Expanded( flex: 2, child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Expanded( flex: 1, child: InkWell( onTap: () { Navigator.push( context, MaterialPageRoute( builder: (context) => ChangeNotifierProvider( create: (_) => MyReferredPatientProvider(), child: MyReferredPatient(), ), ), ); }, child: DashboardItemIconText( widget.iconURL + 'referral.svg', "", "My Referred Patient", showBorder: true, backgroundColor: Colors.white, valueFontColor: Colors.black, titleFontColor: Colors.black, iconColor: Colors.black, titleFontSize: SizeConfig.textMultiplier * 2, ), ), ), Expanded( flex: 1, child: InkWell( onTap: () { Navigator.of(context).pushNamed(QR_READER); }, child: DashboardItemIconText( widget.iconURL + 'qr-code.svg', "", "QR Reader", showBorder: true, backgroundColor: Colors.white, valueFontColor: Colors.black, titleFontColor: Colors.black, iconColor: Colors.black, titleFontSize: SizeConfig.textMultiplier * 2, ), ), ), ], )), ], ), //) // , //constraints: new BoxConstraints(), ), ), ), ); // Container( // ); } }