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.
uco-mobile-poc/lib/app/custom_widgets/custom_toasty.dart

17 lines
473 B
Dart

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);
}
}