2022-09-20 01:49:31 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:fluttertoast/fluttertoast.dart' as t;
|
|
|
|
|
|
|
|
class Toast {
|
|
|
|
final t.FToast _fToast = t.FToast();
|
|
|
|
late BuildContext buildContext;
|
|
|
|
|
|
|
|
void initialize(BuildContext context) {
|
|
|
|
_fToast.init(context);
|
|
|
|
}
|
|
|
|
|
|
|
|
void show(String text) {
|
|
|
|
t.Fluttertoast.showToast(
|
2024-02-12 00:22:25 +01:00
|
|
|
msg: text,
|
2022-09-20 01:49:31 +02:00
|
|
|
toastLength: t.Toast.LENGTH_LONG,
|
|
|
|
gravity: t.ToastGravity.CENTER,
|
|
|
|
);
|
|
|
|
}
|
2022-10-14 22:22:10 +02:00
|
|
|
|
|
|
|
void showBottom(String text) {
|
|
|
|
t.Fluttertoast.showToast(
|
2024-02-12 00:22:25 +01:00
|
|
|
msg: text,
|
2022-10-14 22:22:10 +02:00
|
|
|
toastLength: t.Toast.LENGTH_LONG,
|
|
|
|
gravity: t.ToastGravity.BOTTOM,
|
|
|
|
);
|
|
|
|
}
|
2022-09-20 01:49:31 +02:00
|
|
|
}
|