|
|
|
|
@ -22,6 +22,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
@ -66,7 +67,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
|
|
|
|
|
return BaseView<DashboardViewModel>(
|
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
model.startHomeScreenServices(projectsProvider, authenticationViewModel);
|
|
|
|
|
model.startHomeScreenServices(
|
|
|
|
|
projectsProvider, authenticationViewModel);
|
|
|
|
|
},
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
@ -211,37 +213,49 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
])),
|
|
|
|
|
content: Column(
|
|
|
|
|
children: [
|
|
|
|
|
model.dashboardItemsList.length > 0
|
|
|
|
|
? DashboardSwipeWidget(
|
|
|
|
|
model.dashboardItemsList,
|
|
|
|
|
model,
|
|
|
|
|
(sliderIndex) {
|
|
|
|
|
setState(() {
|
|
|
|
|
sliderActiveIndex = sliderIndex;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
model.dashboardItemsList.length > 0
|
|
|
|
|
? FractionallySizedBox(
|
|
|
|
|
widthFactor: 0.90,
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
sliderActiveIndex == 1
|
|
|
|
|
? DashboardSliderItemWidget(
|
|
|
|
|
model.dashboardItemsList[4])
|
|
|
|
|
: sliderActiveIndex == 0
|
|
|
|
|
? DashboardSliderItemWidget(
|
|
|
|
|
model.dashboardItemsList[3])
|
|
|
|
|
: DashboardSliderItemWidget(
|
|
|
|
|
model.dashboardItemsList[6]),
|
|
|
|
|
])))
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
if (model.state != ViewState.ErrorLocal)
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
model.dashboardItemsList.length > 0
|
|
|
|
|
? DashboardSwipeWidget(
|
|
|
|
|
model.dashboardItemsList,
|
|
|
|
|
model,
|
|
|
|
|
(sliderIndex) {
|
|
|
|
|
setState(() {
|
|
|
|
|
sliderActiveIndex = sliderIndex;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
model.dashboardItemsList.length > 0
|
|
|
|
|
? FractionallySizedBox(
|
|
|
|
|
widthFactor: 0.90,
|
|
|
|
|
child: Container(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
sliderActiveIndex == 1
|
|
|
|
|
? DashboardSliderItemWidget(
|
|
|
|
|
model.dashboardItemsList[4])
|
|
|
|
|
: sliderActiveIndex == 0
|
|
|
|
|
? DashboardSliderItemWidget(
|
|
|
|
|
model.dashboardItemsList[3])
|
|
|
|
|
: DashboardSliderItemWidget(
|
|
|
|
|
model.dashboardItemsList[6]),
|
|
|
|
|
])))
|
|
|
|
|
: SizedBox(),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
else
|
|
|
|
|
Container(
|
|
|
|
|
child: ErrorMessage(
|
|
|
|
|
error: model.error,
|
|
|
|
|
)),
|
|
|
|
|
FractionallySizedBox(
|
|
|
|
|
// widthFactor: 0.90,
|
|
|
|
|
child: Container(
|
|
|
|
|
@ -299,6 +313,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
|
|
]),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
@ -397,11 +412,11 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => OutPatientsScreen(
|
|
|
|
|
patientSearchRequestModel: PatientSearchRequestModel(
|
|
|
|
|
from: date,
|
|
|
|
|
to: date,
|
|
|
|
|
doctorID:
|
|
|
|
|
authenticationViewModel.doctorProfile.doctorID),),
|
|
|
|
|
patientSearchRequestModel: PatientSearchRequestModel(
|
|
|
|
|
from: date,
|
|
|
|
|
to: date,
|
|
|
|
|
doctorID: authenticationViewModel.doctorProfile.doctorID),
|
|
|
|
|
),
|
|
|
|
|
settings: RouteSettings(name: 'OutPatientsScreen'),
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
|