A really easy to use flutter toast library

admin

A really easy to use flutter toast library

BotToast ❤

Loading Text
Loading Text

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");
BotToast.showLoading();
//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

Leave a Comment