Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed mobile-app/assets/v2/glass_small_button_40.png
Binary file not shown.
Binary file modified mobile-app/assets/v2/glass_tiny_button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'package:flutter/material.dart';
import 'package:resonance_network_wallet/utils/color_generator_engine.dart';

class AccountGradientImage extends StatelessWidget {
final dynamic accountId;
final dynamic width;
final dynamic height;
final String accountId;
final double width;
final double height;

const AccountGradientImage({super.key, required this.accountId, required this.width, required this.height});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import 'package:resonance_network_wallet/features/components/wallet_app_bar.dart
import 'package:resonance_network_wallet/features/main/screens/create_account_screen.dart';
import 'package:resonance_network_wallet/features/main/screens/high_security/high_security_details_screen.dart';
import 'package:resonance_network_wallet/features/main/screens/high_security/high_security_get_started_screen.dart';
import 'package:resonance_network_wallet/features/main/screens/receive_screen.dart';
import 'package:resonance_network_wallet/shared/utils/share_utils.dart';
import 'package:resonance_network_wallet/features/styles/app_colors_theme.dart';
import 'package:resonance_network_wallet/features/styles/app_text_theme.dart';
import 'package:resonance_network_wallet/shared/extensions/clipboard_extensions.dart';
Expand Down Expand Up @@ -256,9 +256,7 @@ class _AccountSettingsScreenState extends ConsumerState<AccountSettingsScreen> {
Widget _buildShareSection() {
return _buildSettingCard(
child: InkWell(
onTap: () {
showReceiveSheet(context, isReceiving: false);
},
onTap: () => shareAccountDetails(context, widget.account.accountId, checksum: widget.checksumName),
child: Padding(
padding: const EdgeInsets.only(left: 10.0, top: 8.5, bottom: 8.5, right: 18.0),
child: Row(
Expand Down
17 changes: 4 additions & 13 deletions mobile-app/lib/features/main/screens/receive_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'package:resonance_network_wallet/features/styles/app_colors_theme.dart';
import 'package:resonance_network_wallet/features/styles/app_text_theme.dart';
import 'package:resonance_network_wallet/shared/extensions/clipboard_extensions.dart';
import 'package:resonance_network_wallet/shared/extensions/media_query_data_extension.dart';
import 'package:share_plus/share_plus.dart';
import 'package:resonance_network_wallet/shared/utils/share_utils.dart';

class ReceiveSheet extends StatefulWidget {
final bool isReceiving;
Expand Down Expand Up @@ -69,17 +69,8 @@ class _ReceiveSheetState extends State<ReceiveSheet> {
}

void _share() {
if (_accountId != null && _checksum != null) {
final textToShare =
'Hey! These are my Quantus account details:\n\nAddress:\n$_accountId\n\nCheckphrase:$_checksum\n\nTo open in the app or to download click the link below:\n${AppConstants.websiteBaseUrl}/account?id=$_accountId';
SharePlus.instance.share(
ShareParams(
text: textToShare,
subject: 'Shared Address',
title: 'Shared Address',
sharePositionOrigin: context.sharePositionRect(),
),
);
if (_accountId != null) {
shareAccountDetails(context, _accountId!, checksum: _checksum ?? '');
}
}

Expand Down Expand Up @@ -164,7 +155,7 @@ class _ReceiveSheetState extends State<ReceiveSheet> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
AccountGradientImage(
accountId: _accountId,
accountId: _accountId!,
width: context.isTablet ? 32.0 : 24.0,
height: context.isTablet ? 32.0 : 24.0,
),
Expand Down
4 changes: 2 additions & 2 deletions mobile-app/lib/features/main/screens/settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:resonance_network_wallet/features/components/reset_confirmation_
import 'package:resonance_network_wallet/features/components/scaffold_base.dart';
import 'package:resonance_network_wallet/features/components/sphere.dart';
import 'package:resonance_network_wallet/features/components/wallet_app_bar.dart';
import 'package:resonance_network_wallet/features/main/screens/accounts_screen.dart';
import 'package:resonance_network_wallet/v2/screens/home/accounts_sheet.dart';
import 'package:resonance_network_wallet/features/main/screens/authentication_settings_screen.dart';
import 'package:resonance_network_wallet/features/main/screens/notifications_settings_screen.dart';
import 'package:resonance_network_wallet/features/main/screens/select_wallet_for_recovery_phrase_screen.dart';
Expand Down Expand Up @@ -159,7 +159,7 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
ListItem(
title: 'Manage Accounts',
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => const AccountsScreen()));
showAccountsSheet(context);
},
),
const SizedBox(height: 22),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'package:resonance_network_wallet/features/components/shared_address_acti
import 'package:resonance_network_wallet/features/components/skeleton.dart';
import 'package:resonance_network_wallet/features/components/sphere.dart';
import 'package:resonance_network_wallet/features/components/wallet_app_bar.dart';
import 'package:resonance_network_wallet/features/main/screens/accounts_screen.dart';
import 'package:resonance_network_wallet/v2/screens/home/accounts_sheet.dart';
import 'package:resonance_network_wallet/features/main/screens/receive_screen.dart';
import 'package:resonance_network_wallet/features/main/screens/notifications_screen.dart';
import 'package:resonance_network_wallet/features/main/screens/send/send_screen.dart';
Expand Down Expand Up @@ -127,7 +127,7 @@ class _WalletMainState extends ConsumerState<WalletMain> {
InkWell(
child: SvgPicture.asset('assets/wallet_icon.svg', width: 26, height: 26),
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => const AccountsScreen()));
showAccountsSheet(context);
},
),
],
Expand Down
20 changes: 20 additions & 0 deletions mobile-app/lib/shared/utils/share_utils.dart
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}) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

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(),
),
);
}
9 changes: 8 additions & 1 deletion mobile-app/lib/v2/components/glass_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class GlassContainer extends StatelessWidget {
static const mediumAsset = 'assets/v2/glass_medium_clear.png';
static const mediumSmallAsset = 'assets/v2/glass_medium_clear_small.png'; // 36px height
static const smallAsset = 'assets/v2/glass_40.png';
static const tinyAsset = 'assets/v2/glass_tiny_button.png';
static const wideAsset = 'assets/v2/glass_wide_clear.png';
static const wideClearAsset = 'assets/v2/glass_wide_clear.png';

Expand All @@ -29,6 +30,12 @@ class GlassContainer extends StatelessWidget {
? 36
: 56;

double get defaultRadius => asset == tinyAsset
? 4
: asset == smallAsset
? 8
: 14;

const GlassContainer({
super.key,
required this.child,
Expand All @@ -44,7 +51,7 @@ class GlassContainer extends StatelessWidget {
return GestureDetector(
onTap: onTap,
child: ClipRRect(
borderRadius: BorderRadius.circular(14),
borderRadius: BorderRadius.circular(defaultRadius),
child: SizedBox(
height: defaultHeight,
child: Stack(
Expand Down
99 changes: 99 additions & 0 deletions mobile-app/lib/v2/components/token_icon.dart
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,
),
),
),
);
}
}
3 changes: 2 additions & 1 deletion mobile-app/lib/v2/screens/activity/activity_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class ActivityScreen extends ConsumerWidget {
children: [
const AppBackButton(),
Text('Activity', style: text.smallTitle?.copyWith(color: colors.textPrimary, fontSize: 20)),
Icon(Icons.info_outline, color: colors.textPrimary, size: 24),
const SizedBox(width: 24), // empty filler
// Icon(Icons.info_outline, color: colors.textPrimary, size: 24),
],
),
const SizedBox(height: 48),
Expand Down
10 changes: 4 additions & 6 deletions mobile-app/lib/v2/screens/activity/transaction_detail_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:quantus_sdk/quantus_sdk.dart';
import 'package:resonance_network_wallet/shared/extensions/clipboard_extensions.dart';
import 'package:resonance_network_wallet/shared/extensions/transaction_event_extension.dart';
import 'package:resonance_network_wallet/v2/components/bottom_sheet_container.dart';
import 'package:resonance_network_wallet/v2/components/glass_container.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';
Expand Down Expand Up @@ -178,12 +179,9 @@ class _TransactionDetailSheetState extends State<_TransactionDetailSheet> {
Widget _explorerButton(AppColorsV2 colors, AppTextTheme text) {
return GestureDetector(
onTap: _openExplorer,
child: Container(
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(14),
border: Border.all(color: Colors.white.withValues(alpha: 0.44)),
),
child: GlassContainer(
asset: GlassContainer.wideAsset,
filled: false,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expand Down
Loading