-
Notifications
You must be signed in to change notification settings - Fork 1
new accounts list #392
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
Merged
Merged
new accounts list #392
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
d1de8d5
new accounts list
n13 535d699
Merge branch 'main' into accounts_list_v3
n13 d4fdaf0
share button fix on account edit
n13 406c6b0
new edit account screen
n13 68dd3ce
restore v1 accounts screen, move new code to accounts sheet
n13 8930670
format
n13 2a4e31c
rename to accounts sheet
n13 f74c45d
color cleanup
n13 7aafb36
accounts screen buttons
n13 9a12d48
format
n13 ba7df5b
reversible coming soon
n13 85d4914
hide balance
n13 d47361c
explorer button is a glass button
n13 0b55cb3
hide info button
n13 2573947
comment out reversible code
n13 2d7f7fa
Swap screen fixes (#396)
n13 346481d
checksum untangled
n13 306b037
Merge branch 'accounts_list_v3' of github.com:Quantus-Network/quantus…
n13 493a111
format
n13 5d0f143
remove some bad code from updateAccount
n13 781c8c4
check name empty here
n13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:quantus_sdk/quantus_sdk.dart'; | ||
| import 'package:share_plus/share_plus.dart'; | ||
|
|
||
| String buildAccountShareText(String accountId, {required String checksum}) { | ||
| final checkphrasePart = '\n\nCheckphrase:$checksum'; | ||
|
|
||
| return 'Hey! These are my Quantus account details:\n\nAddress:\n$accountId$checkphrasePart\n\nTo open in the app or to download click the link below:\n${AppConstants.websiteBaseUrl}/account?id=$accountId'; | ||
| } | ||
|
|
||
| void shareAccountDetails(BuildContext context, String accountId, {required String checksum}) { | ||
| SharePlus.instance.share( | ||
| ShareParams( | ||
| text: buildAccountShareText(accountId, checksum: checksum), | ||
| subject: 'Shared Address', | ||
| title: 'Shared Address', | ||
| sharePositionOrigin: context.sharePositionRect(), | ||
| ), | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:quantus_sdk/quantus_sdk.dart'; | ||
| import 'package:resonance_network_wallet/v2/theme/app_colors.dart'; | ||
| import 'package:resonance_network_wallet/v2/theme/app_text_styles.dart'; | ||
|
|
||
| class TokenIcon extends StatelessWidget { | ||
| final SwapToken token; | ||
| final double size; | ||
| final double networkBadgeSize; | ||
|
|
||
| const TokenIcon({super.key, required this.token, this.size = 31, this.networkBadgeSize = 12}); | ||
|
|
||
| @override | ||
| Widget build(BuildContext context) { | ||
| final colors = context.colors; | ||
| final text = context.themeText; | ||
| final swapService = SwapService(); | ||
| final iconUrl = token.iconUrl ?? swapService.getTokenIconUrl(token); | ||
| final networkIconUrl = token.networkIconUrl ?? swapService.getNetworkIconUrl(token); | ||
|
|
||
| return SizedBox( | ||
| width: size, | ||
| height: size, | ||
| child: Stack( | ||
| clipBehavior: Clip.none, | ||
| children: [ | ||
| Positioned.fill( | ||
| child: ClipOval( | ||
| child: iconUrl != null | ||
| ? Image.network( | ||
| iconUrl, | ||
| fit: BoxFit.cover, | ||
| errorBuilder: (_, _, _) => _fallback(context, token, colors, text), | ||
| ) | ||
| : _fallback(context, token, colors, text), | ||
| ), | ||
| ), | ||
| Positioned( | ||
| right: -2, | ||
| bottom: -2, | ||
| child: SizedBox( | ||
| width: networkBadgeSize, | ||
| height: networkBadgeSize, | ||
| child: ClipOval( | ||
| child: networkIconUrl != null | ||
| ? Image.network( | ||
| networkIconUrl, | ||
| fit: BoxFit.cover, | ||
| errorBuilder: (_, _, _) => _networkFallback(context, token, colors, text), | ||
| ) | ||
| : _networkFallback(context, token, colors, text), | ||
| ), | ||
| ), | ||
| ), | ||
| ], | ||
| ), | ||
| ); | ||
| } | ||
|
|
||
| Widget _fallback(BuildContext context, SwapToken token, AppColorsV2 colors, AppTextTheme text) { | ||
| return Container( | ||
| decoration: BoxDecoration( | ||
| color: const Color(0xFF2F86E8), | ||
| shape: BoxShape.circle, | ||
| border: Border.all(color: const Color(0xFF71B5FF), width: 1.4), | ||
| ), | ||
| child: Center( | ||
| child: Text( | ||
| token.symbol.isNotEmpty ? token.symbol.substring(0, 1) : '?', | ||
| style: text.tiny?.copyWith( | ||
| color: colors.textPrimary, | ||
| fontWeight: FontWeight.w700, | ||
| decoration: TextDecoration.none, | ||
| ), | ||
| ), | ||
| ), | ||
| ); | ||
| } | ||
|
|
||
| Widget _networkFallback(BuildContext context, SwapToken token, AppColorsV2 colors, AppTextTheme text) { | ||
| return Container( | ||
| decoration: BoxDecoration( | ||
| color: const Color(0xFF1A1A1A), | ||
| border: Border.all(color: const Color(0xFF3D3D3D)), | ||
| ), | ||
| child: Center( | ||
| child: Text( | ||
| token.network.isNotEmpty ? token.network.substring(0, 1) : '?', | ||
| style: text.tiny?.copyWith( | ||
| color: colors.textPrimary, | ||
| fontSize: 8, | ||
| fontWeight: FontWeight.w700, | ||
| decoration: TextDecoration.none, | ||
| ), | ||
| ), | ||
| ), | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Great!