Action Bottom Sheet with Flutter

Action Bottom Sheet with Flutter

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

Adaptive action sheet

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

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,
 title: const Text('Title'),
 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).
  • title: The optional title widget that show above the actions.
  • 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)
  • textStyle: The TextStyle to use for the title text. (optional)
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.
  • textStyle: The TextStyle to use for the title text. (optional)

Download Details:

Author: Daniel-Ioannou

Source Code: https://github.com/Daniel-Ioannou/flutter_adaptive_action_sheet

flutter dart mobile-apps

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Google's Flutter 1.20 stable announced with new features - Navoki

Google has announced new flutter 1.20 stable with many improvements, and features, enabling flutter for Desktop and Web

Top 25 Flutter Mobile App Templates in 2020

Flutter has been booming worldwide from the past few years. While there are many popular mobile app development technologies out there, Flutter has managed to leave its mark in the mobile application development world. In this article, we’ve curated the best Flutter app templates available on the market as of July 2020.

Flutter App Development Trends 2020

As the new decade dawns upon us, a slew of technologies has been making a lot of noise to grab the developers’ attention. While native app development is going strong, the trade winds are now blowing towards going cross-platform.

How To Succeed In Mobile App Wireframe Design?

This article covers everything about mobile app wireframe design: what to do and what not, tools used in designing a mobile or web app wireframe, and more.

What is Flutter and why you should learn it?

Flutter is an open-source UI toolkit for mobile developers, so they can use it to build native-looking Android and iOS applications from the same code base for both platforms. Flutter is also working to make Flutter apps for Web, PWA (progressive Web-App) and Desktop platform (Windows,macOS,Linux).