app-starlock/star_lock/lib/tools/commonItem.dart
Daisy 76ceab6f34 1,星锁主界面UI更新
2,锁列表UI更新
3,侧边栏 个人信息模块UI更新
4,添加锁模块UI更新
5,我的-设置模块UI更新
6,新增“添加授权管理员”页面UI布局
2023-07-27 15:26:30 +08:00

86 lines
2.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:star_lock/app_settings/app_colors.dart';
class CommonItem extends StatelessWidget {
String? leftTitel;
String? rightTitle;
bool? isHaveDirection;
bool? isHaveLine;
bool? isHaveRightWidget;
Widget? rightWidget;
Function()? action;
double? allHeight;
CommonItem(
{Key? key,
required this.leftTitel,
this.rightTitle,
this.allHeight = 45,
this.isHaveDirection = false,
this.isHaveLine = false,
this.isHaveRightWidget = false,
this.rightWidget,
this.action})
: super(key: key);
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: action,
child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: allHeight ?? 60.h,
color: Colors.white,
padding: EdgeInsets.only(
left: 20.w, right: 10.w), // , top: 20.w, bottom: 20.w
child: Row(
children: [
SizedBox(width: 20.w),
Expanded(
child: Text(leftTitel!, style: TextStyle(fontSize: 22.sp))),
SizedBox(width: 20.w),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
isHaveRightWidget!
? rightWidget!
: Text(
rightTitle!,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 22.sp,
color: AppColors.darkGrayTextColor),
)
],
),
SizedBox(width: 8.w),
isHaveDirection!
? Image.asset(
'images/icon_right_grey.png',
width: 12.w,
height: 21.w,
)
: SizedBox(width: 20.w),
SizedBox(width: 20.w),
],
),
),
// isHaveLine!?Container(height: 0.5.h, color: Colors.grey,):Container()
//by DaisyWu
isHaveLine!
? Divider(
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
height: 1,
)
: Container()
],
),
);
}
}