DialogRF constructor
DialogRF(
- BuildContext context, {
- String title = "Missing Title",
- String subTitle = "Missing Sub Title",
- Widget? body,
- DialogType type = DialogType.full,
- bool hideDefaultControls = false,
- Function? onAccept,
- Function? onCancel,
- double height = 300,
- IconData avatarIcon = FontAwesomeIcons.magnifyingGlass,
- String? avatarImage,
- double? avatarIconSize,
- double blurAmount = 3,
- Color? avatarBackground,
- bool hideAvatar = false,
- dynamic fullWindowDialogScrollEffect = ScrollPhysicsRF.glow,
Implementation
DialogRF(
this.context, {
this.title = "Missing Title",
this.subTitle = "Missing Sub Title",
this.body,
this.type = DialogType.full,
this.hideDefaultControls = false,
this.onAccept,
this.onCancel,
this.height = 300,
this.avatarIcon = FontAwesomeIcons.magnifyingGlass,
this.avatarImage,
this.avatarIconSize,
this.blurAmount = 3,
this.avatarBackground,
this.hideAvatar = false,
this.fullWindowDialogScrollEffect = ScrollPhysicsRF.glow,
}) {
if (type == DialogType.full) {
var content = body ?? Text('Missing Content');
var fullDlg = Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => FullWindowDialog(
title: title,
body: (fullWindowDialogScrollEffect == ScrollPhysicsRF.glow)
? ScrollConfiguration(
behavior: BounceScrollBehavior(),
child: content,
)
: content,
hidePageHeader: hideDefaultControls,
onAccept: onAccept,
onCancel: onCancel,
),
fullscreenDialog: false,
),
);
fullDlg.whenComplete(() {});
} else if (type == DialogType.popup) {
showDialog<String>(
context: context, barrierDismissible: false, // user must tap button!
builder: (BuildContext context) {
return PopupWindowDialogRF(
title: title,
subTitle: subTitle,
avatarIcon: avatarIcon,
avatarImage: avatarImage,
avatarSize: avatarIconSize,
height: height,
avatarBackground: avatarBackground,
blurAmount: blurAmount,
body: body ?? Text('Missing Content'),
onAccept: onAccept,
onCancel: onCancel,
);
},
);
} else if (type == DialogType.bottom) {
BottomSheetRF(
title: title,
subTitle: subTitle,
context: context,
body: body!,
onAccept: onAccept,
onCancel: onCancel,
height: height,
hideDefaultControls: hideDefaultControls,
avatarIcon: avatarIcon,
avatarImage: avatarImage,
avatarSize: avatarIconSize,
hideAvatar: hideAvatar,
);
}
}