app-starlock/lib/baseWidget.dart
魏少阳 15af50d951 1、完善星锁APP国际化 36种语言。
2、修复国际化问题
2024-10-15 18:32:11 +08:00

47 lines
1.3 KiB
Dart
Executable File

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart';
mixin BaseWidget {
double fs(double value) => value.sp;
double w(double width) => width.w;
double h(double height) => height.h;
initUI(Widget widget) => ScreenUtilInit(
// designSize: const Size(750, 1334),
designSize: const Size(375, 812),
minTextAdapt: true,
splitScreenMode: true,
builder: (context, child) {
return widget;
},
);
///数据为空的视图
Widget emptyView() {
return Container(
width: double.infinity,
height: double.infinity,
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Image.asset(
'images/icon_unHaveData.png',
height: 120.w,
width: 120.w,
),
Padding(
padding: const EdgeInsets.only(top: 10),
child: Text('暂无数据'.tr,
style: TextStyle(
fontSize: 22.sp, color: AppColors.darkGrayTextColor)),
)
],
),
);
}
}