adaptive_action_sheet 1.0.5

Flutter Android iOS

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).

iOSAndroid
n1n2

Getting Started #

Add the package to your pubspec.yaml:

 adaptive_action_sheet: ^1.0.5

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).
  • The optional backgroundColor and barrierColor can be passed in to customize the appearance and behavior of persistent bottom sheets.

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.
5
likes
80
pub points
77%
popularity

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

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

dioann28@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on adaptive_action_sheet