|
|
|
|
@ -26,6 +26,7 @@ import 'package:doctor_app_flutter/utils/utils.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/buttons/app_buttons_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';
|
|
|
|
|
@ -34,6 +35,7 @@ import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:sticky_headers/sticky_headers/widget.dart';
|
|
|
|
|
|
|
|
|
|
import '../patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
|
|
|
|
|
import 'label.dart';
|
|
|
|
|
|
|
|
|
|
class HomeScreen extends StatefulWidget {
|
|
|
|
|
@ -311,17 +313,19 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
showPendingInfectiousDiseaseDialog(DashboardViewModel model) {
|
|
|
|
|
Utils.showConfirmationDialog(
|
|
|
|
|
context, TranslationBase.of(context).youHavePendingInterventions,
|
|
|
|
|
() async {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => PharmacyIntervention(),
|
|
|
|
|
settings: RouteSettings(name: 'PharmacyIntervention'),
|
|
|
|
|
));
|
|
|
|
|
}, isShowCancelButton: false);
|
|
|
|
|
// Utils.showConfirmationDialog(
|
|
|
|
|
// context, TranslationBase.of(context).youHavePendingInterventions,
|
|
|
|
|
// () async {
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
// context,
|
|
|
|
|
// MaterialPageRoute(
|
|
|
|
|
// builder: (context) => PharmacyIntervention(),
|
|
|
|
|
// settings: RouteSettings(name: 'PharmacyIntervention'),
|
|
|
|
|
// ));
|
|
|
|
|
// }, isShowCancelButton: false);
|
|
|
|
|
|
|
|
|
|
_showErrorBottomSheet(context, TranslationBase.of(context).youHavePendingInterventions);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Widget> homePatientsCardsWidget(
|
|
|
|
|
@ -568,4 +572,50 @@ class _HomeScreenState extends State<HomeScreen> {
|
|
|
|
|
colorIndex = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void _showErrorBottomSheet(BuildContext context, String errorMessage) {
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
context: context,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
|
|
|
|
|
),
|
|
|
|
|
backgroundColor: Colors.red[50], // Light red background
|
|
|
|
|
builder: (context) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
Icon(Icons.error_outline, color: Colors.red, size: 40),
|
|
|
|
|
const SizedBox(height: 10),
|
|
|
|
|
Text(
|
|
|
|
|
TranslationBase.of(context).pharmacyIntervention,
|
|
|
|
|
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: Colors.red),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 25),
|
|
|
|
|
Text(
|
|
|
|
|
errorMessage,
|
|
|
|
|
style: TextStyle(fontSize: 16, color: Colors.black87),
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 15),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: SizeConfig.realScreenWidth! * .4,
|
|
|
|
|
child:AppButton(
|
|
|
|
|
color: Colors.green,
|
|
|
|
|
onPressed: () => { // Navigator.pop(context);
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => PharmacyIntervention(),
|
|
|
|
|
settings: RouteSettings(name: 'PharmacyIntervention'),
|
|
|
|
|
))},
|
|
|
|
|
title: TranslationBase.of(context).open,
|
|
|
|
|
|
|
|
|
|
)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|