app_util.dart 541 B

12345678910111213141516171819202122
  1. import 'package:flutter_screenutil/flutter_screenutil.dart';
  2. import 'package:fluttertoast/fluttertoast.dart';
  3. class AppUtil {
  4. static double height(double value) {
  5. return ScreenUtil().setHeight(value);
  6. }
  7. static double width(double value) {
  8. return ScreenUtil().setWidth(value);
  9. }
  10. static double sp(double value) {
  11. return ScreenUtil().setSp(value);
  12. }
  13. // 居中简单弹信息框
  14. static void buildToast(String str) {
  15. Fluttertoast.showToast(
  16. fontSize: 25, gravity: ToastGravity.CENTER, msg: str);
  17. }
  18. }