Skip to content

Commit

Permalink
display amount below the asset name
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgunozerk committed Jan 3, 2024
1 parent 5bd1086 commit 396b78b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
7 changes: 7 additions & 0 deletions lib/presentation/ui/text_styles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ const TextStyle assetTextStyle = TextStyle(
color: Colors.black,
);

/// AssetCard Text Styles
const TextStyle amountTextStyle = TextStyle(
fontSize: 13,
fontWeight: FontWeight.w600,
color: howBlack,
);

TextStyle changeTextStyle(double change) {
return TextStyle(
fontSize: 13,
Expand Down
24 changes: 18 additions & 6 deletions lib/presentation/widgets/cards/static_asset_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:how_much/util/symbol_to_icon.dart';
class StaticAssetCard extends StatelessWidget {
final AssetType assetType;
final String assetId;
final double amount;
final double value;
final double profit;
final double rateChange;
Expand All @@ -20,6 +21,7 @@ class StaticAssetCard extends StatelessWidget {
const StaticAssetCard({
super.key,
required this.assetId,
required this.amount,
required this.value,
required this.profit,
required this.assetType,
Expand All @@ -45,14 +47,24 @@ class StaticAssetCard extends StatelessWidget {
Row(
children: [
Padding(
padding: const EdgeInsets.only(left: 12, right: 12),
padding: const EdgeInsets.only(left: 12, right: 14),
child: assetIdToIcon(assetId, assetType),
),
Text(
assetType == AssetType.crypto
? cryptoIdToSymbol(assetId).toUpperCase()
: assetId.toUpperCase(),
style: assetTextStyle,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
assetType == AssetType.crypto
? cryptoIdToSymbol(assetId).toUpperCase()
: assetId.toUpperCase(),
style: assetTextStyle,
),
Text(
formatWithoutSign(amount),
style: amountTextStyle,
),
],
),
],
),
Expand Down
1 change: 1 addition & 0 deletions lib/presentation/widgets/static_asset_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ List<Widget> _buildAssetItems(List<AssetItem> assetList, BuildContext context) {
children: [
StaticAssetCard(
assetId: assetId,
amount: assetReport.amount,
value: assetReport.endValue,
assetType: assetType,
borderRadius: borderRadius,
Expand Down

0 comments on commit 396b78b

Please sign in to comment.