device.dart 545 B

123456789101112131415161718192021222324252627
  1. import 'dart:io';
  2. import 'package:flutter_screenutil/flutter_screenutil.dart';
  3. class Device {
  4. static getRatio(int value) {
  5. int uiwidth = value is int ? value : 750;
  6. return ScreenUtil().screenWidth / uiwidth;
  7. }
  8. static getRpx(double value) {
  9. return value * getRatio(750);
  10. }
  11. static getBottomPadding() {
  12. return ScreenUtil().screenHeight;
  13. }
  14. static getTopPadding() {
  15. return ScreenUtil().screenHeight;
  16. }
  17. static getWidth() {
  18. return ScreenUtil().screenWidth;
  19. }
  20. static Platform platform = Platform();
  21. }