app_util.dart 635 B

12345678910111213141516171819202122232425
  1. import 'package:flutter_screenutil/flutter_screenutil.dart';
  2. import 'package:fluttertoast/fluttertoast.dart';
  3. /// Description:
  4. /// Time : 2021年12月03日 Friday
  5. /// Author : liuyuqi.gov@msncn
  6. class AppUtil {
  7. static double height(double value) {
  8. return ScreenUtil().setHeight(value);
  9. }
  10. static double width(double value) {
  11. return ScreenUtil().setWidth(value);
  12. }
  13. static double sp(double value) {
  14. return ScreenUtil().setSp(value);
  15. }
  16. // 居中简单弹信息框
  17. static void buildToast(String str) {
  18. Fluttertoast.showToast(
  19. fontSize: 25, gravity: ToastGravity.CENTER, msg: str);
  20. }
  21. }