123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import 'package:cs_resources/constants/color_constants.dart';
- import 'package:cs_resources/generated/assets.dart';
- import 'package:cs_resources/theme/app_colors_theme.dart';
- import 'package:flutter/material.dart';
- import 'package:widgets/ext/ex_widget.dart';
- import 'package:widgets/my_load_image.dart';
- import 'package:widgets/my_text_view.dart';
- /*
- * 设置页面的Item容器,左侧图标,中间文本,右侧箭头
- */
- class SettingItemContainer extends StatelessWidget {
- final String? iconPath;
- final String title;
- final bool isShowMoreIcon;
- final Widget? rightWidget;
- SettingItemContainer({this.iconPath, this.isShowMoreIcon = true, required this.title, this.rightWidget});
- @override
- Widget build(BuildContext context) {
- return Container(
- width: double.infinity,
- height: 60,
- margin: const EdgeInsets.symmetric(vertical: 5, horizontal: 15),
- padding: const EdgeInsets.symmetric(vertical: 0, horizontal: 19),
- decoration: BoxDecoration(
- color: context.appColors.whiteBG, // 设置背景颜色和不透明度
- borderRadius: BorderRadius.circular(10.0), // 设置圆角
- ),
- child: Row(
- mainAxisSize: MainAxisSize.max,
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- iconPath == null ? const SizedBox() : MyAssetImage(iconPath!, width: 30.2, height: 30.2).marginOnly(right: 11),
- MyTextView(
- title,
- isFontMedium: true,
- fontSize: 15,
- marginRight: 11,
- textColor: context.appColors.textBlack,
- ).expanded(),
- isShowMoreIcon
- ? rightWidget == null
- ? const MyAssetImage(Assets.baseLibItemMoreIcon, width: 7.5, height: 13.5, color: Color(0XFF28394A))
- : rightWidget!
- : const SizedBox(),
- ],
- ),
- );
- }
- }
|