setting_item_container.dart 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import 'package:cs_resources/constants/color_constants.dart';
  2. import 'package:cs_resources/generated/assets.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:widgets/ext/ex_widget.dart';
  5. import 'package:widgets/my_load_image.dart';
  6. import 'package:widgets/my_text_view.dart';
  7. /**
  8. * 设置页面的Item容器,左侧图标,中间文本,右侧箭头
  9. */
  10. class SettingItemContainer extends StatelessWidget {
  11. final String iconPath;
  12. final String title;
  13. SettingItemContainer({required this.iconPath, required this.title});
  14. @override
  15. Widget build(BuildContext context) {
  16. return Container(
  17. width: double.infinity,
  18. height: 60,
  19. margin: EdgeInsets.symmetric(vertical: 5, horizontal: 15),
  20. padding: EdgeInsets.symmetric(vertical: 0, horizontal: 16.5),
  21. decoration: BoxDecoration(
  22. color: Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
  23. borderRadius: BorderRadius.circular(5.0), // 设置圆角
  24. ),
  25. child: Row(
  26. mainAxisSize: MainAxisSize.max,
  27. mainAxisAlignment: MainAxisAlignment.start,
  28. crossAxisAlignment: CrossAxisAlignment.center,
  29. children: [
  30. MyAssetImage(iconPath, width: 30.2, height: 30.2),
  31. MyTextView(
  32. title,
  33. isFontRegular: true,
  34. fontSize: 14,
  35. marginLeft: 11,
  36. marginRight: 11,
  37. textColor: ColorConstants.textGrayAECAE5,
  38. ).expanded(),
  39. MyAssetImage(Assets.mainItemMoreIcon, width: 7.5, height: 13.5),
  40. ],
  41. ),
  42. );
  43. }
  44. }