handy_toast 0.0.3
handy_toast: ^0.0.3 copied to clipboard

Flutter Android iOS web

A toast for flutter and very easy to use! This package depends on context_holder, another very useful package.

Handy toast for flutter Pub version #

A toast for flutter and easy to use! Depends on context_holder

1. Add dependency #

dependencies:
  handy_toast: ^0.0.3

2. Init context holder. #

Import context holder.

import 'package:context_holder/context_holder.dart';

Set your root app's navigatorKey with ContextHolder.key

For MaterialApp

void main() {
  runApp(
    MaterialApp(
      /// must set the navigatorKey!!!!!!
      navigatorKey: ContextHolder.key,
      home: Scaffold(),
    ),
  );
}

For CupertinoApp

void main() {
  runApp(
    CupertinoApp(
      /// must set the navigatorKey!!!!!!
      navigatorKey: ContextHolder.key,
      home: Scaffold(),
    ),
  );
}

3. Import easy toast #

import 'package:handy_toast/handy_toast.dart';

4. Use easy toast #

'handy toast'.toast();

4. Other option #

Change default style.

/// change toast background color to green with opacity.
Toast.defaultStyle = ToastStyle(
  color: Colors.green.withOpacity(0.8),
);
1
likes
100
pub points
0%
popularity

A toast for flutter and very easy to use! This package depends on context_holder, another very useful package.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

pmgd19881226@gmail.com

License

MIT (LICENSE)

Dependencies

context_holder, flutter

More

Packages that depend on handy_toast