-
Notifications
You must be signed in to change notification settings - Fork 1
activity section added #398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ import 'package:resonance_network_wallet/v2/screens/activity/transaction_detail_ | |
| import 'package:resonance_network_wallet/v2/screens/activity/tx_item.dart'; | ||
| import 'package:resonance_network_wallet/v2/theme/app_colors.dart'; | ||
| import 'package:resonance_network_wallet/v2/theme/app_text_styles.dart'; | ||
| import 'package:url_launcher/url_launcher.dart'; | ||
|
|
||
| class ActivitySection extends ConsumerWidget { | ||
| final AsyncValue<CombinedTransactionsList> txAsync; | ||
|
|
@@ -44,12 +45,8 @@ class ActivitySection extends ConsumerWidget { | |
| children: [ | ||
| const SizedBox(height: 40), | ||
| _header(colors, text, context), | ||
| const SizedBox(height: 48), | ||
| Icon(Icons.receipt_long_outlined, size: 48, color: colors.textTertiary), | ||
| const SizedBox(height: 16), | ||
| Text('No transactions yet', style: text.paragraph?.copyWith(color: colors.textSecondary)), | ||
| const SizedBox(height: 8), | ||
| Text('Your activity will appear here', style: text.detail?.copyWith(color: colors.textTertiary)), | ||
| const SizedBox(height: 24), | ||
| _getStartedLinks(text, colors), | ||
| ], | ||
| ); | ||
| } | ||
|
|
@@ -123,6 +120,33 @@ class ActivitySection extends ConsumerWidget { | |
| ); | ||
| } | ||
|
|
||
| Widget _getStartedLinks(AppTextTheme text, AppColorsV2 colors) { | ||
| final linkStyle = text.smallParagraph?.copyWith(color: colors.textPrimary); | ||
| final links = [ | ||
| ('Get Testnet Tokens →', AppConstants.faucetBotUrl), | ||
| ('Community →', AppConstants.communityUrl), | ||
| ('Tech Support →', AppConstants.techSupportUrl), | ||
| ]; | ||
|
|
||
| return Container( | ||
| width: double.infinity, | ||
| padding: const EdgeInsets.all(20), | ||
| decoration: BoxDecoration(color: const Color(0x3F000000), borderRadius: BorderRadius.circular(5)), | ||
| child: Column( | ||
| crossAxisAlignment: CrossAxisAlignment.start, | ||
| children: [ | ||
| for (var i = 0; i < links.length; i++) ...[ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm… seems really verbose using for loop here. We can use map instead and the extra spacing can be omitted by just use the column spacing instead
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i kind of like old school for loop.. 😂 although AI made this ... |
||
| GestureDetector( | ||
| onTap: () => launchUrl(Uri.parse(links[i].$2)), | ||
| child: Text(links[i].$1, style: linkStyle), | ||
| ), | ||
| if (i < links.length - 1) const SizedBox(height: 25), | ||
| ], | ||
| ], | ||
| ), | ||
| ); | ||
| } | ||
|
|
||
| Widget _header(AppColorsV2 colors, AppTextTheme text, BuildContext context) { | ||
| return Row( | ||
| mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont we have a card background color? I think we can reuse it instead of introducing new one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a black opacity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has always been in there, needs another PR