app-starlock/lib/baseWidget.dart

47 lines
1.3 KiB
Dart
Raw Permalink Normal View History

2023-07-10 17:50:31 +08:00
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';
2023-07-10 17:50:31 +08:00
mixin BaseWidget {
2023-07-10 17:50:31 +08:00
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;
},
);
2023-07-10 17:50:31 +08:00
///数据为空的视图
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,
2023-07-10 17:50:31 +08:00
),
Padding(
padding: const EdgeInsets.only(top: 10),
2024-07-31 17:24:30 +08:00
child: Text('暂无数据'.tr,
style: TextStyle(
fontSize: 22.sp, color: AppColors.darkGrayTextColor)),
2023-07-10 17:50:31 +08:00
)
],
),
);
}
}