Skip to content

Commit

Permalink
Replace score icons with a single icon indicator (#1341)
Browse files Browse the repository at this point in the history
* New score single-side score indicator icon using stacked arrows

* formatting
  • Loading branch information
CTalvio authored May 14, 2024
1 parent e436f24 commit ab41128
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/community/widgets/post_card_metadata.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import 'package:lemmy_api_client/v3.dart';
Expand Down Expand Up @@ -138,14 +139,25 @@ class ScorePostCardMetaData extends StatelessWidget {
crossAxisAlignment: WrapCrossAlignment.center,
runAlignment: WrapAlignment.center,
children: [
Icon(Icons.arrow_upward, size: 17.0, color: color),
SizedBox(
width: 21,
height: 17,
child: Stack(
children: [
Align(alignment: Alignment.topLeft, child: Icon(Icons.arrow_upward, size: 13.5, color: voteType == -1 ? readColor : color)),
Align(
alignment: Alignment.bottomRight,
child: Icon(Icons.arrow_downward, size: 13.5, color: voteType == 1 ? readColor : color),
),
],
),
),
ScalableText(
formatNumberToK(score ?? 0),
semanticsLabel: l10n.xScore(formatNumberToK(score ?? 0)),
fontScale: state.metadataFontSizeScale,
style: theme.textTheme.bodyMedium?.copyWith(color: color),
),
Icon(Icons.arrow_downward, size: 17.0, color: color),
],
);
}
Expand Down

0 comments on commit ab41128

Please sign in to comment.