BotToast ❤
1. pubspec.yaml
dependencies:
bot_toast: 1.0.1
2. BotToast
import 'package:bot_toast/bot_toast.dart';
3. BotToast
MaterialApp(
title: 'BotToast Demo',
navigatorObservers: [BotToastNavigatorObserver()],//1.注册路由观察者
home: BotToastInit( //2.初始化BotToast
child: XxxxPage()
),
);
4. BotToast
BotToast.showText(text:"xxxx");
BotToast.showSimpleNotification(title: "init");
//Toast
BotToast.showAttachedWidget(
attachedWidget: (_) => Card(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(
Icons.favorite,
color: Colors.redAccent,
),
),
),
duration: Duration(seconds: 2),
target: Offset(520, 520));
Source Credit url : https://github.com/MMMzq/bot_toast