showAyahMenuDialog function
Future<void>
showAyahMenuDialog({
- required BuildContext context,
- required bool isDark,
- required AyahModel ayah,
- required Offset position,
- required int index,
- required int pageIndex,
- TafsirStyle? externalTafsirStyle,
Implementation
Future<void> showAyahMenuDialog({
required BuildContext context,
required bool isDark,
required AyahModel ayah,
required Offset position,
required int index,
required int pageIndex,
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,
externalTafsirStyle: externalTafsirStyle,
onDismiss: () {
ctrl.showControlToggle();
Navigator.of(dialogContext).pop();
},
),
],
),
);
},
).whenComplete(() {
ctrl.state.isShowMenu.value = false;
});
}