|
|
|
|
@ -1,14 +1,15 @@
|
|
|
|
|
import 'package:charts_flutter/flutter.dart' as charts;
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
|
|
|
|
|
import 'package:charts_flutter/flutter.dart' as charts;
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart';
|
|
|
|
|
@ -27,25 +28,26 @@ import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_swiper/flutter_swiper.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
|
|
|
|
|
import '../routes.dart';
|
|
|
|
|
import '../widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import '../widgets/shared/rounded_container_widget.dart';
|
|
|
|
|
|
|
|
|
|
import '../../routes.dart';
|
|
|
|
|
import '../../widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import '../../widgets/shared/rounded_container_widget.dart';
|
|
|
|
|
import 'home_page_card.dart';
|
|
|
|
|
|
|
|
|
|
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
|
|
|
Helpers helpers = Helpers();
|
|
|
|
|
|
|
|
|
|
class DashboardScreen extends StatefulWidget {
|
|
|
|
|
DashboardScreen({Key key, this.title}) : super(key: key);
|
|
|
|
|
class HomeScreen extends StatefulWidget {
|
|
|
|
|
HomeScreen({Key key, this.title}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
final String title;
|
|
|
|
|
final String iconURL = 'assets/images/dashboard_icon/';
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_DashboardScreenState createState() => _DashboardScreenState();
|
|
|
|
|
_HomeScreenState createState() => _HomeScreenState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
|
|
|
|
|
HospitalViewModel hospitalProvider;
|
|
|
|
|
AuthViewModel authProvider;
|
|
|
|
|
@ -78,6 +80,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
SessionID: "5G0yXn0Jnq",
|
|
|
|
|
IsLoginForDoctorApp: true,
|
|
|
|
|
PatientOutSA: false);
|
|
|
|
|
|
|
|
|
|
void didChangeDependencies() async {
|
|
|
|
|
super.didChangeDependencies();
|
|
|
|
|
if (_isInit) {
|
|
|
|
|
@ -109,9 +112,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BuildContext myContext;
|
|
|
|
|
|
|
|
|
|
GlobalKey _one = GlobalKey();
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
myContext = context;
|
|
|
|
|
@ -132,33 +132,21 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
body: ListView(children: [
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(height: 20),
|
|
|
|
|
Stack(children: [
|
|
|
|
|
IconButton(
|
|
|
|
|
icon: Image.asset('assets/images/menu.png',
|
|
|
|
|
height: 50, width: 50),
|
|
|
|
|
iconSize: 18,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
onPressed: () => Scaffold.of(context).openDrawer(),
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
ProfileWelcomeWidget(
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
|
margin: EdgeInsets.all(4),
|
|
|
|
|
decoration: new BoxDecoration(
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
|
),
|
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
|
minWidth: 20,
|
|
|
|
|
minHeight: 20,
|
|
|
|
|
),
|
|
|
|
|
child: new Text(
|
|
|
|
|
projectsProvider.doctorClinicsList.length
|
|
|
|
|
.toString(),
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: projectsProvider.isArabic ? 10 : 11,
|
|
|
|
|
),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * .6,
|
|
|
|
|
// // height: 100,
|
|
|
|
|
@ -183,15 +171,42 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
.map((item) {
|
|
|
|
|
return Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.end,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.all(2),
|
|
|
|
|
margin: EdgeInsets.all(2),
|
|
|
|
|
decoration: new BoxDecoration(
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.circular(
|
|
|
|
|
20),
|
|
|
|
|
),
|
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
|
minWidth: 20,
|
|
|
|
|
minHeight: 20,
|
|
|
|
|
),
|
|
|
|
|
child: new Text(
|
|
|
|
|
projectsProvider
|
|
|
|
|
.doctorClinicsList
|
|
|
|
|
.length
|
|
|
|
|
.toString(),
|
|
|
|
|
style: new TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: projectsProvider
|
|
|
|
|
.isArabic
|
|
|
|
|
? 10
|
|
|
|
|
: 11,
|
|
|
|
|
),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
AppText(item.clinicName,
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.textMultiplier *
|
|
|
|
|
1.6,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
textAlign:
|
|
|
|
|
TextAlign.center),
|
|
|
|
|
textAlign: TextAlign.end),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
@ -205,9 +220,9 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
.doctorClinicsList
|
|
|
|
|
.map((item) {
|
|
|
|
|
return DropdownMenuItem(
|
|
|
|
|
child: Text(
|
|
|
|
|
child: AppText(
|
|
|
|
|
item.clinicName,
|
|
|
|
|
textAlign: TextAlign.end,
|
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
|
),
|
|
|
|
|
value: item.clinicID,
|
|
|
|
|
);
|
|
|
|
|
@ -222,16 +237,16 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
isClilic: true,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.20,
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.24,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Positioned(
|
|
|
|
|
right: 9.0,
|
|
|
|
|
left: 9,
|
|
|
|
|
top: MediaQuery.of(context).size.height * .05,
|
|
|
|
|
top: MediaQuery.of(context).size.height * .08,
|
|
|
|
|
child: Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.30,
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.35,
|
|
|
|
|
child: model.dashboardItemsList.length > 0
|
|
|
|
|
? new Swiper(
|
|
|
|
|
onIndexChanged: (index) {
|
|
|
|
|
@ -242,10 +257,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
return getSwiperWidget(model)[index];
|
|
|
|
|
return getSwipeWidget(model)[index];
|
|
|
|
|
},
|
|
|
|
|
itemCount: 3,
|
|
|
|
|
|
|
|
|
|
itemHeight: 300,
|
|
|
|
|
pagination: new SwiperCustomPagination(builder:
|
|
|
|
|
(BuildContext context,
|
|
|
|
|
SwiperPluginConfig config) {
|
|
|
|
|
@ -253,7 +268,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
children: [
|
|
|
|
|
Positioned(
|
|
|
|
|
bottom: -5,
|
|
|
|
|
bottom: 0,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: InkWell(
|
|
|
|
|
onTap: () {},
|
|
|
|
|
@ -263,39 +278,21 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: 10,
|
|
|
|
|
width: 50,
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.all(2),
|
|
|
|
|
color:
|
|
|
|
|
config.activeIndex ==
|
|
|
|
|
0
|
|
|
|
|
? Colors.black
|
|
|
|
|
: Colors
|
|
|
|
|
.grey),
|
|
|
|
|
Container(
|
|
|
|
|
height: 10,
|
|
|
|
|
width: 50,
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.all(2),
|
|
|
|
|
color:
|
|
|
|
|
config.activeIndex ==
|
|
|
|
|
1
|
|
|
|
|
? Colors.black
|
|
|
|
|
: Colors
|
|
|
|
|
.grey),
|
|
|
|
|
Container(
|
|
|
|
|
height: 10,
|
|
|
|
|
width: 50,
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.all(2),
|
|
|
|
|
color:
|
|
|
|
|
config.activeIndex ==
|
|
|
|
|
2
|
|
|
|
|
? Colors.black
|
|
|
|
|
: Colors
|
|
|
|
|
.grey),
|
|
|
|
|
config.activeIndex == 0
|
|
|
|
|
? getSwiperPagiantion(
|
|
|
|
|
true)
|
|
|
|
|
: getSwiperPagiantion(
|
|
|
|
|
false),
|
|
|
|
|
config.activeIndex == 1
|
|
|
|
|
? getSwiperPagiantion(
|
|
|
|
|
true)
|
|
|
|
|
: getSwiperPagiantion(
|
|
|
|
|
false),
|
|
|
|
|
config.activeIndex == 2
|
|
|
|
|
? getSwiperPagiantion(
|
|
|
|
|
true)
|
|
|
|
|
: getSwiperPagiantion(
|
|
|
|
|
false),
|
|
|
|
|
],
|
|
|
|
|
)))))
|
|
|
|
|
]);
|
|
|
|
|
@ -305,430 +302,6 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
// control: new SwiperControl(),
|
|
|
|
|
)
|
|
|
|
|
: SizedBox()),
|
|
|
|
|
|
|
|
|
|
//ExpandableCardContainer(
|
|
|
|
|
// expandedChild: Container(
|
|
|
|
|
// margin: EdgeInsets.only(left: 10, right: 10),
|
|
|
|
|
// height: MediaQuery.of(context).orientation ==
|
|
|
|
|
// Orientation.portrait
|
|
|
|
|
// ? MediaQuery.of(context).size.height * 0.22
|
|
|
|
|
// : MediaQuery.of(context).size.height * 0.25,
|
|
|
|
|
// width: double.infinity,
|
|
|
|
|
// child: Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// DashboardItem(
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// this.isExpanded = false;
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// child: Padding(
|
|
|
|
|
// padding: const EdgeInsets.all(8.0),
|
|
|
|
|
// child: Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// model.dashboardItemsList
|
|
|
|
|
// .length >
|
|
|
|
|
// 0
|
|
|
|
|
// ? isInpatient == 'in'
|
|
|
|
|
// ? model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 0]
|
|
|
|
|
// .summaryoptions[0]
|
|
|
|
|
// .value
|
|
|
|
|
// .toString()
|
|
|
|
|
// : model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 1]
|
|
|
|
|
// .summaryoptions[0]
|
|
|
|
|
// .value
|
|
|
|
|
// .toString()
|
|
|
|
|
// : "",
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// fontSize: 24,
|
|
|
|
|
// ),
|
|
|
|
|
// AppText(
|
|
|
|
|
// model.dashboardItemsList
|
|
|
|
|
// .length >
|
|
|
|
|
// 0
|
|
|
|
|
// ? isInpatient == 'in'
|
|
|
|
|
// ? model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 0]
|
|
|
|
|
// .summaryoptions[0]
|
|
|
|
|
// .kPIParameter
|
|
|
|
|
// : model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 1]
|
|
|
|
|
// .summaryoptions[0]
|
|
|
|
|
// .kPIParameter
|
|
|
|
|
// : "",
|
|
|
|
|
// //'My Admitted Patient',
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// )),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// model.dashboardItemsList
|
|
|
|
|
// .length >
|
|
|
|
|
// 0
|
|
|
|
|
// ? isInpatient == 'in'
|
|
|
|
|
// ? model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 0]
|
|
|
|
|
// .summaryoptions[1]
|
|
|
|
|
// .value
|
|
|
|
|
// .toString()
|
|
|
|
|
// : model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 1]
|
|
|
|
|
// .summaryoptions[1]
|
|
|
|
|
// .value
|
|
|
|
|
// .toString()
|
|
|
|
|
// : "",
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// fontSize: 28,
|
|
|
|
|
// ),
|
|
|
|
|
// AppText(
|
|
|
|
|
// model.dashboardItemsList
|
|
|
|
|
// .length >
|
|
|
|
|
// 0
|
|
|
|
|
// ? isInpatient == 'in'
|
|
|
|
|
// ? model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 0]
|
|
|
|
|
// .summaryoptions[1]
|
|
|
|
|
// .kPIParameter
|
|
|
|
|
// : model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 1]
|
|
|
|
|
// .summaryoptions[1]
|
|
|
|
|
// .kPIParameter
|
|
|
|
|
// : "",
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// )),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// model.dashboardItemsList
|
|
|
|
|
// .length >
|
|
|
|
|
// 0
|
|
|
|
|
// ? isInpatient == 'in'
|
|
|
|
|
// ? model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 0]
|
|
|
|
|
// .summaryoptions[2]
|
|
|
|
|
// .value
|
|
|
|
|
// .toString()
|
|
|
|
|
// : model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 1]
|
|
|
|
|
// .summaryoptions[2]
|
|
|
|
|
// .value
|
|
|
|
|
// .toString()
|
|
|
|
|
// : "",
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// fontSize: 28),
|
|
|
|
|
// AppText(
|
|
|
|
|
// model.dashboardItemsList
|
|
|
|
|
// .length >
|
|
|
|
|
// 0
|
|
|
|
|
// ? isInpatient == 'in'
|
|
|
|
|
// ? model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 0]
|
|
|
|
|
// .summaryoptions[2]
|
|
|
|
|
// .kPIParameter
|
|
|
|
|
// .toString()
|
|
|
|
|
// : model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 1]
|
|
|
|
|
// .summaryoptions[2]
|
|
|
|
|
// .kPIParameter
|
|
|
|
|
// .toString()
|
|
|
|
|
// : "",
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// textAlign: TextAlign.center)
|
|
|
|
|
// ],
|
|
|
|
|
// ))
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// model.dashboardItemsList
|
|
|
|
|
// .length >
|
|
|
|
|
// 0
|
|
|
|
|
// ? isInpatient == 'in'
|
|
|
|
|
// ? model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 0]
|
|
|
|
|
// .summaryoptions[3]
|
|
|
|
|
// .value
|
|
|
|
|
// .toString()
|
|
|
|
|
// : model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 1]
|
|
|
|
|
// .summaryoptions[3]
|
|
|
|
|
// .value
|
|
|
|
|
// .toString()
|
|
|
|
|
// : "",
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// fontSize: 28),
|
|
|
|
|
// AppText(
|
|
|
|
|
// model.dashboardItemsList
|
|
|
|
|
// .length >
|
|
|
|
|
// 0
|
|
|
|
|
// ? isInpatient == 'in'
|
|
|
|
|
// ? model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 0]
|
|
|
|
|
// .summaryoptions[3]
|
|
|
|
|
// .kPIParameter
|
|
|
|
|
// .toString()
|
|
|
|
|
// : model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 1]
|
|
|
|
|
// .summaryoptions[3]
|
|
|
|
|
// .kPIParameter
|
|
|
|
|
// .toString()
|
|
|
|
|
// : "",
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// textAlign: TextAlign.center)
|
|
|
|
|
// ],
|
|
|
|
|
// )),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// AppText(
|
|
|
|
|
// model.dashboardItemsList
|
|
|
|
|
// .length >
|
|
|
|
|
// 0
|
|
|
|
|
// ? isInpatient == 'in'
|
|
|
|
|
// ? model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 0]
|
|
|
|
|
// .summaryoptions[
|
|
|
|
|
// 4]
|
|
|
|
|
// .value
|
|
|
|
|
// .toString()
|
|
|
|
|
// : model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 1]
|
|
|
|
|
// .summaryoptions[
|
|
|
|
|
// 4]
|
|
|
|
|
// .value
|
|
|
|
|
// .toString()
|
|
|
|
|
// : "",
|
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// fontSize: 28),
|
|
|
|
|
// AppText(
|
|
|
|
|
// model.dashboardItemsList
|
|
|
|
|
// .length >
|
|
|
|
|
// 0
|
|
|
|
|
// ? isInpatient == 'in'
|
|
|
|
|
// ? model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 0]
|
|
|
|
|
// .summaryoptions[
|
|
|
|
|
// 4]
|
|
|
|
|
// .kPIParameter
|
|
|
|
|
// .toString()
|
|
|
|
|
// : model
|
|
|
|
|
// .dashboardItemsList[
|
|
|
|
|
// 1]
|
|
|
|
|
// .summaryoptions[
|
|
|
|
|
// 4]
|
|
|
|
|
// .kPIParameter
|
|
|
|
|
// .toString()
|
|
|
|
|
// : "",
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// textAlign: TextAlign.center)
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: Container(),
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// )),
|
|
|
|
|
// imageName: '5.png',
|
|
|
|
|
// color: HexColor('#B8382C'),
|
|
|
|
|
// hasBorder: false,
|
|
|
|
|
// width: MediaQuery.of(context).size.width * 0.9,
|
|
|
|
|
// height: MediaQuery.of(context).orientation ==
|
|
|
|
|
// Orientation.portrait
|
|
|
|
|
// ? MediaQuery.of(context).size.height * 0.22
|
|
|
|
|
// : MediaQuery.of(context).size.height * 0.25,
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// collapsedChild: Container(
|
|
|
|
|
// margin: EdgeInsets.only(left: 10, right: 10),
|
|
|
|
|
// height: MediaQuery.of(context).orientation ==
|
|
|
|
|
// Orientation.portrait
|
|
|
|
|
// ? MediaQuery.of(context).size.height * 0.15
|
|
|
|
|
// : MediaQuery.of(context).size.height * 0.25,
|
|
|
|
|
// width: double.infinity,
|
|
|
|
|
// child: Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// DashboardItem(
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// this.isExpanded = true;
|
|
|
|
|
// this.isInpatient = 'in';
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// child: Padding(
|
|
|
|
|
// padding: const EdgeInsets.all(8.0),
|
|
|
|
|
// child: Row(
|
|
|
|
|
// mainAxisAlignment:
|
|
|
|
|
// MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// Column(
|
|
|
|
|
// mainAxisAlignment:
|
|
|
|
|
// MainAxisAlignment.start,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// AppText(
|
|
|
|
|
// model.dashboardItemsList.length > 0
|
|
|
|
|
// ? getPatientCount(
|
|
|
|
|
// model.dashboardItemsList[0])
|
|
|
|
|
// : "",
|
|
|
|
|
// fontSize:
|
|
|
|
|
// SizeConfig.textMultiplier * 6,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// ),
|
|
|
|
|
// Flexible(
|
|
|
|
|
// child: AppText(
|
|
|
|
|
// TranslationBase.of(context).inPatient,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// textOverflow: TextOverflow.ellipsis,
|
|
|
|
|
// )),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// Padding(
|
|
|
|
|
// padding: EdgeInsets.all(5),
|
|
|
|
|
// child: Column(
|
|
|
|
|
// mainAxisAlignment:
|
|
|
|
|
// MainAxisAlignment.end,
|
|
|
|
|
// children: [
|
|
|
|
|
// Icon(
|
|
|
|
|
// DoctorApp.in_patient_white,
|
|
|
|
|
// size: 35,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// ))
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// imageName: '4.png',
|
|
|
|
|
// color: HexColor('#B8382C'),
|
|
|
|
|
// hasBorder: false,
|
|
|
|
|
// width: MediaQuery.of(context).size.width * 0.44,
|
|
|
|
|
// height: MediaQuery.of(context).orientation ==
|
|
|
|
|
// Orientation.portrait
|
|
|
|
|
// ? MediaQuery.of(context).size.height * 0.15
|
|
|
|
|
// : MediaQuery.of(context).size.height * 0.25,
|
|
|
|
|
// ),
|
|
|
|
|
// DashboardItem(
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// isExpanded = true;
|
|
|
|
|
// this.isInpatient = 'out';
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// child: Padding(
|
|
|
|
|
// padding: const EdgeInsets.all(8.0),
|
|
|
|
|
// child: Row(
|
|
|
|
|
// mainAxisAlignment:
|
|
|
|
|
// MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// Column(
|
|
|
|
|
// mainAxisAlignment:
|
|
|
|
|
// MainAxisAlignment.start,
|
|
|
|
|
// children: <Widget>[
|
|
|
|
|
// AppText(
|
|
|
|
|
// model.dashboardItemsList.length > 0
|
|
|
|
|
// ? getPatientCount(
|
|
|
|
|
// model.dashboardItemsList[1])
|
|
|
|
|
// : "",
|
|
|
|
|
// fontSize:
|
|
|
|
|
// SizeConfig.textMultiplier * 6,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// ),
|
|
|
|
|
// Flexible(
|
|
|
|
|
// child: AppText(
|
|
|
|
|
// TranslationBase.of(context)
|
|
|
|
|
// .outPatients,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// textOverflow: TextOverflow.ellipsis,
|
|
|
|
|
// )),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// Padding(
|
|
|
|
|
// padding: EdgeInsets.all(5),
|
|
|
|
|
// child: Column(
|
|
|
|
|
// mainAxisAlignment:
|
|
|
|
|
// MainAxisAlignment.end,
|
|
|
|
|
// children: [
|
|
|
|
|
// Icon(
|
|
|
|
|
// DoctorApp.out_patient,
|
|
|
|
|
// size: 35,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// ))
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// imageName: '5.png',
|
|
|
|
|
// color: HexColor('#B8382C'),
|
|
|
|
|
// hasBorder: false,
|
|
|
|
|
// width: MediaQuery.of(context).size.width * 0.44,
|
|
|
|
|
// height: MediaQuery.of(context).orientation ==
|
|
|
|
|
// Orientation.portrait
|
|
|
|
|
// ? MediaQuery.of(context).size.height * 0.15
|
|
|
|
|
// : MediaQuery.of(context).size.height * 0.25,
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// isExpanded: isExpanded,
|
|
|
|
|
// ))
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
model.dashboardItemsList.length > 0
|
|
|
|
|
@ -739,7 +312,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15,
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
sliderActiveIndex == 1
|
|
|
|
|
? Column(
|
|
|
|
|
@ -876,31 +449,37 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topRight: Radius.circular(50),
|
|
|
|
|
)),
|
|
|
|
|
padding: EdgeInsets.all(15),
|
|
|
|
|
margin: EdgeInsets.only(top: 15),
|
|
|
|
|
padding: EdgeInsets.only(left: 20, top: 10, right: 20),
|
|
|
|
|
margin: EdgeInsets.only(top: 10),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15,
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
width: 150,
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).patient,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.5,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).patients,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
height: .5,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins'),
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).services,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 3,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
)
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 22,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins'),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
@ -912,7 +491,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
DashboardItem(
|
|
|
|
|
HomePageCard(
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
@ -933,6 +512,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
.patientsreferral,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -947,7 +527,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
DashboardItem(
|
|
|
|
|
HomePageCard(
|
|
|
|
|
color: Colors.grey[300],
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
@ -968,6 +548,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
.arrivalpatient,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
|
fontSize: 15,
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -981,7 +562,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
DashboardItem(
|
|
|
|
|
HomePageCard(
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
@ -1002,7 +583,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
.searchmedicinepatient,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -1244,23 +825,23 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Widget> getSwiperWidget(model) {
|
|
|
|
|
List<Widget> getSwipeWidget(model) {
|
|
|
|
|
return [
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.32,
|
|
|
|
|
margin: 5,
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.35,
|
|
|
|
|
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(5.0),
|
|
|
|
|
child: getOutPatientStack(model.dashboardItemsList[1]))),
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.32,
|
|
|
|
|
margin: 5,
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.35,
|
|
|
|
|
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(5.0),
|
|
|
|
|
child: getOutPatientStack(model.dashboardItemsList[0]))),
|
|
|
|
|
RoundedContainer(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.24,
|
|
|
|
|
margin: 5,
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.35,
|
|
|
|
|
margin: EdgeInsets.only(top: 15, bottom: 15, left: 10, right: 10),
|
|
|
|
|
child:
|
|
|
|
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
@ -1278,12 +859,32 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: Padding(
|
|
|
|
|
child: AppText(
|
|
|
|
|
TranslationBase.of(context).referral,
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
|
padding: EdgeInsets.all(10))),
|
|
|
|
|
padding: EdgeInsets.all(8),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.patients,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
height: .5,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins'),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.referral,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 22,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
fontFamily: 'Poppins'),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
))),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 2,
|
|
|
|
|
child: Column(
|
|
|
|
|
@ -1341,91 +942,21 @@ class _DashboardScreenState extends State<DashboardScreen> {
|
|
|
|
|
])),
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TODO Move to it file
|
|
|
|
|
class DashboardItem extends StatelessWidget {
|
|
|
|
|
const DashboardItem(
|
|
|
|
|
{this.hasBorder = false,
|
|
|
|
|
this.imageName,
|
|
|
|
|
@required this.child,
|
|
|
|
|
this.onTap,
|
|
|
|
|
Key key,
|
|
|
|
|
this.width,
|
|
|
|
|
this.height,
|
|
|
|
|
this.color,
|
|
|
|
|
this.opacity = 0.4})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
final bool hasBorder;
|
|
|
|
|
final String imageName;
|
|
|
|
|
final Widget child;
|
|
|
|
|
final Function onTap;
|
|
|
|
|
final double width;
|
|
|
|
|
final double height;
|
|
|
|
|
final Color color;
|
|
|
|
|
final double opacity;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: onTap,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: width != null ? width : MediaQuery.of(context).size.width * 0.29,
|
|
|
|
|
height: height != null
|
|
|
|
|
? height
|
|
|
|
|
: MediaQuery.of(context).orientation == Orientation.portrait
|
|
|
|
|
? MediaQuery.of(context).size.height * 0.18
|
|
|
|
|
: MediaQuery.of(context).size.height * 0.36,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: !hasBorder
|
|
|
|
|
? color != null
|
|
|
|
|
? color
|
|
|
|
|
: HexColor('#050705').withOpacity(opacity)
|
|
|
|
|
: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(15.0),
|
|
|
|
|
border: hasBorder
|
|
|
|
|
? Border.all(width: 1.0, color: const Color(0xffcccccc))
|
|
|
|
|
: Border.all(width: 0.0, color: Colors.transparent),
|
|
|
|
|
image: imageName != null
|
|
|
|
|
? DecorationImage(
|
|
|
|
|
image: AssetImage('assets/images/dashboard/${imageName}'),
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
colorFilter: new ColorFilter.mode(
|
|
|
|
|
Colors.black.withOpacity(0.2), BlendMode.dstIn),
|
|
|
|
|
)
|
|
|
|
|
: null,
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: child,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDashboardWidget() {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class ExpandableCardContainer extends StatefulWidget {
|
|
|
|
|
final bool isExpanded;
|
|
|
|
|
final Widget collapsedChild;
|
|
|
|
|
final Widget expandedChild;
|
|
|
|
|
|
|
|
|
|
const ExpandableCardContainer(
|
|
|
|
|
{Key key, this.isExpanded, this.collapsedChild, this.expandedChild})
|
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
_ExpandableCardContainerState createState() =>
|
|
|
|
|
_ExpandableCardContainerState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _ExpandableCardContainerState extends State<ExpandableCardContainer> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return new AnimatedContainer(
|
|
|
|
|
duration: new Duration(milliseconds: 1000),
|
|
|
|
|
curve: Curves.easeInOut,
|
|
|
|
|
child: widget.isExpanded ? widget.expandedChild : widget.collapsedChild,
|
|
|
|
|
);
|
|
|
|
|
getSwiperPagiantion(active) {
|
|
|
|
|
return active == true
|
|
|
|
|
? Container(
|
|
|
|
|
height: 5,
|
|
|
|
|
width: 30,
|
|
|
|
|
// margin: EdgeInsets.only(10),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(5), color: Colors.black),
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
height: 5,
|
|
|
|
|
width: 8,
|
|
|
|
|
margin: EdgeInsets.all(2),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(10), color: Colors.grey));
|
|
|
|
|
}
|
|
|
|
|
}
|