Skip to content

viral-sangani/material_action_sheet

Repository files navigation

🚀A Matrial Action Sheet widget to get Awesome Bottom Sheet List Widget. 🔥

Project URL - https://github.com/viral-sangani/material_action_sheet

DEMO

Personal Blog

Getting Started

Add the package to your pubspec.yaml:

material_action_sheet: ^0.0.2

In your dart file, import the library:

import 'package:material_action_sheet/material_action_sheet.dart';

To Use the widget instead of showModalBottomSheet() use showMatrialActionSheet().

showMatrialActionSheet(
  context: context,
  itemsTextStyle: Theme.of(context).textTheme.headline6.copyWith(
        color: Colors.blue,
      ),
  title: "Are you sure you want to close this?",
  titleAlignment: TextAlign.center,
  items: `[
    MaterialActionItem(
      title: "Yes",
      onPressed: () {
        print("Printtt");
      },
    ),
  ],
  showCancelButton: true,
);

Parameter

showMatrialActionSheet:

  • context - Need a current BuildContext. @required
  • items - items parameter takes the list of MaterialActionItem List<MaterialActionItem>. @required
  • itemAlignment - items alignment takes TextAlign for items in list.
  • itemsTextStyle - TextStyle of each items the list.
  • title - String for the title of bottomsheet. @required
  • titleAlignment - text alignment for title of bottomsheet.
  • titleTextStyle - TextStyle of title.
  • maxHeight - Maximun height of the bottom sheet.
  • showCancelButton - Show Cancel button to close the bottomsheet.
  • onCancelPressed - Callback functin on cancel button clicked.
  • cancelAlignment - Cancel buttom alignment.
  • content - Any widget to be shown between Title and List items.

MaterialActionItem:

  • title - Title for item of list. @required
  • onPressed - Callback function for onClick on each item.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published