1
1
import 'package:camelus/config/palette.dart' ;
2
2
import 'package:flutter/material.dart' ;
3
3
import 'package:flutter_svg/flutter_svg.dart' ;
4
+ import 'package:phosphor_flutter/phosphor_flutter.dart' ;
4
5
5
6
class BottomActionRow extends StatelessWidget {
6
7
final VoidCallback onComment;
@@ -11,6 +12,11 @@ class BottomActionRow extends StatelessWidget {
11
12
final int ? commentCount;
12
13
final int ? retweetCount;
13
14
final int ? likeCount;
15
+ final bool ? isRetweeted;
16
+ final bool ? isLiked;
17
+
18
+ static const iconSize = 24.0 ;
19
+ static const defaultColor = Palette .darkGray;
14
20
15
21
const BottomActionRow ({
16
22
super .key,
@@ -22,6 +28,8 @@ class BottomActionRow extends StatelessWidget {
22
28
this .commentCount,
23
29
this .retweetCount,
24
30
this .likeCount,
31
+ this .isRetweeted,
32
+ this .isLiked,
25
33
});
26
34
27
35
@override
@@ -31,35 +39,55 @@ class BottomActionRow extends StatelessWidget {
31
39
children: [
32
40
_buildActionButton (
33
41
onTap: onComment,
34
- icon: 'assets/icons/chat-teardrop-text.svg' ,
42
+ //icon: 'assets/icons/chat-teardrop-text.svg',
43
+ icon: Icon (
44
+ PhosphorIcons .chatTeardropText (),
45
+ size: iconSize,
46
+ color: defaultColor,
47
+ ),
35
48
count: commentCount,
36
49
),
37
50
_buildActionButton (
38
51
onTap: onRetweet,
39
- icon : 'assets/icons/retweet.svg' ,
52
+ svgIcon : 'assets/icons/retweet.svg' ,
40
53
count: retweetCount,
41
54
),
42
55
_buildActionButton (
43
56
onTap: onLike,
44
- icon: 'assets/icons/heart.svg' ,
57
+ icon: Icon (
58
+ PhosphorIcons .heart (),
59
+ size: iconSize,
60
+ color: defaultColor,
61
+ ),
45
62
count: likeCount,
46
63
),
47
64
_buildActionButton (
48
65
onTap: onShare,
49
- icon: 'assets/icons/share.svg' ,
66
+ icon: Icon (
67
+ PhosphorIcons .share (),
68
+ size: iconSize,
69
+ color: defaultColor,
70
+ ),
50
71
),
51
72
_buildActionButton (
52
73
onTap: onMore,
53
- icon: 'assets/icons/tweetSetting.svg' ,
74
+ icon: Icon (
75
+ PhosphorIcons .dotsThree (),
76
+ size: iconSize,
77
+ color: defaultColor,
78
+ ),
54
79
)
55
80
],
56
81
);
57
82
}
58
83
59
84
Widget _buildActionButton ({
60
85
required VoidCallback onTap,
61
- required String icon,
86
+ Icon ? icon,
87
+ String ? svgIcon,
62
88
int ? count,
89
+ bool ? isToggled,
90
+ Color ? activeColor,
63
91
}) {
64
92
return SizedBox (
65
93
height: 35 ,
@@ -72,14 +100,16 @@ class BottomActionRow extends StatelessWidget {
72
100
child: Row (
73
101
mainAxisAlignment: MainAxisAlignment .center,
74
102
children: [
75
- SvgPicture .asset (
76
- icon,
77
- height: 35 ,
78
- colorFilter: const ColorFilter .mode (
79
- Palette .darkGray,
80
- BlendMode .srcIn,
103
+ if (icon != null ) icon,
104
+ if (svgIcon != null )
105
+ SvgPicture .asset (
106
+ svgIcon,
107
+ height: 35 ,
108
+ colorFilter: const ColorFilter .mode (
109
+ defaultColor,
110
+ BlendMode .srcATop,
111
+ ),
81
112
),
82
- ),
83
113
if (count != null ) ...[
84
114
const SizedBox (width: 5 ),
85
115
Text (
0 commit comments