dual check v0.1
This commit is contained in:
1 parent
78bad1fa3d
commit
c137299016
36 files changed
+3727
-81
No files matched your search
@@ -2,60 +2,70 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../../const/font.dart';
|
||||
|
||||
class ToolCard extends StatefulWidget {
|
||||
const ToolCard({super.key});
|
||||
/// 工具元信息 —— 数据驱动首页卡片渲染
|
||||
class ToolMeta {
|
||||
final String name;
|
||||
final String description;
|
||||
final IconData icon;
|
||||
final Color iconColor;
|
||||
final Color bgColor;
|
||||
|
||||
@override
|
||||
State<ToolCard> createState() => _ToolCardState();
|
||||
const ToolMeta({
|
||||
required this.name,
|
||||
required this.description,
|
||||
required this.icon,
|
||||
this.iconColor = Colors.blue,
|
||||
this.bgColor = const Color(0xFFF5F5F5),
|
||||
});
|
||||
}
|
||||
|
||||
class _ToolCardState extends State<ToolCard> {
|
||||
class ToolCard extends StatelessWidget {
|
||||
const ToolCard({super.key, required this.meta});
|
||||
|
||||
final ToolMeta meta;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 8),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(),
|
||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Image.asset(
|
||||
"assets/qr_code_logo.png",
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
fit: BoxFit.cover,
|
||||
// 图标占位区
|
||||
Container(
|
||||
width: 80,
|
||||
height: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
color: meta.bgColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(meta.icon, color: meta.iconColor, size: 36),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: ClipRect(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"二维码生成器",
|
||||
style: TextStyle(
|
||||
fontSize: Font.FONT_SIZE_SUBTITLE,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
meta.name,
|
||||
style: TextStyle(
|
||||
fontSize: Font.FONT_SIZE_SUBTITLE,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Divider(),
|
||||
SizedBox(height: 8),
|
||||
Container(
|
||||
child: Text(
|
||||
"上传文字,图片即可立即生成二维码",
|
||||
maxLines: 2,
|
||||
style: TextStyle(
|
||||
fontSize: Font.FONT_SIZE_CONTENT,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 6),
|
||||
Divider(height: 1),
|
||||
SizedBox(height: 6),
|
||||
Text(
|
||||
meta.description,
|
||||
maxLines: 2,
|
||||
style: TextStyle(
|
||||
fontSize: Font.FONT_SIZE_CONTENT,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
color: Colors.grey.shade600,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user