1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
| import 'package:flutter/cupertino.dart';
| import 'package:flutter/material.dart';
|
| class TagCard extends StatefulWidget {
| final String name;
| final String parentName;
| final int tagId;
| final VoidCallback? onTagTap;
|
| const TagCard({super.key, required this.name, required this.parentName, required this.tagId, this.onTagTap});
|
| @override
| State<TagCard> createState() => _TagCardState();
| }
|
| class _TagCardState extends State<TagCard> {
| String get name => widget.name;
| String get parentName => widget.parentName;
| int get tagId => widget.tagId;
| @override
| Widget build(BuildContext context) {
| return Container(
| constraints: BoxConstraints(
| minHeight: 10,
| minWidth: double.infinity
| ),
| decoration: BoxDecoration(
| color: Colors.white70,
| borderRadius: BorderRadius.circular(10)
| ),
| padding: EdgeInsets.only(top: 10.0, bottom: 10.0, left: 10.0, right: 0),
| margin: EdgeInsets.all(10.0),
| child: InkWell(
| onTap: widget.onTagTap,
| child: Column(
| children: [
| Container(
| constraints: BoxConstraints(
| minHeight: 20,
| minWidth: double.infinity
| ),
| decoration: BoxDecoration(
| border: Border(
| bottom: BorderSide(
| color: Color.fromRGBO(220,220,220,1.0),
| width: 1.0,
| )
| ),
| ),
| child: Row(
| mainAxisAlignment: MainAxisAlignment.start,
| children: [
| Container(
| constraints: BoxConstraints(
| minHeight: 50,
| maxWidth: 50.0
| ),
| child: Icon(Icons.turned_in, size: 25.0, color: Colors.blue)
| ),
| Text("分类", style: TextStyle(fontWeight: FontWeight.bold ,color: Colors.grey)),
| ],
| )
| ),
| Container(
| child: Row(
| mainAxisAlignment: MainAxisAlignment.start,
| children: [
| Text(name, style: TextStyle(fontSize: 20.0,fontWeight: FontWeight.bold ,color: Colors.black87)),
| ],
| ),
| ),
| Container(
| child: Row(
| mainAxisAlignment: MainAxisAlignment.start,
| children: [
| Text("上级:", style: TextStyle(fontSize: 12.0, color: Colors.grey)),
| Text(parentName, style: TextStyle(fontSize: 12.0, color: Colors.grey)),
| ],
| ),
| ),
| ],
| ),
| )
| );
| }
| }
|
|