An easy to use flutter toast library with more features!
-
In the true sense of Toast, you can call it whenever you need it, without any restrictions!
-
Feature-rich, support for displaying notifications, text, loading with image and circularProgressIndicator, attachments, etc. Toast
-
Awesome customize widgets with Animations.
-
Create Pop-ups, dialog widgets
-
Support for popping up various custom Toasts, or you can pop up any Widget as long as it meets the requirements of the flutter code.
-
Pure flutter implementation
Online demo (Web effects may be biased, the actual effect is subject to the mobile phone)
dependencies:
flutter_rr_toast: ^0.0.1
#null safety
import 'package:flutter_rr_toast/flutter_rr_toast.dart';
MaterialApp(
title: 'RRToast Demo',
builder: RRToastInit(), //1. call RRToastInit
navigatorObservers: [RRToastNavigatorObserver()], //2. registered route observer
home: XyzPage(),
)
or
//Warning: Don't arbitrarily adjust the position of calling the RRToastInit function
final rrToastBuilder = RRToastInit(); //1. call RRToastInit
MaterialApp(
title: 'RRToast Demo',
builder: (context, child) {
child = myBuilder(context,child); //do something
child = rrToastBuilder(context,child);
return child;
},
navigatorObservers: [RRToastNavigatorObserver()], //2. registered route observer
home: XyzPage(),
)
var cancel = RRToast.showText(text:"xyzxm"); //popup a text rr toast;
...
cancel(); //close
var cancel = RRToast.showSimpleNotification(title: "init");
// popup a notification rr toast;
...
cancel(); //close
var cancel = RRToast.showLoading(image: Image.asset('assets/img/xxxx.png'));
//popup a loading rr toast with image as an optional.
...
cancel(); //close
var cancel = RRToast.showLoading();
//popup a loading rr toast with CircularProgressIndicator
...
cancel(); //close
//popup a attachments toast
var cancel = RRToast.showAttachedWidget(
attachedBuilder: (_) => Card(
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Icon(
Icons.bookmark,
color: Colors.blueAccent,
),
),
),
duration: Duration(seconds: 2.5),
target: Offset(320, 320));
...
cancel(); //close
//custom api
var cancelToast = RRToast.showCustomNotification(...)
var cancelToast = RRToast.showCustomText(...)
var cancelToast = RRToast.showCustomLoading(...)
var cancelToast = RRToast.showAnimationWidget(...)
...
cancel(); //close
//3.x.x version initialization method
MaterialApp(
title: 'RRToast Demo',
builder: RRToastInit(),
navigatorObservers: [RRToastNavigatorObserver()],
home: XxxxPage(),
)