first commit

This commit is contained in:
编码猿
2024-09-27 01:31:25 +08:00
commit 07c46ac300
558 changed files with 37414 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
/*
* 尺寸兼容,类似前端的rem
*/
class Screen {
static double setWidth (double width) {
return ScreenUtil().setWidth(width);
}
static double setHeight (double height) {
return ScreenUtil().setHeight(height);
}
static double setFontSize(double Size) {
return ScreenUtil().setSp(Size, allowFontScalingSelf: true);
}
static double width(BuildContext context) {
return MediaQuery.of(context).size.width;
}
static double height(BuildContext context) {
return MediaQuery.of(context).size.height;
}
}