showConferenceBottomSheet function

Future<void> showConferenceBottomSheet(
  1. Widget bottomSheet, {
  2. double? landScapeWidth,
  3. bool alwaysFromBottom = false,
})

Implementation

Future<void> showConferenceBottomSheet(Widget bottomSheet,
    {double? landScapeWidth, bool alwaysFromBottom = false}) {
  return showGeneralDialog(
    context: Get.overlayContext!,
    barrierDismissible: true,
    barrierLabel: 'Dismiss bottom sheet',
    transitionDuration: const Duration(milliseconds: 250),
    pageBuilder: (BuildContext context, Animation<double> animation,
        Animation<double> secondaryAnimation) {
      return BackdropFilter(
          filter: ImageFilter.blur(sigmaX: 5.0, sigmaY: 5.0),
          child: OrientationBuilder(
            builder: (BuildContext context, Orientation orientation) {
              return SlideTransition(
                position: Tween<Offset>(
                  begin:
                      (orientation == Orientation.portrait || alwaysFromBottom)
                          ? const Offset(0, 1)
                          : const Offset(1, 0),
                  end: Offset.zero,
                ).animate(animation),
                child: Align(
                  alignment:
                      (orientation == Orientation.portrait || alwaysFromBottom)
                          ? Alignment.bottomCenter
                          : Alignment.centerRight,
                  child: Material(
                    color: Colors.transparent,
                    child: SizedBox(
                      width: (orientation == Orientation.portrait ||
                              alwaysFromBottom)
                          ? Get.width
                          : landScapeWidth ?? 387.0.scale375(),
                      height: (orientation == Orientation.portrait ||
                              alwaysFromBottom)
                          ? null
                          : Get.height,
                      child: bottomSheet,
                    ),
                  ),
                ),
              );
            },
          ));
    },
  );
}