Skip to content

A Flutter package to simplify alert messages on Android (Material) and iOS (Cupertino).

License

Notifications You must be signed in to change notification settings

christoph-jerolimov/flutter_alert

Repository files navigation

flutter_alert

Build Status

Flutter package which shows a crossplatform alert messages on Android (Material) and iOS (Cupertino).

Getting Started

Add this to your package's pubspec.yaml file:

dependencies:
  flutter_alert: ^0.4.0

You can install packages from the command line:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

Example

In your Dart code, add this import:

import 'package:flutter_alert/flutter_alert.dart';

And later show an alert when neccessary:

  void _showMessageDialog() {
    showAlert(
      context: context,
      title: "Awesome feature enabled.",
    );
  }

  void _showQuestionDialog() {
    showAlert(
      context: context,
      title: "Delete file?",
      body: "Should we delete the file XYZ?",
      actions: [
        AlertAction(
          text: "Delete",
          isDestructiveAction: true,
          onPressed: () {
            // TODO
          },
        ),
      ],
      cancelable: true,
    );
  }

Contributors

This project follows the all-contributors specification.

Contributions of any kind welcome!

Thanks goes to these people:


Christoph Jerolimov
💻 📖 ⚠️

Christian Stahl

💻 🤔

Pascal Welsch

🤔

About

A Flutter package to simplify alert messages on Android (Material) and iOS (Cupertino).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published