Skip to content

Commit 07cf3f6

Browse files
committed
migrate to flutter icon package
1 parent 5358d11 commit 07cf3f6

File tree

1 file changed

+43
-13
lines changed

1 file changed

+43
-13
lines changed

Diff for: lib/presentation_layer/components/note_card/bottom_action_row.dart

+43-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:camelus/config/palette.dart';
22
import 'package:flutter/material.dart';
33
import 'package:flutter_svg/flutter_svg.dart';
4+
import 'package:phosphor_flutter/phosphor_flutter.dart';
45

56
class BottomActionRow extends StatelessWidget {
67
final VoidCallback onComment;
@@ -11,6 +12,11 @@ class BottomActionRow extends StatelessWidget {
1112
final int? commentCount;
1213
final int? retweetCount;
1314
final int? likeCount;
15+
final bool? isRetweeted;
16+
final bool? isLiked;
17+
18+
static const iconSize = 24.0;
19+
static const defaultColor = Palette.darkGray;
1420

1521
const BottomActionRow({
1622
super.key,
@@ -22,6 +28,8 @@ class BottomActionRow extends StatelessWidget {
2228
this.commentCount,
2329
this.retweetCount,
2430
this.likeCount,
31+
this.isRetweeted,
32+
this.isLiked,
2533
});
2634

2735
@override
@@ -31,35 +39,55 @@ class BottomActionRow extends StatelessWidget {
3139
children: [
3240
_buildActionButton(
3341
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+
),
3548
count: commentCount,
3649
),
3750
_buildActionButton(
3851
onTap: onRetweet,
39-
icon: 'assets/icons/retweet.svg',
52+
svgIcon: 'assets/icons/retweet.svg',
4053
count: retweetCount,
4154
),
4255
_buildActionButton(
4356
onTap: onLike,
44-
icon: 'assets/icons/heart.svg',
57+
icon: Icon(
58+
PhosphorIcons.heart(),
59+
size: iconSize,
60+
color: defaultColor,
61+
),
4562
count: likeCount,
4663
),
4764
_buildActionButton(
4865
onTap: onShare,
49-
icon: 'assets/icons/share.svg',
66+
icon: Icon(
67+
PhosphorIcons.share(),
68+
size: iconSize,
69+
color: defaultColor,
70+
),
5071
),
5172
_buildActionButton(
5273
onTap: onMore,
53-
icon: 'assets/icons/tweetSetting.svg',
74+
icon: Icon(
75+
PhosphorIcons.dotsThree(),
76+
size: iconSize,
77+
color: defaultColor,
78+
),
5479
)
5580
],
5681
);
5782
}
5883

5984
Widget _buildActionButton({
6085
required VoidCallback onTap,
61-
required String icon,
86+
Icon? icon,
87+
String? svgIcon,
6288
int? count,
89+
bool? isToggled,
90+
Color? activeColor,
6391
}) {
6492
return SizedBox(
6593
height: 35,
@@ -72,14 +100,16 @@ class BottomActionRow extends StatelessWidget {
72100
child: Row(
73101
mainAxisAlignment: MainAxisAlignment.center,
74102
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+
),
81112
),
82-
),
83113
if (count != null) ...[
84114
const SizedBox(width: 5),
85115
Text(

0 commit comments

Comments
 (0)