app-starlock/star_lock/lib/tools/commonItem.dart
Daisy 3ff5e63d53 1,更新部分UI
2,新增部分图片
3,新增选择网关页面
2023-07-26 09:23:25 +08:00

87 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: 28.sp, fontWeight: FontWeight.w500))),
SizedBox(width: 20.w),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
isHaveRightWidget!
? rightWidget!
: Text(
rightTitle!,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 28.sp, fontWeight: FontWeight.w500),
)
],
),
SizedBox(width: 5.w),
isHaveDirection!
? Image.asset(
'images/icon_right.png',
width: 50.w,
height: 50.w,
)
: SizedBox(width: 10.w),
// SizedBox(width:10.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()
],
),
);
}
}