showChannelInfoModalBottomSheet<T> function
- required BuildContext context,
- required Channel channel,
- Color? backgroundColor,
- double? elevation,
- BoxConstraints? constraints,
- Color? barrierColor,
- bool isScrollControlled = true,
- bool isDismissible = true,
- bool enableDrag = true,
- RouteSettings? routeSettings,
- AnimationController? transitionAnimationController,
- Clip? clipBehavior = Clip.hardEdge,
- ShapeBorder? shape = _kDefaultChannelInfoBottomSheetShape,
- void onMemberTap()?,
- VoidCallback? onViewInfoTap,
- VoidCallback? onLeaveChannelTap,
- VoidCallback? onDeleteConversationTap,
- VoidCallback? onCancelTap,
Shows a modal material design bottom sheet.
A modal bottom sheet is an alternative to a menu or a dialog and prevents the user from interacting with the rest of the app.
A closely related widget is a persistent bottom sheet, which shows information that supplements the primary content of the app without preventing the use from interacting with the app. Persistent bottom sheets can be created and displayed with the showBottomSheet function or the ScaffoldState.showBottomSheet method.
The context
argument is used to look up the Navigator and Theme for
the bottom sheet. It is only used when the method is called. Its
corresponding widget can be safely removed from the tree before the bottom
sheet is closed.
The isScrollControlled
parameter specifies whether this is a route for
a bottom sheet that will utilize DraggableScrollableSheet. If you wish
to have a bottom sheet that has a scrollable child such as a ListView or
a GridView and have the bottom sheet be draggable, you should set this
parameter to true.
The useRootNavigator
parameter ensures that the root navigator is used to
display the BottomSheet when set to true
. This is useful in the case
that a modal BottomSheet needs to be displayed above all other content
but the caller is inside another Navigator.
The isDismissible
parameter specifies whether the bottom sheet will be
dismissed when user taps on the scrim.
The enableDrag
parameter specifies whether the bottom sheet can be
dragged up and down and dismissed by swiping downwards.
The optional backgroundColor
, elevation
, shape
, clipBehavior
,
constraints
and transitionAnimationController
parameters can be passed in to customize the appearance and behavior of
modal bottom sheets (see the documentation for these on BottomSheet
for more details).
The transitionAnimationController
controls the bottom sheet's entrance and
exit animations if provided.
The optional routeSettings
parameter sets the RouteSettings
of the modal bottom sheet sheet.
This is particularly useful in the case that a user wants to observe
PopupRoutes within a NavigatorObserver.
Returns a Future
that resolves to the value (if any) that was passed to
Navigator.pop when the modal bottom sheet was closed.
See also:
- BottomSheet, which becomes the parent of the widget returned by the
function passed as the
builder
argument to showModalBottomSheet. - showBottomSheet and ScaffoldState.showBottomSheet, for showing non-modal bottom sheets.
- DraggableScrollableSheet, which allows you to create a bottom sheet that grows and then becomes scrollable once it reaches its maximum size.
- material.io/design/components/sheets-bottom.html#modal-bottom-sheet
Implementation
Future<T?> showChannelInfoModalBottomSheet<T>({
required BuildContext context,
required Channel channel,
Color? backgroundColor,
double? elevation,
BoxConstraints? constraints,
Color? barrierColor,
bool isScrollControlled = true,
bool useRootNavigator = false,
bool isDismissible = true,
bool enableDrag = true,
RouteSettings? routeSettings,
AnimationController? transitionAnimationController,
Clip? clipBehavior = Clip.hardEdge,
ShapeBorder? shape = _kDefaultChannelInfoBottomSheetShape,
void Function(Member)? onMemberTap,
VoidCallback? onViewInfoTap,
VoidCallback? onLeaveChannelTap,
VoidCallback? onDeleteConversationTap,
VoidCallback? onCancelTap,
}) =>
showModalBottomSheet<T>(
context: context,
backgroundColor: backgroundColor,
elevation: elevation,
shape: shape,
clipBehavior: clipBehavior,
constraints: constraints,
barrierColor: barrierColor,
isScrollControlled: isScrollControlled,
useRootNavigator: useRootNavigator,
isDismissible: isDismissible,
enableDrag: enableDrag,
routeSettings: routeSettings,
transitionAnimationController: transitionAnimationController,
builder: (BuildContext context) => StreamChannelInfoBottomSheet(
channel: channel,
onMemberTap: onMemberTap,
onViewInfoTap: onViewInfoTap,
onLeaveChannelTap: onLeaveChannelTap,
onDeleteConversationTap: onDeleteConversationTap,
onCancelTap: onCancelTap,
),
);