showAyahMenuDialog function
Future<void>
showAyahMenuDialog({
- required BuildContext context,
- required bool isDark,
- required AyahModel ayah,
- required Offset position,
- required int index,
- required int pageIndex,
- Widget? anotherMenuChild,
- void anotherMenuChildOnTap(
- AyahModel ayah
- Widget? secondMenuChild,
- void secondMenuChildOnTap(
- AyahModel ayah
- TafsirStyle? externalTafsirStyle,
Implementation
Future<void> showAyahMenuDialog({
required BuildContext context,
required bool isDark,
required AyahModel ayah,
required Offset position,
required int index,
required int pageIndex,
Widget? anotherMenuChild,
void Function(AyahModel ayah)? anotherMenuChildOnTap,
Widget? secondMenuChild,
void Function(AyahModel ayah)? secondMenuChildOnTap,
TafsirStyle? externalTafsirStyle,
}) async {
final ctrl = QuranCtrl.instance;
if (ctrl.state.isShowMenu.value) return;
ctrl.state.isShowMenu.value = true;
await showGeneralDialog<void>(
context: context,
barrierDismissible: true,
barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
barrierColor: Colors.transparent,
transitionDuration: Duration.zero,
pageBuilder: (dialogContext, _, __) {
return Material(
type: MaterialType.transparency,
child: Stack(
children: [
AyahMenuDialog(
context: context,
isDark: isDark,
ayah: ayah,
position: position,
index: index,
pageIndex: pageIndex,
anotherMenuChild: anotherMenuChild,
anotherMenuChildOnTap: anotherMenuChildOnTap,
secondMenuChild: secondMenuChild,
secondMenuChildOnTap: secondMenuChildOnTap,
externalTafsirStyle: externalTafsirStyle,
onDismiss: () {
ctrl.showControlToggle();
Navigator.of(dialogContext).pop();
},
),
],
),
);
},
).whenComplete(() {
ctrl.state.isShowMenu.value = false;
});
}