diff --git a/lib/application/dapps.dart b/lib/application/dapps.dart index 79360e5c5..0ab498259 100644 --- a/lib/application/dapps.dart +++ b/lib/application/dapps.dart @@ -2,7 +2,6 @@ import 'package:aewallet/application/api_service.dart'; import 'package:aewallet/application/settings/settings.dart'; import 'package:aewallet/domain/models/dapp.dart'; import 'package:aewallet/infrastructure/repositories/dapps_repository.dart'; -import 'package:aewallet/model/available_networks.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -17,21 +16,27 @@ DAppsRepositoryImpl dAppsRepository( @riverpod Future getDApp( Ref ref, - AvailableNetworks network, String code, ) async { final apiService = ref.watch(apiServiceProvider); - return ref.watch(dAppsRepositoryProvider).getDApp(network, code, apiService); + final networkSettings = ref.watch( + SettingsProviders.settings.select((settings) => settings.network), + ); + return ref + .watch(dAppsRepositoryProvider) + .getDApp(networkSettings.network, code, apiService); } @riverpod Future> getDAppsFromNetwork( Ref ref, - AvailableNetworks network, ) async { final apiService = ref.watch(apiServiceProvider); + final networkSettings = ref.watch( + SettingsProviders.settings.select((settings) => settings.network), + ); final dAppsFromNetwork = await ref .read(dAppsRepositoryProvider) - .getDAppsFromNetwork(network, apiService); + .getDAppsFromNetwork(networkSettings.network, apiService); return dAppsFromNetwork; } diff --git a/lib/application/dapps.g.dart b/lib/application/dapps.g.dart index a0373fa0a..371579fea 100644 --- a/lib/application/dapps.g.dart +++ b/lib/application/dapps.g.dart @@ -6,11 +6,7 @@ part of 'dapps.dart'; // RiverpodGenerator // ************************************************************************** -<<<<<<< HEAD -String _$dAppsRepositoryHash() => r'6de8e91d80ef070475a657e77ea3f07fa5d9f543'; -======= String _$dAppsRepositoryHash() => r'fb013548900316c315da404d775c03d2e4f7a24e'; ->>>>>>> 3cd2a51c (feat: :sparkles: Add Dapps Board) /// See also [dAppsRepository]. @ProviderFor(dAppsRepository) @@ -27,13 +23,8 @@ final dAppsRepositoryProvider = @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -<<<<<<< HEAD -typedef _DAppsRepositoryRef = AutoDisposeProviderRef; -String _$getDAppHash() => r'e708424d60dbef17da84a12ed02a67dd493a28a2'; -======= typedef DAppsRepositoryRef = AutoDisposeProviderRef; -String _$getDAppHash() => r'ecbe738bde602c22d655a26d4284ad83fb6f2c53'; ->>>>>>> 3cd2a51c (feat: :sparkles: Add Dapps Board) +String _$getDAppHash() => r'74094f96d68512dbd3eb1224e89265e4e3fad1c2'; /// Copied from Dart SDK class _SystemHash { @@ -65,21 +56,11 @@ class GetDAppFamily extends Family> { /// See also [getDApp]. const GetDAppFamily(); -<<<<<<< HEAD - /// See also [_getDApp]. - _GetDAppProvider call( - String code, - ) { - return _GetDAppProvider( -======= /// See also [getDApp]. GetDAppProvider call( - AvailableNetworks network, String code, ) { return GetDAppProvider( - network, ->>>>>>> 3cd2a51c (feat: :sparkles: Add Dapps Board) code, ); } @@ -108,27 +89,14 @@ class GetDAppFamily extends Family> { String? get name => r'getDAppProvider'; } -<<<<<<< HEAD -/// See also [_getDApp]. -class _GetDAppProvider extends AutoDisposeFutureProvider { - /// See also [_getDApp]. - _GetDAppProvider( - String code, - ) : this._internal( - (ref) => _getDApp( - ref as _GetDAppRef, -======= /// See also [getDApp]. class GetDAppProvider extends AutoDisposeFutureProvider { /// See also [getDApp]. GetDAppProvider( - AvailableNetworks network, String code, ) : this._internal( (ref) => getDApp( ref as GetDAppRef, - network, ->>>>>>> 3cd2a51c (feat: :sparkles: Add Dapps Board) code, ), from: getDAppProvider, @@ -137,14 +105,8 @@ class GetDAppProvider extends AutoDisposeFutureProvider { const bool.fromEnvironment('dart.vm.product') ? null : _$getDAppHash, -<<<<<<< HEAD - dependencies: _GetDAppFamily._dependencies, - allTransitiveDependencies: _GetDAppFamily._allTransitiveDependencies, -======= dependencies: GetDAppFamily._dependencies, allTransitiveDependencies: GetDAppFamily._allTransitiveDependencies, - network: network, ->>>>>>> 3cd2a51c (feat: :sparkles: Add Dapps Board) code: code, ); @@ -185,13 +147,7 @@ class GetDAppProvider extends AutoDisposeFutureProvider { @override bool operator ==(Object other) { -<<<<<<< HEAD - return other is _GetDAppProvider && other.code == code; -======= - return other is GetDAppProvider && - other.network == network && - other.code == code; ->>>>>>> 3cd2a51c (feat: :sparkles: Add Dapps Board) + return other is GetDAppProvider && other.code == code; } @override @@ -205,14 +161,7 @@ class GetDAppProvider extends AutoDisposeFutureProvider { @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -<<<<<<< HEAD -mixin _GetDAppRef on AutoDisposeFutureProviderRef { -======= mixin GetDAppRef on AutoDisposeFutureProviderRef { - /// The parameter `network` of this provider. - AvailableNetworks get network; - ->>>>>>> 3cd2a51c (feat: :sparkles: Add Dapps Board) /// The parameter `code` of this provider. String get code; } @@ -222,155 +171,27 @@ class _GetDAppProviderElement extends AutoDisposeFutureProviderElement _GetDAppProviderElement(super.provider); @override -<<<<<<< HEAD - String get code => (origin as _GetDAppProvider).code; -} - -String _$getDAppsFromNetworkHash() => - r'0b6c8824ab7d57c392d448753b5139840976372b'; -======= - AvailableNetworks get network => (origin as GetDAppProvider).network; - @override String get code => (origin as GetDAppProvider).code; } String _$getDAppsFromNetworkHash() => - r'684e026068e0ca42e51aa771ac8e6e43fd92da55'; ->>>>>>> 3cd2a51c (feat: :sparkles: Add Dapps Board) + r'9d37f6aedc3ff3ae26f95705b4f04fc87b85ced9'; /// See also [getDAppsFromNetwork]. @ProviderFor(getDAppsFromNetwork) -const getDAppsFromNetworkProvider = GetDAppsFromNetworkFamily(); - -/// See also [getDAppsFromNetwork]. -class GetDAppsFromNetworkFamily extends Family>> { - /// See also [getDAppsFromNetwork]. - const GetDAppsFromNetworkFamily(); - - /// See also [getDAppsFromNetwork]. - GetDAppsFromNetworkProvider call( - AvailableNetworks network, - ) { - return GetDAppsFromNetworkProvider( - network, - ); - } - - @override - GetDAppsFromNetworkProvider getProviderOverride( - covariant GetDAppsFromNetworkProvider provider, - ) { - return call( - provider.network, - ); - } - - static const Iterable? _dependencies = null; - - @override - Iterable? get dependencies => _dependencies; - - static const Iterable? _allTransitiveDependencies = null; - - @override - Iterable? get allTransitiveDependencies => - _allTransitiveDependencies; - - @override - String? get name => r'getDAppsFromNetworkProvider'; -} - -/// See also [getDAppsFromNetwork]. -class GetDAppsFromNetworkProvider - extends AutoDisposeFutureProvider> { - /// See also [getDAppsFromNetwork]. - GetDAppsFromNetworkProvider( - AvailableNetworks network, - ) : this._internal( - (ref) => getDAppsFromNetwork( - ref as GetDAppsFromNetworkRef, - network, - ), - from: getDAppsFromNetworkProvider, - name: r'getDAppsFromNetworkProvider', - debugGetCreateSourceHash: - const bool.fromEnvironment('dart.vm.product') - ? null - : _$getDAppsFromNetworkHash, - dependencies: GetDAppsFromNetworkFamily._dependencies, - allTransitiveDependencies: - GetDAppsFromNetworkFamily._allTransitiveDependencies, - network: network, - ); - - GetDAppsFromNetworkProvider._internal( - super._createNotifier, { - required super.name, - required super.dependencies, - required super.allTransitiveDependencies, - required super.debugGetCreateSourceHash, - required super.from, - required this.network, - }) : super.internal(); - - final AvailableNetworks network; - - @override - Override overrideWith( - FutureOr> Function(GetDAppsFromNetworkRef provider) create, - ) { - return ProviderOverride( - origin: this, - override: GetDAppsFromNetworkProvider._internal( - (ref) => create(ref as GetDAppsFromNetworkRef), - from: from, - name: null, - dependencies: null, - allTransitiveDependencies: null, - debugGetCreateSourceHash: null, - network: network, - ), - ); - } - - @override - AutoDisposeFutureProviderElement> createElement() { - return _GetDAppsFromNetworkProviderElement(this); - } - - @override - bool operator ==(Object other) { - return other is GetDAppsFromNetworkProvider && other.network == network; - } - - @override - int get hashCode { - var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, network.hashCode); - - return _SystemHash.finish(hash); - } -} +final getDAppsFromNetworkProvider = + AutoDisposeFutureProvider>.internal( + getDAppsFromNetwork, + name: r'getDAppsFromNetworkProvider', + debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product') + ? null + : _$getDAppsFromNetworkHash, + dependencies: null, + allTransitiveDependencies: null, +); @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element -<<<<<<< HEAD -mixin _GetDAppsFromNetworkRef on AutoDisposeFutureProviderRef> { -======= -mixin GetDAppsFromNetworkRef on AutoDisposeFutureProviderRef> { ->>>>>>> 3cd2a51c (feat: :sparkles: Add Dapps Board) - /// The parameter `network` of this provider. - AvailableNetworks get network; -} - -class _GetDAppsFromNetworkProviderElement - extends AutoDisposeFutureProviderElement> - with GetDAppsFromNetworkRef { - _GetDAppsFromNetworkProviderElement(super.provider); - - @override - AvailableNetworks get network => - (origin as GetDAppsFromNetworkProvider).network; -} +typedef GetDAppsFromNetworkRef = AutoDisposeFutureProviderRef>; // ignore_for_file: type=lint // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package diff --git a/lib/application/feature_flags.dart b/lib/application/feature_flags.dart index e904dbf50..fd5808fc2 100644 --- a/lib/application/feature_flags.dart +++ b/lib/application/feature_flags.dart @@ -1,6 +1,6 @@ import 'package:aewallet/application/api_service.dart'; +import 'package:aewallet/application/settings/settings.dart'; import 'package:aewallet/infrastructure/repositories/feature_flags_repository.dart'; -import 'package:aewallet/model/available_networks.dart'; import 'package:aewallet/util/universal_platform.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; @@ -16,13 +16,15 @@ FeatureFlagsRepositoryImpl _featureFlagsRepository( @riverpod Future getFeatureFlag( Ref ref, - AvailableNetworks network, String applicationCode, String featureCode, ) async { final apiService = ref.watch(apiServiceProvider); + final networkSettings = ref.watch( + SettingsProviders.settings.select((settings) => settings.network), + ); return ref.watch(_featureFlagsRepositoryProvider).getFeatureFlag( - network, + networkSettings.network, apiService, applicationCode, featureCode, diff --git a/lib/application/feature_flags.g.dart b/lib/application/feature_flags.g.dart index 8b0fea7df..a6ba18692 100644 --- a/lib/application/feature_flags.g.dart +++ b/lib/application/feature_flags.g.dart @@ -26,7 +26,7 @@ final _featureFlagsRepositoryProvider = // ignore: unused_element typedef _FeatureFlagsRepositoryRef = AutoDisposeProviderRef; -String _$getFeatureFlagHash() => r'47b824545e1ef90d87487954d7b1ca8568c93cda'; +String _$getFeatureFlagHash() => r'3d889fb9e466efd3e438678c4202e674acaf884a'; /// Copied from Dart SDK class _SystemHash { @@ -60,12 +60,10 @@ class GetFeatureFlagFamily extends Family> { /// See also [getFeatureFlag]. GetFeatureFlagProvider call( - AvailableNetworks network, String applicationCode, String featureCode, ) { return GetFeatureFlagProvider( - network, applicationCode, featureCode, ); @@ -76,7 +74,6 @@ class GetFeatureFlagFamily extends Family> { covariant GetFeatureFlagProvider provider, ) { return call( - provider.network, provider.applicationCode, provider.featureCode, ); @@ -101,13 +98,11 @@ class GetFeatureFlagFamily extends Family> { class GetFeatureFlagProvider extends AutoDisposeFutureProvider { /// See also [getFeatureFlag]. GetFeatureFlagProvider( - AvailableNetworks network, String applicationCode, String featureCode, ) : this._internal( (ref) => getFeatureFlag( ref as GetFeatureFlagRef, - network, applicationCode, featureCode, ), @@ -120,7 +115,6 @@ class GetFeatureFlagProvider extends AutoDisposeFutureProvider { dependencies: GetFeatureFlagFamily._dependencies, allTransitiveDependencies: GetFeatureFlagFamily._allTransitiveDependencies, - network: network, applicationCode: applicationCode, featureCode: featureCode, ); @@ -132,12 +126,10 @@ class GetFeatureFlagProvider extends AutoDisposeFutureProvider { required super.allTransitiveDependencies, required super.debugGetCreateSourceHash, required super.from, - required this.network, required this.applicationCode, required this.featureCode, }) : super.internal(); - final AvailableNetworks network; final String applicationCode; final String featureCode; @@ -154,7 +146,6 @@ class GetFeatureFlagProvider extends AutoDisposeFutureProvider { dependencies: null, allTransitiveDependencies: null, debugGetCreateSourceHash: null, - network: network, applicationCode: applicationCode, featureCode: featureCode, ), @@ -169,7 +160,6 @@ class GetFeatureFlagProvider extends AutoDisposeFutureProvider { @override bool operator ==(Object other) { return other is GetFeatureFlagProvider && - other.network == network && other.applicationCode == applicationCode && other.featureCode == featureCode; } @@ -177,7 +167,6 @@ class GetFeatureFlagProvider extends AutoDisposeFutureProvider { @override int get hashCode { var hash = _SystemHash.combine(0, runtimeType.hashCode); - hash = _SystemHash.combine(hash, network.hashCode); hash = _SystemHash.combine(hash, applicationCode.hashCode); hash = _SystemHash.combine(hash, featureCode.hashCode); @@ -188,9 +177,6 @@ class GetFeatureFlagProvider extends AutoDisposeFutureProvider { @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element mixin GetFeatureFlagRef on AutoDisposeFutureProviderRef { - /// The parameter `network` of this provider. - AvailableNetworks get network; - /// The parameter `applicationCode` of this provider. String get applicationCode; @@ -202,8 +188,6 @@ class _GetFeatureFlagProviderElement extends AutoDisposeFutureProviderElement with GetFeatureFlagRef { _GetFeatureFlagProviderElement(super.provider); - @override - AvailableNetworks get network => (origin as GetFeatureFlagProvider).network; @override String get applicationCode => (origin as GetFeatureFlagProvider).applicationCode; diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 838ebec3d..f63303603 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -473,6 +473,8 @@ "aeBridgeHeader": "Bridge", "aeSwapEarnHeader": "Earn UCO token", "price": "Price", + "aeBridgeLaunchMessage": "Please launch the aeBridge application to proceed. It will open in your default browser.", + "aeBridgeLaunchButton": "Launch aeBridge", "dAppLaunchMessage": "The application is not available directly on this platform. Please launch the application via a browser to continue. It will open in your default browser.", "dAppLaunchButton": "Launch the dApp", "receiveHeader": "Receive assets on Archethic", diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb index 3a0999a69..348aa93b4 100644 --- a/lib/l10n/intl_fr.arb +++ b/lib/l10n/intl_fr.arb @@ -453,6 +453,8 @@ "aeBridgeHeader": "Bridge", "aeSwapEarnHeader": "Gagner des UCO", "price": "Prix", + "aeBridgeLaunchMessage": "Veuillez lancer l'application aeBridge pour continuer. Elle s'ouvrira dans votre navigateur par défaut", + "aeBridgeLaunchButton": "Lancer aeBridge", "dAppLaunchMessage": "L'application n'est pas disponible directement sur cette plateforme. Veuillez lancer l'application via un navigateur pour continuer. Elle s'ouvrira dans votre navigateur par défaut.", "dAppLaunchButton": "Lancer la dApp", "receiveHeader": "Recevoir des actifs sur Archethic", diff --git a/lib/ui/views/dapps_board/layouts/dapps_board_sheet.dart b/lib/ui/views/dapps_board/layouts/dapps_board_sheet.dart index b5f280df4..d49da5fd3 100644 --- a/lib/ui/views/dapps_board/layouts/dapps_board_sheet.dart +++ b/lib/ui/views/dapps_board/layouts/dapps_board_sheet.dart @@ -1,7 +1,6 @@ import 'dart:ui'; import 'package:aewallet/application/dapps.dart'; -import 'package:aewallet/application/settings/settings.dart'; import 'package:aewallet/modules/aeswap/ui/views/util/app_styles.dart'; import 'package:aewallet/ui/themes/archethic_theme.dart'; import 'package:aewallet/ui/views/main/components/sheet_appbar.dart'; @@ -52,11 +51,7 @@ class DAppsBoardSheet extends ConsumerWidget implements SheetSkeletonInterface { @override Widget getSheetContent(BuildContext context, WidgetRef ref) { - final networkSettings = ref.watch( - SettingsProviders.settings.select((settings) => settings.network), - ); - final dAppsFromNetwork = - ref.watch(getDAppsFromNetworkProvider(networkSettings.network)); + final dAppsFromNetwork = ref.watch(getDAppsFromNetworkProvider); return dAppsFromNetwork.when( data: (dApps) { diff --git a/lib/ui/views/sheets/dapp_sheet.dart b/lib/ui/views/sheets/dapp_sheet.dart index d679f5798..f062a8ad0 100755 --- a/lib/ui/views/sheets/dapp_sheet.dart +++ b/lib/ui/views/sheets/dapp_sheet.dart @@ -1,7 +1,6 @@ import 'package:aewallet/application/connectivity_status.dart'; import 'package:aewallet/application/dapps.dart'; import 'package:aewallet/application/feature_flags.dart'; -import 'package:aewallet/application/settings/settings.dart'; import 'package:aewallet/domain/models/dapp.dart'; import 'package:aewallet/infrastructure/rpc/awc_webview.dart'; import 'package:aewallet/ui/util/dimens.dart'; @@ -9,7 +8,6 @@ import 'package:aewallet/ui/views/sheets/bridge_sheet_feature_flag_false.dart'; import 'package:aewallet/ui/views/sheets/unavailable_feature_warning.dart'; import 'package:aewallet/ui/widgets/components/app_button_tiny.dart'; import 'package:aewallet/ui/widgets/components/loading_list_header.dart'; -import 'package:aewallet/ui/widgets/components/scrollbar.dart'; import 'package:aewallet/util/universal_platform.dart'; import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; @@ -19,17 +17,23 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:url_launcher/url_launcher.dart'; class DAppSheetIconRefresh extends ConsumerWidget { - factory DAppSheetIconRefresh({required String dappKey}) => + factory DAppSheetIconRefresh({ + required String dappKey, + String? featureCode, + }) => DAppSheetIconRefresh._( dappKey: dappKey, + featureCode: featureCode, key: Key(dappKey), ); const DAppSheetIconRefresh._({ required this.dappKey, + this.featureCode, super.key, }); final String dappKey; + final String? featureCode; @override Widget build(BuildContext context, WidgetRef ref) { @@ -41,7 +45,7 @@ class DAppSheetIconRefresh extends ConsumerWidget { ), onPressed: () async { final dapp = await ref.read( - DAppsProviders.getDApp(dappKey).future, + getDAppProvider(dappKey).future, ); if (dapp == null) return; final webviewController = @@ -56,20 +60,26 @@ class DAppSheetIconRefresh extends ConsumerWidget { } class DAppSheet extends ConsumerStatefulWidget { - factory DAppSheet({required String dappKey}) => DAppSheet._( + factory DAppSheet({ + required String dappKey, + String? featureCode, + }) => + DAppSheet._( dappKey: dappKey, + featureCode: featureCode, key: Key(dappKey), ); const DAppSheet._({ required this.dappKey, + this.featureCode, super.key, }); final String dappKey; + final String? featureCode; static bool get isAvailable => AWCWebview.isAvailable; - static const String routerPage = '/dex'; @override ConsumerState createState() => DAppSheetState(); @@ -78,6 +88,8 @@ class DAppSheet extends ConsumerStatefulWidget { class DAppSheetState extends ConsumerState with AutomaticKeepAliveClientMixin { String? dappUrl; + bool? featureFlags; + static const applicationCode = 'aeWallet'; @override bool get wantKeepAlive => true; @@ -89,24 +101,26 @@ class DAppSheetState extends ConsumerState if (!DAppSheet.isAvailable) dappKey = '${dappKey}Ext'; - final networkSettings = ref.watch( - SettingsProviders.settings.select((settings) => settings.network), - ); - - final bridgeFlag = await ref.watch( - getFeatureFlagProvider( - networkSettings.network, - applicationCode, - featureCode, - ).future, - ); - if (bridgeFlag == null || bridgeFlag == false) dappKey = '${dappKey}Ext'; + if (widget.featureCode != null) { + final _featureFlag = await ref.watch( + getFeatureFlagProvider( + applicationCode, + widget.featureCode!, + ).future, + ); + if (_featureFlag == null || _featureFlag == false) { + dappKey = '${dappKey}Ext'; + } + setState(() { + featureFlags = _featureFlag; + }); + } final connectivityStatusProvider = ref.watch(connectivityStatusProviders); DApp? dapp; if (connectivityStatusProvider == ConnectivityStatus.isConnected) { dapp = await ref.read( - DAppsProviders.getDApp(dappKey).future, + getDAppProvider(dappKey).future, ); setState(() { @@ -122,51 +136,73 @@ class DAppSheetState extends ConsumerState super.build(context); final localizations = AppLocalizations.of(context)!; - if (featureFlags != null && featureFlags == false) { + if (widget.featureCode == 'bridge' && + featureFlags != null && + featureFlags == false) { return const BridgeSheetFeatureFlagFalse(); } if (UniversalPlatform.isDesktopOrWeb) { - - return SafeArea( - child: Padding( - padding: const EdgeInsets.all(20), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - AppLocalizations.of(context)!.dAppLaunchMessage, - ), - SizedBox( - height: 55, - child: AppButtonTiny( - AppButtonTinyType.primary, - AppLocalizations.of(context)!.dAppLaunchButton, - Dimens.buttonBottomDimens, - key: const Key('LaunchApplication'), - onPressed: dappUrl != null - ? () async { - await launchUrl(Uri.parse(dappUrl!)); - } - : null, - disabled: dappUrl == null, - ), + return Stack( + children: [ + SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Column( + children: [ + aedappfm.ArchethicScrollbar( + child: Padding( + padding: EdgeInsets.only( + top: MediaQuery.of(context).padding.top + 10, + bottom: 80, + ), + child: Padding( + padding: const EdgeInsets.only(top: 10), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.featureCode == 'bridge' + ? AppLocalizations.of(context)! + .aeBridgeLaunchMessage + : AppLocalizations.of(context)! + .dAppLaunchMessage, + ), + ], + ), + ], + ), + ), + ), + ), + ], ), - ], + ), ), - SizedBox( - height: 55, - child: AppButtonTiny( - AppButtonTinyType.primary, - AppLocalizations.of(context)!.aeSwapLaunchButton, - Dimens.buttonBottomDimens, - key: const Key('LaunchApplication'), - onPressed: dappUrl != null - ? () async { + Align( + alignment: Alignment.bottomCenter, + child: Padding( + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).padding.bottom + 20, + ), + child: Row( + children: [ + AppButtonTinyConnectivity( + widget.featureCode == 'bridge' + ? AppLocalizations.of(context)!.aeBridgeLaunchButton + : AppLocalizations.of(context)!.dAppLaunchButton, + Dimens.buttonBottomDimens, + key: const Key('LaunchApplication'), + onPressed: () async { await launchUrl(Uri.parse(dappUrl!)); - } - : null, - disabled: dappUrl == null, + }, + disabled: dappUrl == null, + ), + ], + ), ), ), ], @@ -187,10 +223,7 @@ class DAppSheetState extends ConsumerState future: AWCWebview.isAWCSupported, builder: (context, snapshot) { final isAWCSupported = snapshot.data; - if (isAWCSupported == null) { - return const Center(child: LoadingListHeader()); - } - if (dappUrl == null) { + if (isAWCSupported == null || dappUrl == null) { return const Center(child: LoadingListHeader()); }