This commit is contained in:
problematicconsumer
2023-07-06 17:18:41 +03:30
commit b617c95f62
352 changed files with 21017 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import 'package:flutter/material.dart';
class BottomSheetPage extends Page {
const BottomSheetPage({
required this.builder,
this.fixed = false,
});
final Widget Function(ScrollController? controller) builder;
final bool fixed;
@override
Route<void> createRoute(BuildContext context) {
return ModalBottomSheetRoute(
settings: this,
isScrollControlled: !fixed,
useSafeArea: true,
showDragHandle: true,
builder: (_) {
if (!fixed) {
return DraggableScrollableSheet(
expand: false,
builder: (_, scrollController) => builder(scrollController),
);
}
return builder(null);
},
);
}
}