1
0
Fork 0
mirror of https://gitlab.com/nkming2/nc-photos.git synced 2025-03-22 23:19:21 +01:00
nc-photos/app/lib/toast.dart

17 lines
489 B
Dart

import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
class AppToast {
static Future<bool?> showToast(
BuildContext context, {
required String msg,
required Duration duration,
}) {
return Fluttertoast.showToast(
msg: msg,
timeInSecForIosWeb: duration.inSeconds,
backgroundColor: Theme.of(context).snackBarTheme.backgroundColor,
textColor: Theme.of(context).snackBarTheme.contentTextStyle!.color,
);
}
}