Skip to content

Commit

Permalink
refactor: remove useless variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-orion committed Dec 12, 2024
1 parent 9ce3665 commit 1ea31dd
Showing 1 changed file with 24 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,38 +51,32 @@ class FollowedByText extends HookConsumerWidget {
color: context.theme.appColors.darkBlue,
);

final textSpans = [
TextSpan(
text: context.i18n.profile_followed_by,
style: defaultStyle,
),
TextSpan(
text: firstUserMetadata.data.displayName,
style: actionableStyle,
recognizer: userTapRecognizer,
),
];

if (pubkeys.length > 1) {
textSpans
..add(
TextSpan(
text: context.i18n.profile_followed_by_and,
style: defaultStyle,
),
)
..add(
TextSpan(
text: context.i18n.profile_followed_by_and_others,
style: actionableStyle,
recognizer: othersTapRecognizer,
),
);
}

return Expanded(
child: RichText(
text: TextSpan(children: textSpans),
text: TextSpan(
children: [
TextSpan(
text: context.i18n.profile_followed_by,
style: defaultStyle,
),
TextSpan(
text: firstUserMetadata.data.displayName,
style: actionableStyle,
recognizer: userTapRecognizer,
),
if (pubkeys.length > 1) ...[
TextSpan(
text: context.i18n.profile_followed_by_and,
style: defaultStyle,
),
TextSpan(
text: context.i18n.profile_followed_by_and_others,
style: actionableStyle,
recognizer: othersTapRecognizer,
),
],
],
),
textScaler: MediaQuery.textScalerOf(context),
maxLines: 2,
overflow: TextOverflow.ellipsis,
Expand Down

0 comments on commit 1ea31dd

Please sign in to comment.