I want to add text above the dialog box as shown in the image below (on barrier)
This is the code for the dialog box that I want to modify to be as in the picture Please help me to solve my problems.
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: ElevatedButton(
child: const Text("Show Dialog"),
onPressed: () {
showDialog(
context: context,
barrierColor: Colors.black.withOpacity(0.8),
builder: (BuildContext context) => StatefulBuilder(builder: (context, setState) => LayoutBuilder(
builder: (context, constraints) {
return Dialog(
insetPadding: EdgeInsets.symmetric(horizontal: 15.w, vertical: 10.h),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
child: DecoratedBox(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
gradient: LinearGradient(
colors: [
const Color(0xFFE64978),
const Color(0xFFed8c41).withOpacity(0.5),
Colors.white.withOpacity(0.1),
Colors.white,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: Padding(
padding: EdgeInsetsDirectional.only(top: 25.h,bottom: 10.h),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const DialogTitleWidget(),
SizedBox(height: 10.h),
DialogPageViewWidget(controller: controller, dialogModelList: dialogModelList,constraints: constraints),
SizedBox(height: 10.h),
DialogPageIndicatorWidget(controller: controller, dialogModelList: dialogModelList),
SizedBox(height: 20.h),
const DialogContent(),
],
),
),
),
),
);
},
),
),
);
},
),
),
);
}
I have another problem that appears to me when I minimize the screen or rotate the phone screen (the problem appears when the dimensions change)


