adaptive_action_sheet 1.0.3 copy "adaptive_action_sheet: ^1.0.3" to clipboard
adaptive_action_sheet: ^1.0.3 copied to clipboard

outdated

A Flutter package for action bottom sheet that adapts to the platform (Android/iOS).

Adaptive action sheet #

pub package

A action bottom sheet that adapts to the platform (Android/iOS).

iOS Android
n1 n2

Getting Started #

Add the package to your pubspec.yaml:

adaptive_action_sheet: ^1.0.3

In your dart file, import the library:

import 'package:adaptive_action_sheet/adaptive_action_sheet.dart';

Instead of using a showModalBottomSheet use showAdaptiveActionSheet Widget:

showAdaptiveActionSheet(
 context: context,
 actions: <BottomSheetAction>[
    BottomSheetAction(title: 'Item 1', onPressed: () {}),
    BottomSheetAction(title: 'Item 2', onPressed: () {}),
    BottomSheetAction(title: 'Item 3', onPressed: () {}),
 ],
 cancelAction: CancelAction(title: 'Cancel'),// onPressed parameter is optional by default will dismiss the ActionSheet
);

Parameters: #

showAdaptiveActionSheet:

  • actions: The Actions list that will appear on the ActionSheet. (required)
  • cancelAction: The optional cancel button that show under the actions (grouped separately on iOS).

BottomSheetAction:

  • title: The string that will appear in the title bar of the action item. (required)
  • onPressed: The callback that is called when the action item is tapped. (required)

CancelAction:

  • title: The string that will appear in the title bar of the cancel action. (required)
  • onPressed: The callback that is called when the action item is tapped. onPressed is optional by default will dismiss the Action Sheet.
102
likes
0
pub points
97%
popularity

Publisher

unverified uploader

A Flutter package for action bottom sheet that adapts to the platform (Android/iOS).

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on adaptive_action_sheet