BottomSheetRF constructor
BottomSheetRF({})
Implementation
BottomSheetRF({
required this.title,
this.subTitle,
this.context,
this.body,
this.onAccept,
this.onCancel,
this.height = 300,
this.hideDefaultControls,
this.avatarIcon = Icons.search,
this.avatarImage,
this.avatarSize = 32,
this.hideAvatar = false,
}) {
showModalBottomSheet<void>(
isScrollControlled: true,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0),
),
backgroundColor: Colors.transparent,
context: context!,
builder: (BuildContext context) {
return Padding(
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom),
child: Container(
height: height,
//color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Container(
color: Colors.transparent,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
hideAvatar
? Container()
: CircleAvatar(
radius: 24,
backgroundColor: avatarImage == null
? Colors.blue
: Colors.white,
child: avatarImage == null
? Icon(avatarIcon,
size: avatarSize, color: Colors.white)
: Image.asset(avatarImage!,
height: avatarSize,
width: avatarSize),
),
SizedBox(
width: 10,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
TextRF(
title,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold),
),
TextRF(
subTitle ?? "",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Colors.black54),
),
],
),
),
Container(
color: Colors.transparent,
child: IconButton(
padding: EdgeInsets.zero,
icon: Icon(Icons.clear,
size: 34, color: Colors.black45),
color: Colors.black,
onPressed: () {
Navigator.of(context).pop("");
},
),
)
],
),
SizedBox(height: 15),
Expanded(child: body!),
if (!hideDefaultControls!) Divider(color: Colors.black54),
if (!hideDefaultControls!)
dialogActions(onAccept, onCancel),
],
),
),
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(12),
topRight: Radius.circular(12))),
),
);
});
}