You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
473 B
Dart
17 lines
473 B
Dart
|
1 month ago
|
import 'package:flutter/material.dart';
|
||
|
|
import 'package:fluttertoast/fluttertoast.dart';
|
||
|
|
|
||
|
|
class Toasty {
|
||
|
|
static error(String msg) {
|
||
|
|
_showToast(msg, Colors.red);
|
||
|
|
}
|
||
|
|
|
||
|
|
static success(String msg) {
|
||
|
|
_showToast(msg, Colors.green);
|
||
|
|
}
|
||
|
|
|
||
|
|
static _showToast(String msg, Color bgColor) {
|
||
|
|
Fluttertoast.showToast(msg: msg, toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.BOTTOM, timeInSecForIosWeb: 1, backgroundColor: bgColor, textColor: Colors.white);
|
||
|
|
}
|
||
|
|
}
|