toast 0.1.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 93

Toast #

A Flutter Toast plugin.

How to Use #

# add this line to your dependencies
toast: ^0.1.3
import 'package:toast/toast.dart';
Toast.show("Toast plugin app", duration: Toast.LENGTH_SHORT, gravity:  Toast.BOTTOM);
propertydescription
msgString (Not Null)(required)
contextBuildContext (Not Null)(required)
durationToast.LENGTH_SHORT or Toast.LENGTH_LONG (optional)
gravityToast.TOP (or) Toast.CENTER (or) Toast.BOTTOM
textColorColor (default white)
backgroundColorColor (default Color(0xAA000000))
backgroundRadiusdouble (default 16)

toast toast

License #

MIT License

0.0.1 #

  • TODO: Describe initial release.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:toast/toast.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Toast plugin example app'),
        ),
        body: Center(
          child: Column(
            children: <Widget>[
              Padding(
                padding: const EdgeInsets.all(10.0),
                child: RaisedButton(
                    child: Text('Show Short Toast'),
                    onPressed: () => showToast("Show Short Toast")),
              ),
              Padding(
                padding: const EdgeInsets.all(10.0),
                child: RaisedButton(
                    child: Text('Show Long Toast'),
                    onPressed: () => showToast("Show Long Toast", duration: Toast.LENGTH_LONG)),
              ),
              Padding(
                padding: const EdgeInsets.all(10.0),
                child: RaisedButton(
                    child: Text('Show Bottom Toast'),
                    onPressed: () => showToast("Show Bottom Toast", gravity: Toast.BOTTOM)),
              ),
              Padding(
                padding: const EdgeInsets.all(10.0),
                child: RaisedButton(
                    child: Text('Show Center Toast'),
                    onPressed: () => showToast("Show Center Toast", gravity: Toast.CENTER)),
              ),
              Padding(
                padding: const EdgeInsets.all(10.0),
                child: RaisedButton(
                    child: Text('Show Top Toast'),
                    onPressed: () => showToast("Show Top Toast", gravity: Toast.TOP)),
              ),
            ],
          ),
        ),
      ),
    );
  }

  void showToast(String msg, {int duration, int gravity}) {
    Toast.show(msg, context, duration: duration, gravity: gravity);
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  toast: ^0.1.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:toast/toast.dart';
  
Version Uploaded Documentation Archive
0.1.4 Apr 1, 2019 Go to the documentation of toast 0.1.4 Download toast 0.1.4 archive
0.1.3 Jan 14, 2019 Go to the documentation of toast 0.1.3 Download toast 0.1.3 archive
0.1.2 Jan 14, 2019 Go to the documentation of toast 0.1.2 Download toast 0.1.2 archive
0.1.1 Jan 14, 2019 Go to the documentation of toast 0.1.1 Download toast 0.1.1 archive
0.1.0 Jan 11, 2019 Go to the documentation of toast 0.1.0 Download toast 0.1.0 archive
0.0.9 Jan 8, 2019 Go to the documentation of toast 0.0.9 Download toast 0.0.9 archive
0.0.8 Jan 7, 2019 Go to the documentation of toast 0.0.8 Download toast 0.0.8 archive
0.0.7 Jan 7, 2019 Go to the documentation of toast 0.0.7 Download toast 0.0.7 archive
0.0.6 Dec 25, 2018 Go to the documentation of toast 0.0.6 Download toast 0.0.6 archive
0.0.5 Dec 25, 2018 Go to the documentation of toast 0.0.5 Download toast 0.0.5 archive

All 14 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
97
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
93
Learn more about scoring.

We analyzed this package on May 22, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.1
  • pana: 0.12.16
  • Flutter: 1.5.4-hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/toast.dart. (-2.96 points)

Analysis of lib/toast.dart reported 6 hints, including:

line 5 col 20: Name non-constant identifiers using lowerCamelCase.

line 6 col 20: Name non-constant identifiers using lowerCamelCase.

line 7 col 20: Name non-constant identifiers using lowerCamelCase.

line 8 col 20: Name non-constant identifiers using lowerCamelCase.

line 9 col 20: Name non-constant identifiers using lowerCamelCase.

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8