-
Notifications
You must be signed in to change notification settings - Fork 0
/
card.dart
118 lines (115 loc) · 3.93 KB
/
card.dart
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import 'package:flutter/material.dart';
import 'package:profile_flutter/components/avatar.dart';
import 'package:profile_flutter/constants.dart';
class CardView extends StatelessWidget {
const CardView({
Key? key,
required this.date,
required this.commentCount,
required this.favoriteCount,
}) : super(key: key);
final String date;
final int commentCount, favoriteCount;
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.all(0),
decoration: const BoxDecoration(color: Colors.white),
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
vertical: 20.0,
),
child: Row(
children: [
const Avatar(
avatarURL: 'assets/images/avatar.jpg',
size: 50.0,
),
const SizedBox(width: 16),
Expanded(
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
date,
style: const TextStyle(
color: Color(0xFF959595),
fontSize: 15,
fontWeight: FontWeight.normal,
),
),
const Text(
'@93alan',
style: TextStyle(
color: Color(0xFF959595),
fontSize: 15,
fontWeight: FontWeight.normal,
),
),
],
),
const SizedBox(height: 4.0),
const Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
style: TextStyle(fontSize: 14.0, height: 1.4),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: kLargePadding),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: 50.0,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Icon(
Icons.chat_bubble_outline,
size: 18.0,
color: Color(0xFF74786B),
),
const SizedBox(width: 8.0),
Text(
'$commentCount',
style: const TextStyle(fontSize: 14.0),
)
],
),
),
SizedBox(
width: 50.0,
child: Row(
children: [
const Icon(
Icons.favorite,
size: 18.0,
color: Color(0xFF74786B),
),
const SizedBox(width: 8.0),
Text(
'$favoriteCount',
style: const TextStyle(fontSize: 14.0),
)
],
),
),
const Icon(
Icons.share,
size: 18.0,
color: Color(0xFF74786B),
),
],
),
],
),
),
],
),
);
}
}