admin
2022-01-20 d8ef9a783b9e0b2a495f02fdf3daaf27ef49e99d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import 'package:flutter/cupertino.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:flutter/material.dart';
 
class ToastUtil {
  static toast(String text) {
    Fluttertoast.showToast(msg: text);
  }
}
 
class DialogUtil {
  static Future<dynamic> showDialog(BuildContext context, Dialog dialog) async {
    return await showGeneralDialog(
        context: context,
        pageBuilder: (BuildContext buildContext, Animation<double> animation,
            Animation<double> secondaryAnimation) {
          return dialog;
        });
  }
}
 
class DimenUtil {
  //获取像素比
  static double getPixelRatio(BuildContext context) {
    MediaQueryData mediaQuery = MediaQuery.of(context);
    return mediaQuery.devicePixelRatio;
  }
}