showTolyPopPicker<T> function

Future<T?> showTolyPopPicker<T>({
  1. required BuildContext context,
  2. required List<TolyPopItem> tasks,
  3. Widget? title,
  4. VoidCallback? onCancel,
  5. String cancelText = "取消",
  6. TolyPopPickerTheme? theme,
  7. bool isDismissible = true,
  8. bool enableDrag = true,
  9. bool isScrollControlled = false,
  10. bool useRootNavigator = false,
  11. Color? backgroundColor,
  12. double? elevation,
  13. Clip? clipBehavior,
  14. BoxConstraints? constraints,
  15. Color? barrierColor,
  16. String? barrierLabel,
  17. AnimationController? transitionAnimationController,
})

Implementation

Future<T?> showTolyPopPicker<T>({
  required BuildContext context,
  required List<TolyPopItem> tasks,
  Widget? title,
  VoidCallback? onCancel,
  String cancelText = "取消",
  TolyPopPickerTheme? theme,
  bool isDismissible = true,
  bool enableDrag = true,
  bool isScrollControlled = false,
  bool useRootNavigator = false,
  Color? backgroundColor,
  double? elevation,
  Clip? clipBehavior,
  BoxConstraints? constraints,
  Color? barrierColor,
  String? barrierLabel,
  AnimationController? transitionAnimationController,
}) {
  final effectiveTheme = theme ?? TolyPopPickerTheme.of(context);
  return showModalBottomSheet<T>(
    context: context,
    isDismissible: isDismissible,
    enableDrag: enableDrag,
    isScrollControlled: isScrollControlled,
    useRootNavigator: useRootNavigator,
    backgroundColor: backgroundColor,
    elevation: elevation,
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.vertical(
          top: Radius.circular(effectiveTheme.borderRadius)),
    ),
    clipBehavior: clipBehavior,
    constraints: constraints,
    barrierColor: barrierColor,
    barrierLabel: barrierLabel,
    transitionAnimationController: transitionAnimationController,
    builder: (context) => TolyPopPicker(
      tasks: tasks,
      title: title,
      onCancel: onCancel,
      cancelText: cancelText,
      theme: theme,
    ),
  );
}