bottomsheet added.

update_3.16.0_CR5439_Pharmacy_Intervention
Sultan Khan 7 months ago
parent 1b50f5005a
commit 45dab6bd58

@ -1252,5 +1252,5 @@ const Map<String, Map<String, String>> localizedValues = {
"selectReaction": {"en": "Select Reaction", "ar":"حدد رد الفعل"},
"progressNoteCanNotBeEmpty": {"en": "Progress Note Can Not Be Empty", "ar":"تعذر تنفيذ الإجراء"},
"youHavePendingInterventions": {"en": "You Have Pending Interventions. That need your attention", "ar":"لديك تدخلات معلقة. التي تحتاج إلى اهتمامك"},
"open": {"en": "Open", "ar":"يفتح"},
};

@ -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,
)),
],
),
);
},
);
}
}

@ -1994,6 +1994,7 @@ class TranslationBase {
String get youHavePendingInterventions => localizedValues['youHavePendingInterventions']![locale.languageCode]!;
String get dateToCanNotBeEmpty => localizedValues['dateToCanNotBeEmpty']![locale.languageCode]!;
String get dateFromCanNotBeEmpty => localizedValues['dateFromCanNotBeEmpty']![locale.languageCode]!;
String get open => localizedValues['open']![locale.languageCode]!;
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save