123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- // 自定义的模块项 Widget
- import 'package:domain/entity/home_module.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';
- class ModuleItem extends StatelessWidget {
- final HomeModule item;
- final VoidCallback onTap;
- ModuleItem(this.item, this.onTap);
- @override
- Widget build(BuildContext context) {
- return GestureDetector(
- onTap: onTap,
- child: Container(
- decoration: BoxDecoration(
- color: Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
- borderRadius: BorderRadius.circular(7.5), // 设置圆角
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- // 模块的名称
- MyTextView(
- item.moduleName,
- textColor: Colors.white,
- isTextEllipsis: true,
- maxLines: 2,
- isFontBold: true,
- margin: 20,
- fontSize: 17,
- ).constrained(minHeight: 80),
- Center(
- child: MyAssetImage(item.moduleIconPath, width: item.iconWidth, height: item.iconHeight),
- ),
- ],
- ),
- ),
- );
- }
- }
|