presentScrollView<T> static method
void
presentScrollView<T>({
- String title = "Popup",
- bool isFullScreen = true,
- ScrollPhysics? physics,
- dynamic onChanged(
- T result
- required BuildContext context,
- required List<
Widget> slivers,
Implementation
static void presentScrollView<T>({
String title = "Popup",
bool isFullScreen = true,
ScrollPhysics? physics,
Function(T result)? onChanged,
required BuildContext context,
required List<Widget> slivers,
}) async {
final result = await showModalBottomSheet<T>(
context: context,
useSafeArea: true,
isScrollControlled: isFullScreen,
builder: (BuildContext context) {
return SafeArea(
child: LayoutBuilder(builder: (context, constraints) {
return Column(
children: [
AppBar(
title: Padding(
padding: const EdgeInsets.all(0),
child: Text(
title,
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
),
),
automaticallyImplyLeading: false,
actions: [
IconButton(
onPressed: () {
Navigator.of(context).pop();
},
icon: const Icon(Icons.close))
],
),
Expanded(
child: CustomScrollView(
physics: physics,
// slivers: <Widget>[
// SliverToBoxAdapter(
// child: builder,
// ),
// ],
slivers: slivers,
),
),
],
);
}),
);
});
if (result != null && onChanged != null) {
onChanged(result);
}
}