Flutter ToastView Plugin
Usage
1. Add library to your pubspec.yaml
dependencies:
toast_view: ^latest_version
2. Import library in dart file
import "package:toast_view/toast_view.dart";
3. Wrap your app widget
ToastView(
/// set toast style, optional
child:MaterialApp()
);
Tips:
If you happened error like: No MediaQuery widget found
,
you can try to use this code
to include ToastView
to your App.
MaterialApp(
builder: (BuildContext context, Widget? widget) {
return ToastView(child: widget);
},
);
4. Call method showToast
showToast('content');
// position and second have default value, is optional
showToastWidget(Text('hello ToastView'));