dart_toast 0.2.0

  • README.md
  • Installing
  • Versions
  • 73


Support for simple toast messages in Dart web apps.


First, be sure to include the CSS in your index.html file:

<link rel="stylesheet" href="packages/dart_toast/dart_toast.css">

A simple usage example:

import 'dart:html';

import 'package:dart_toast/dart_toast.dart';

void main() {
  document.getElementById('toast-btn').onClick.listen((_) {
    new Toast("Toast!", "A toasty toast.");

  document.getElementById('success-btn').onClick.listen((_) {
    new Toast.success(title: "Success!", message: "Misson accomplished.");

  document.getElementById('error-btn').onClick.listen((_) {
    new Toast.error(title: "Error!", message: "Misson failed.");

  document.getElementById('warning-btn').onClick.listen((_) {
    new Toast.warning(title: "Warning!", message: "Misson in jeopardy.");

  document.getElementById('info-btn').onClick.listen((_) {
    new Toast.info(title: "Info!", message: "Misson briefing complete.");

  document.getElementById('top-left-btn').onClick.listen((_) {
    new Toast("Top Left",  "Look at me!", position: ToastPos.topLeft);

  document.getElementById('top-right-btn').onClick.listen((_) {
    new Toast("Top Right",  "Look at me!", position: ToastPos.topRight);

  document.getElementById('bottom-left-btn').onClick.listen((_) {
    new Toast("Bottom Left",  "Look at me!", position: ToastPos.bottomLeft);

  document.getElementById('bottom-right-btn').onClick.listen((_) {
    new Toast("Bottom Right",  "Look at me!", position: ToastPos.bottomRight);

  document.getElementById('top-center-btn').onClick.listen((_) {
    new Toast("Top Center",  "Look at me!", position: ToastPos.topCenter);

  document.getElementById('bottom-center-btn').onClick.listen((_) {
    new Toast("Bottom Center",  "Look at me!", position: ToastPos.bottomCenter);

Features and bugs

Please file feature requests and bugs at the issue tracker.



  • Updating for Dart 2.0.0-dev.65.


  • Toasts will no longer be removed while mouse cursor hovers over them.


  • Initial release.

Use this package as a library

1. Depend on it

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

  dart_toast: "^0.2.0"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

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

3. Import it

Now in your Dart code, you can use:

      import 'package:dart_toast/dart_toast.dart';
Version Uploaded Documentation Archive
0.2.0 Jun 26, 2018 Go to the documentation of dart_toast 0.2.0 Download dart_toast 0.2.0 archive
0.1.1 Nov 30, 2017 Go to the documentation of dart_toast 0.1.1 Download dart_toast 0.1.1 archive
0.1.0 Nov 20, 2017 Go to the documentation of dart_toast 0.1.0 Download dart_toast 0.1.0 archive


We analyzed this package on Jul 13, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
57 / 100
Code health derived from static analysis. [more]
99 / 100
Reflects how tidy and up-to-date the package is. [more]
72 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: unsure

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.


  • Fix dependencies in pubspec.yaml.

    Running pub upgrade failed with the following output:

    ERR: The current Dart SDK version is 2.0.0-dev.63.0.
     Because dart_toast requires SDK version >=2.0.0-dev.65 <2.0.0, version solving failed.
  • Fix platform conflicts.

    Error(s) prevent platform classification:

    Fix dependencies in pubspec.yaml.

  • Running dartdoc failed.

    Make sure dartdoc runs without any issues.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use dart_toast.dart.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 hint.

    Run dartfmt to format lib/src/dart_toast_base.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.65 <2.0.0