dragable static method
void
dragable({})
Implementation
static void dragable({
required Widget content,
double radius = 16,
bool isClose = false,
double initialChildSize = 0.7,
bool isScrollControlled = true,
double minChildSize = 0.5,
Function()? onClose,
}) {
// add haptic feedback (UX)
HapticFeedback.lightImpact();
Get.bottomSheet(
DraggableScrollableSheet(
initialChildSize: initialChildSize,
maxChildSize: 0.9,
minChildSize: minChildSize,
builder: (_, controller) => Container(
decoration: ExDecorator.top(
radius: radius,
),
child: SafeArea(
child: VStack(
[
const ExDashLine(),
if (isClose)
const Align(
alignment: Alignment.centerRight,
child: Icon(
Icons.close_rounded,
size: 25,
),
).onInkTap(
() => {Get.back(), if (onClose != null) onClose() else ''},
)
else
const SizedBox(),
ListView(
controller: controller,
children: [content],
).paddingSymmetric(vertical: 24).expand(),
],
).p24(),
),
),
),
elevation: 0,
isScrollControlled: isScrollControlled,
isDismissible: true,
);
}