diff --git a/lib/application/pool/dex_pool.g.dart b/lib/application/pool/dex_pool.g.dart index fe28c9fe..534ab147 100644 --- a/lib/application/pool/dex_pool.g.dart +++ b/lib/application/pool/dex_pool.g.dart @@ -1074,7 +1074,7 @@ class _EstimatePoolTVLInFiatProviderElement DexPool? get pool => (origin as _EstimatePoolTVLInFiatProvider).pool; } -String _$estimateStatsHash() => r'09cd7b1bd7b2e738365daea6d9e3ffd72c96d985'; +String _$estimateStatsHash() => r'890e53d17c258e234b5f378657bdfcd245377e07'; /// See also [_estimateStats]. @ProviderFor(_estimateStats) diff --git a/lib/application/session/provider.dart b/lib/application/session/provider.dart index d6e4d17c..6eaca996 100644 --- a/lib/application/session/provider.dart +++ b/lib/application/session/provider.dart @@ -4,6 +4,7 @@ import 'dart:async'; import 'package:aedex/application/dex_token.dart'; import 'package:aedex/application/pool/dex_pool.dart'; import 'package:aedex/application/session/state.dart'; +import 'package:aedex/infrastructure/hive/pools_list.hive.dart'; import 'package:aedex/infrastructure/hive/preferences.hive.dart'; import 'package:aedex/util/browser_util_desktop.dart' if (dart.library.js) 'package:aedex/util/browser_util_web.dart'; @@ -67,7 +68,6 @@ class _SessionNotifier extends Notifier { state = state.copyWith( isConnected: false, error: '', - endpoint: '', genesisAddress: '', nameAccount: '', ); @@ -89,6 +89,12 @@ class _SessionNotifier extends Notifier { _handleConnectionFailure(isBrave); }, success: (result) async { + if (state.endpoint != result.endpointUrl) { + final poolsListDatasource = + await HivePoolsListDatasource.getInstance(); + await poolsListDatasource.clearAll(); + } + state = state.copyWith( endpoint: result.endpointUrl, isConnected: true, @@ -175,7 +181,7 @@ class _SessionNotifier extends Notifier { }, ); } catch (e) { - if (forceConnection == false) { + if (forceConnection == true) { _handleConnectionFailure(isBrave); } } diff --git a/lib/application/session/provider.g.dart b/lib/application/session/provider.g.dart index 164de52b..059e787a 100644 --- a/lib/application/session/provider.g.dart +++ b/lib/application/session/provider.g.dart @@ -6,7 +6,7 @@ part of 'provider.dart'; // RiverpodGenerator // ************************************************************************** -String _$sessionNotifierHash() => r'd3de679d47b13e05f2a1b204b1de8d4a9f6a22e7'; +String _$sessionNotifierHash() => r'6589e9df875bb31cda189e17cbcf7237902fac38'; /// See also [_SessionNotifier]. @ProviderFor(_SessionNotifier) diff --git a/lib/application/session/state.dart b/lib/application/session/state.dart index ded750ec..af2c42bc 100644 --- a/lib/application/session/state.dart +++ b/lib/application/session/state.dart @@ -9,6 +9,8 @@ part 'state.freezed.dart'; @freezed class Session with _$Session { const factory Session({ + // TODO(reddwarf03): MAINNET + //@Default('mainnet') String envSelected, @Default('testnet') String envSelected, @Default('') String endpoint, @Default('') String nameAccount, diff --git a/lib/application/session/state.freezed.dart b/lib/application/session/state.freezed.dart index 8897107c..ec4bd26a 100644 --- a/lib/application/session/state.freezed.dart +++ b/lib/application/session/state.freezed.dart @@ -16,6 +16,8 @@ final _privateConstructorUsedError = UnsupportedError( /// @nodoc mixin _$Session { +// TODO(reddwarf03): MAINNET +//@Default('mainnet') String envSelected, String get envSelected => throw _privateConstructorUsedError; String get endpoint => throw _privateConstructorUsedError; String get nameAccount => throw _privateConstructorUsedError; @@ -225,6 +227,8 @@ class _$SessionImpl extends _Session { this.accountStreamSub}) : super._(); +// TODO(reddwarf03): MAINNET +//@Default('mainnet') String envSelected, @override @JsonKey() final String envSelected; @@ -313,7 +317,8 @@ abstract class _Session extends Session { final StreamSubscription? accountStreamSub}) = _$SessionImpl; const _Session._() : super._(); - @override + @override // TODO(reddwarf03): MAINNET +//@Default('mainnet') String envSelected, String get envSelected; @override String get endpoint; diff --git a/lib/ui/views/farm_claim/layouts/components/farm_claim_confirm_infos.dart b/lib/ui/views/farm_claim/layouts/components/farm_claim_confirm_infos.dart index 78c5a547..9fa07330 100755 --- a/lib/ui/views/farm_claim/layouts/components/farm_claim_confirm_infos.dart +++ b/lib/ui/views/farm_claim/layouts/components/farm_claim_confirm_infos.dart @@ -55,7 +55,16 @@ class FarmClaimConfirmInfos extends ConsumerWidget { children: [ TextSpan( text: 'Please confirm the claim of ', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), TextSpan( text: farmClaim.dexFarmUserInfo!.rewardAmount @@ -65,15 +74,38 @@ class FarmClaimConfirmInfos extends ConsumerWidget { .bodyLarge! .copyWith( color: aedappfm.AppThemeBase.secondaryColor, + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ), ), TextSpan( text: ' ${farmClaim.rewardToken!.symbol}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), TextSpan( text: ' ${snapshot.data} ', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ], ), @@ -99,11 +131,21 @@ class FarmClaimConfirmInfos extends ConsumerWidget { children: [ SelectableText( AppLocalizations.of(context)!.confirmBeforeLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( AppLocalizations.of(context)!.confirmAfterLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), diff --git a/lib/ui/views/farm_claim/layouts/components/farm_claim_form_sheet.dart b/lib/ui/views/farm_claim/layouts/components/farm_claim_form_sheet.dart index 5d1d2758..3ee34b86 100644 --- a/lib/ui/views/farm_claim/layouts/components/farm_claim_form_sheet.dart +++ b/lib/ui/views/farm_claim/layouts/components/farm_claim_form_sheet.dart @@ -4,6 +4,7 @@ import 'package:aedex/ui/views/farm_list/farm_list_sheet.dart'; import 'package:aedex/ui/views/util/components/failure_message.dart'; import 'package:aedex/ui/views/util/components/fiat_value.dart'; + import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; import 'package:flutter/material.dart'; @@ -90,22 +91,59 @@ class FarmClaimFormSheet extends ConsumerWidget { .copyWith( color: aedappfm .AppThemeBase.secondaryColor, + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyLarge!, + ), ), ), TextSpan( text: ' ${farmClaim.rewardToken!.symbol}', - style: - Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyLarge!, + ), + ), ), TextSpan( text: ' ${snapshot.data} ', - style: - Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyMedium!, + ), + ), ), TextSpan( text: 'are available for claiming.', - style: - Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyLarge!, + ), + ), ), ], ), @@ -130,6 +168,10 @@ class FarmClaimFormSheet extends ConsumerWidget { Expanded( child: aedappfm.ButtonValidate( controlOk: farmClaim.isControlsOk, + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), labelBtn: AppLocalizations.of(context)!.btn_farm_claim, onPressed: () => ref diff --git a/lib/ui/views/farm_deposit/layouts/components/farm_deposit_confirm_infos.dart b/lib/ui/views/farm_deposit/layouts/components/farm_deposit_confirm_infos.dart index 3e1b01e4..74e374d4 100755 --- a/lib/ui/views/farm_deposit/layouts/components/farm_deposit_confirm_infos.dart +++ b/lib/ui/views/farm_deposit/layouts/components/farm_deposit_confirm_infos.dart @@ -45,18 +45,32 @@ class FarmDepositConfirmInfos extends ConsumerWidget { children: [ TextSpan( text: 'Please confirm the deposit of ', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), TextSpan( text: farmDeposit.amount.formatNumber(precision: 8), style: Theme.of(context).textTheme.bodyLarge!.copyWith( color: aedappfm.AppThemeBase.secondaryColor, + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ), ), TextSpan( text: ' ${farmDeposit.amount > 1 ? 'LP Tokens' : 'LP Token'}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -68,7 +82,12 @@ class FarmDepositConfirmInfos extends ConsumerWidget { children: [ SelectableText( 'Your balance', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), const SizedBox( width: 5, @@ -88,11 +107,21 @@ class FarmDepositConfirmInfos extends ConsumerWidget { children: [ SelectableText( AppLocalizations.of(context)!.confirmBeforeLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( AppLocalizations.of(context)!.confirmAfterLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -126,7 +155,12 @@ class FarmDepositConfirmInfos extends ConsumerWidget { children: [ SelectableText( "Farm's balance", - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), const SizedBox( width: 5, @@ -146,11 +180,21 @@ class FarmDepositConfirmInfos extends ConsumerWidget { children: [ SelectableText( AppLocalizations.of(context)!.confirmBeforeLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( AppLocalizations.of(context)!.confirmAfterLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), diff --git a/lib/ui/views/farm_deposit/layouts/components/farm_deposit_form_sheet.dart b/lib/ui/views/farm_deposit/layouts/components/farm_deposit_form_sheet.dart index 8632c2a9..699a3ab7 100644 --- a/lib/ui/views/farm_deposit/layouts/components/farm_deposit_form_sheet.dart +++ b/lib/ui/views/farm_deposit/layouts/components/farm_deposit_form_sheet.dart @@ -91,6 +91,10 @@ class FarmDepositFormSheet extends ConsumerWidget { Expanded( child: aedappfm.ButtonValidate( controlOk: farmDeposit.isControlsOk, + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), labelBtn: AppLocalizations.of(context)! .btn_farm_deposit, onPressed: () => ref diff --git a/lib/ui/views/farm_deposit/layouts/components/farm_deposit_textfield_amount.dart b/lib/ui/views/farm_deposit/layouts/components/farm_deposit_textfield_amount.dart index 88669d75..a44686ca 100644 --- a/lib/ui/views/farm_deposit/layouts/components/farm_deposit_textfield_amount.dart +++ b/lib/ui/views/farm_deposit/layouts/components/farm_deposit_textfield_amount.dart @@ -166,7 +166,12 @@ class _FarmDepositToken1AmountState extends ConsumerState { ), style: Theme.of( context, - ).textTheme.bodyMedium, + ).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ], ), diff --git a/lib/ui/views/farm_list/components/balance_details.dart b/lib/ui/views/farm_list/components/balance_details.dart index a94a61a9..b4b8b9f1 100644 --- a/lib/ui/views/farm_list/components/balance_details.dart +++ b/lib/ui/views/farm_list/components/balance_details.dart @@ -29,7 +29,13 @@ class _BalanceDetails extends ConsumerWidget { 'Your available LP Tokens', style: Theme.of( context, - ).textTheme.bodyLarge, + ).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), if (balance == null) const Column( @@ -55,7 +61,13 @@ class _BalanceDetails extends ConsumerWidget { '${balance.formatNumber()} ${balance > 1 ? 'LP Tokens' : 'LP Token'}', style: Theme.of( context, - ).textTheme.bodyLarge, + ).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( DEXLPTokenFiatValue().display( @@ -67,7 +79,13 @@ class _BalanceDetails extends ConsumerWidget { ), style: Theme.of( context, - ).textTheme.bodyMedium, + ).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ], ), @@ -86,6 +104,10 @@ class _BalanceDetails extends ConsumerWidget { children: [ aedappfm.ButtonValidate( background: aedappfm.ArchethicThemeBase.purple500, + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), controlOk: balance != null && balance > 0, labelBtn: 'Deposit LP Tokens', onPressed: () { @@ -153,6 +175,10 @@ class _BalanceDetails extends ConsumerWidget { child: aedappfm.ButtonValidate( background: aedappfm.ArchethicThemeBase.purple500, controlOk: farm.lpTokenDeposited > 0, + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), labelBtn: 'Withdraw', onPressed: () { final farmAddressJson = jsonEncode(farm.farmAddress); @@ -220,6 +246,10 @@ class _BalanceDetails extends ConsumerWidget { child: aedappfm.ButtonValidate( background: aedappfm.ArchethicThemeBase.purple500, controlOk: farm.remainingReward > 0, + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), labelBtn: 'Claim', onPressed: () async { if (context.mounted) { diff --git a/lib/ui/views/farm_list/components/farm_details_back.dart b/lib/ui/views/farm_list/components/farm_details_back.dart index eeac46a5..a2e381c1 100755 --- a/lib/ui/views/farm_list/components/farm_details_back.dart +++ b/lib/ui/views/farm_list/components/farm_details_back.dart @@ -1,6 +1,7 @@ import 'package:aedex/domain/models/dex_farm.dart'; import 'package:aedex/ui/views/util/components/dex_pair_icons.dart'; import 'package:aedex/ui/views/util/components/fiat_value.dart'; + import 'package:aedex/ui/views/util/components/format_address_link_copy.dart'; import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; @@ -41,8 +42,18 @@ class FarmDetailsBack extends ConsumerWidget { children: [ SelectableText( '${farm.lpTokenPair!.token1.symbol}/${farm.lpTokenPair!.token2.symbol}', - style: - Theme.of(context).textTheme.headlineMedium, + style: Theme.of(context) + .textTheme + .headlineMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .headlineMedium!, + ), + ), ), Padding( padding: const EdgeInsets.only(bottom: 3), @@ -89,14 +100,29 @@ class FarmDetailsBack extends ConsumerWidget { children: [ SelectableText( 'Remaining reward', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ SelectableText( '${farm.remainingReward.formatNumber()} ${farm.rewardToken!.symbol}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), FutureBuilder( future: FiatValue().display( @@ -108,7 +134,18 @@ class FarmDetailsBack extends ConsumerWidget { if (snapshot.hasData) { return SelectableText( snapshot.data!, - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyMedium!, + ), + ), ); } return const SizedBox.shrink(); @@ -127,18 +164,42 @@ class FarmDetailsBack extends ConsumerWidget { children: [ SelectableText( 'LP Token deposited', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ SelectableText( '${farm.lpTokenDeposited.formatNumber()} ${farm.lpTokenDeposited > 1 ? 'LP Tokens' : 'LP Token'}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( '(\$${farm.estimateLPTokenInFiat.formatNumber(precision: 2)})', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ], ), @@ -152,11 +213,23 @@ class FarmDetailsBack extends ConsumerWidget { children: [ SelectableText( 'Nb deposit', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( farm.nbDeposit.toString(), - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -169,14 +242,29 @@ class FarmDetailsBack extends ConsumerWidget { children: [ SelectableText( 'Distributed rewards', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ SelectableText( '${farm.statsRewardDistributed.formatNumber(precision: 2)} ${farm.rewardToken!.symbol}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), FutureBuilder( future: FiatValue().display( @@ -188,7 +276,18 @@ class FarmDetailsBack extends ConsumerWidget { if (snapshot.hasData) { return SelectableText( snapshot.data!, - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyMedium!, + ), + ), ); } return const SizedBox.shrink(); diff --git a/lib/ui/views/farm_list/components/farm_details_front.dart b/lib/ui/views/farm_list/components/farm_details_front.dart index a4da4732..dc0813c7 100755 --- a/lib/ui/views/farm_list/components/farm_details_front.dart +++ b/lib/ui/views/farm_list/components/farm_details_front.dart @@ -43,8 +43,18 @@ class FarmDetailsFront extends ConsumerWidget { children: [ SelectableText( '${farm.lpTokenPair!.token1.symbol}/${farm.lpTokenPair!.token2.symbol}', - style: - Theme.of(context).textTheme.headlineMedium, + style: Theme.of(context) + .textTheme + .headlineMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .headlineMedium!, + ), + ), ), Padding( padding: const EdgeInsets.only(bottom: 3), @@ -71,7 +81,16 @@ class FarmDetailsFront extends ConsumerWidget { children: [ SelectableText( 'Current APR', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( '${(farm.apr * 100).formatNumber(precision: 4)}%', @@ -79,6 +98,13 @@ class FarmDetailsFront extends ConsumerWidget { .textTheme .headlineMedium! .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .headlineMedium!, + ), color: aedappfm.AppThemeBase.secondaryColor, ), @@ -95,7 +121,16 @@ class FarmDetailsFront extends ConsumerWidget { 'Earn ${farm.rewardToken!.symbol}', style: Theme.of(context) .textTheme - .headlineSmall, + .headlineSmall! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .headlineSmall!, + ), + ), ), const SizedBox( width: 10, @@ -128,18 +163,45 @@ class FarmDetailsFront extends ConsumerWidget { if (farm.startDate!.isAfter(DateTime.now())) SelectableText( 'Farm will start at', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ) else SelectableText( 'Farm started since', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( DateFormat.yMd( Localizations.localeOf(context).languageCode, ).add_Hm().format(farm.startDate!.toLocal()), - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -150,18 +212,45 @@ class FarmDetailsFront extends ConsumerWidget { if (farm.endDate!.isAfter(DateTime.now())) SelectableText( 'Farm ends at', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ) else SelectableText( 'Farm ended', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( DateFormat.yMd( Localizations.localeOf(context).languageCode, ).add_Hm().format(farm.endDate!.toLocal()), - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), diff --git a/lib/ui/views/farm_list/components/farm_details_user_info.dart b/lib/ui/views/farm_list/components/farm_details_user_info.dart index 94bc2386..2748b626 100755 --- a/lib/ui/views/farm_list/components/farm_details_user_info.dart +++ b/lib/ui/views/farm_list/components/farm_details_user_info.dart @@ -11,6 +11,7 @@ import 'package:aedex/ui/views/farm_withdraw/layouts/farm_withdraw_sheet.dart'; import 'package:aedex/ui/views/util/components/dex_lp_token_fiat_value.dart'; import 'package:aedex/ui/views/util/components/fiat_value.dart'; + import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; import 'package:flutter/material.dart'; @@ -53,7 +54,12 @@ class FarmDetailsUserInfo extends ConsumerWidget { 'Your deposited amount', style: Theme.of( context, - ).textTheme.bodyLarge, + ).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), if (userInfos == null) const Column( @@ -79,7 +85,13 @@ class FarmDetailsUserInfo extends ConsumerWidget { '${userInfos.depositedAmount.formatNumber()} ${userInfos.depositedAmount > 1 ? 'LP Tokens' : 'LP Token'}', style: Theme.of( context, - ).textTheme.bodyLarge, + ).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( DEXLPTokenFiatValue().display( @@ -89,7 +101,16 @@ class FarmDetailsUserInfo extends ConsumerWidget { userInfos.depositedAmount, farm.poolAddress, ), - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ], ), @@ -106,7 +127,12 @@ class FarmDetailsUserInfo extends ConsumerWidget { 'Your reward amount', style: Theme.of( context, - ).textTheme.bodyLarge, + ).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), if (userInfos == null) const Column( @@ -134,6 +160,11 @@ class FarmDetailsUserInfo extends ConsumerWidget { context, ).textTheme.bodyLarge!.copyWith( color: aedappfm.AppThemeBase.secondaryColor, + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ), ), const SizedBox( @@ -154,7 +185,16 @@ class FarmDetailsUserInfo extends ConsumerWidget { return SelectableText( fiatValue, - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ); }, ), diff --git a/lib/ui/views/farm_list/farm_list_sheet.dart b/lib/ui/views/farm_list/farm_list_sheet.dart index 6d7cca70..1eaa34c8 100755 --- a/lib/ui/views/farm_list/farm_list_sheet.dart +++ b/lib/ui/views/farm_list/farm_list_sheet.dart @@ -59,15 +59,19 @@ Widget _body(BuildContext context, WidgetRef ref) { error: (error, stacktrace) => const aedappfm.Loading(), loading: aedappfm.Loading.new, data: (farms) => GridView.builder( - gridDelegate: const aedappfm.SliverGridDelegateWithFixedSize( - crossAxisExtent: 500, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: MediaQuery.of(context).size.width >= 1500 + ? 3 + : aedappfm.Responsive.isDesktop(context) + ? 2 + : 1, mainAxisExtent: 640, crossAxisSpacing: 30, mainAxisSpacing: 10, ), - padding: const EdgeInsets.only( - left: 50, - right: 50, + padding: EdgeInsets.only( + left: aedappfm.Responsive.isDesktop(context) ? 50 : 5, + right: aedappfm.Responsive.isDesktop(context) ? 50 : 5, ), itemCount: farms.length, itemBuilder: (context, index) { diff --git a/lib/ui/views/farm_withdraw/layouts/components/farm_withdraw_confirm_infos.dart b/lib/ui/views/farm_withdraw/layouts/components/farm_withdraw_confirm_infos.dart index 366ec843..8edc7e86 100755 --- a/lib/ui/views/farm_withdraw/layouts/components/farm_withdraw_confirm_infos.dart +++ b/lib/ui/views/farm_withdraw/layouts/components/farm_withdraw_confirm_infos.dart @@ -49,18 +49,32 @@ class FarmWithdrawConfirmInfos extends ConsumerWidget { children: [ TextSpan( text: 'Please confirm the withdraw of ', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), TextSpan( text: farmWithdraw.amount.formatNumber(precision: 8), style: Theme.of(context).textTheme.bodyLarge!.copyWith( color: aedappfm.AppThemeBase.secondaryColor, + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ), ), TextSpan( text: ' ${farmWithdraw.amount > 1 ? 'LP Tokens' : 'LP Token'}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -72,7 +86,12 @@ class FarmWithdrawConfirmInfos extends ConsumerWidget { children: [ SelectableText( 'Your balance', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), const SizedBox( width: 5, @@ -92,11 +111,21 @@ class FarmWithdrawConfirmInfos extends ConsumerWidget { children: [ SelectableText( AppLocalizations.of(context)!.confirmBeforeLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( AppLocalizations.of(context)!.confirmAfterLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -148,7 +177,12 @@ class FarmWithdrawConfirmInfos extends ConsumerWidget { children: [ SelectableText( "Farm's balance", - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), const SizedBox( width: 5, @@ -168,11 +202,21 @@ class FarmWithdrawConfirmInfos extends ConsumerWidget { children: [ SelectableText( AppLocalizations.of(context)!.confirmBeforeLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( AppLocalizations.of(context)!.confirmAfterLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -207,7 +251,12 @@ class FarmWithdrawConfirmInfos extends ConsumerWidget { children: [ SelectableText( 'Rewards', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), const SizedBox( width: 5, @@ -235,7 +284,16 @@ class FarmWithdrawConfirmInfos extends ConsumerWidget { children: [ TextSpan( text: 'You will receive ', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), TextSpan( text: farmWithdraw.dexFarmUserInfo!.rewardAmount @@ -245,16 +303,39 @@ class FarmWithdrawConfirmInfos extends ConsumerWidget { .bodyLarge! .copyWith( color: aedappfm.AppThemeBase.secondaryColor, + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ), ), TextSpan( text: ' ${farmWithdraw.dexFarmInfo!.rewardToken!.symbol} ', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), TextSpan( text: '${snapshot.data}', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ], ), diff --git a/lib/ui/views/farm_withdraw/layouts/components/farm_withdraw_form_sheet.dart b/lib/ui/views/farm_withdraw/layouts/components/farm_withdraw_form_sheet.dart index 7f01d267..53d5cbd0 100644 --- a/lib/ui/views/farm_withdraw/layouts/components/farm_withdraw_form_sheet.dart +++ b/lib/ui/views/farm_withdraw/layouts/components/farm_withdraw_form_sheet.dart @@ -73,7 +73,13 @@ class FarmWithdrawFormSheet extends ConsumerWidget { children: [ SelectableText( 'You can withdraw all or part of your deposited LP tokens. At the same time, this will claim your rewards.', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), FutureBuilder( future: FiatValue().display( @@ -87,15 +93,48 @@ class FarmWithdrawFormSheet extends ConsumerWidget { children: [ SelectableText( '${farmWithdraw.dexFarmUserInfo!.rewardAmount.formatNumber()} ${farmWithdraw.dexFarmInfo!.rewardToken!.symbol} ', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyLarge!, + ), + ), ), SelectableText( '${snapshot.data}', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyMedium!, + ), + ), ), SelectableText( ' are available for claiming.', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyLarge!, + ), + ), ), ], ); @@ -124,6 +163,10 @@ class FarmWithdrawFormSheet extends ConsumerWidget { controlOk: farmWithdraw.isControlsOk, labelBtn: AppLocalizations.of(context)! .btn_farm_withdraw, + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), onPressed: () => ref .read( FarmWithdrawFormProvider diff --git a/lib/ui/views/farm_withdraw/layouts/components/farm_withdraw_textfield_amount.dart b/lib/ui/views/farm_withdraw/layouts/components/farm_withdraw_textfield_amount.dart index b6a7e3d2..639633a5 100644 --- a/lib/ui/views/farm_withdraw/layouts/components/farm_withdraw_textfield_amount.dart +++ b/lib/ui/views/farm_withdraw/layouts/components/farm_withdraw_textfield_amount.dart @@ -158,7 +158,12 @@ class _FarmWithdrawToken1AmountState extends ConsumerState { farmWithdraw.dexFarmUserInfo!.depositedAmount, farmWithdraw.dexFarmInfo!.poolAddress, ), - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ], ), diff --git a/lib/ui/views/liquidity_add/layouts/components/liquidity_add_confirm_infos.dart b/lib/ui/views/liquidity_add/layouts/components/liquidity_add_confirm_infos.dart index d9871159..c32bb4d2 100755 --- a/lib/ui/views/liquidity_add/layouts/components/liquidity_add_confirm_infos.dart +++ b/lib/ui/views/liquidity_add/layouts/components/liquidity_add_confirm_infos.dart @@ -45,11 +45,21 @@ class LiquidityAddConfirmInfos extends ConsumerWidget { children: [ SelectableText( 'Add liquidity in the pool', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( 'Mininum amount', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -72,12 +82,26 @@ class LiquidityAddConfirmInfos extends ConsumerWidget { .copyWith( color: aedappfm.AppThemeBase.secondaryColor, + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ), ), TextSpan( text: ' ${liquidityAdd.token1!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -89,7 +113,12 @@ class LiquidityAddConfirmInfos extends ConsumerWidget { message: liquidityAdd.token1!.symbol, child: SelectableText( '${liquidityAdd.token1minAmount.formatNumber()} ${liquidityAdd.token1!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ], @@ -103,13 +132,27 @@ class LiquidityAddConfirmInfos extends ConsumerWidget { '${liquidityAdd.token2Amount}', style: Theme.of(context).textTheme.bodyLarge!.copyWith( color: aedappfm.AppThemeBase.secondaryColor, + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ), ), Tooltip( message: liquidityAdd.token2!.symbol, child: SelectableText( ' ${liquidityAdd.token2!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ], @@ -118,7 +161,12 @@ class LiquidityAddConfirmInfos extends ConsumerWidget { message: liquidityAdd.token2!.symbol, child: SelectableText( '+${liquidityAdd.token2minAmount.formatNumber()} ${liquidityAdd.token2!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ], @@ -140,11 +188,21 @@ class LiquidityAddConfirmInfos extends ConsumerWidget { children: [ SelectableText( AppLocalizations.of(context)!.confirmBeforeLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( AppLocalizations.of(context)!.confirmAfterLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -214,13 +272,22 @@ class LiquidityAddConfirmInfos extends ConsumerWidget { '+${liquidityAdd.expectedTokenLP.formatNumber()} ', style: Theme.of(context).textTheme.bodyLarge!.copyWith( color: aedappfm.AppThemeBase.secondaryColor, + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ), ), SelectableText( liquidityAdd.expectedTokenLP > 1 ? 'LP Tokens expected' : 'LP Token expected', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -229,11 +296,21 @@ class LiquidityAddConfirmInfos extends ConsumerWidget { children: [ SelectableText( AppLocalizations.of(context)!.confirmBeforeLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( AppLocalizations.of(context)!.confirmAfterLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), diff --git a/lib/ui/views/liquidity_add/layouts/components/liquidity_add_form_sheet.dart b/lib/ui/views/liquidity_add/layouts/components/liquidity_add_form_sheet.dart index 756b40b0..6070ffe5 100644 --- a/lib/ui/views/liquidity_add/layouts/components/liquidity_add_form_sheet.dart +++ b/lib/ui/views/liquidity_add/layouts/components/liquidity_add_form_sheet.dart @@ -9,6 +9,7 @@ import 'package:aedex/ui/views/pool_list/pool_list_sheet.dart'; import 'package:aedex/ui/views/util/components/dex_token_infos.dart'; import 'package:aedex/ui/views/util/components/failure_message.dart'; import 'package:aedex/ui/views/util/components/fiat_value.dart'; + import 'package:aedex/ui/views/util/components/pool_info_card.dart'; import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; @@ -81,7 +82,16 @@ class LiquidityAddFormSheet extends ConsumerWidget { children: [ SelectableText( '${AppLocalizations.of(context)!.slippage_tolerance} ${liquidityAdd.slippageTolerance}%', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), const Align( alignment: Alignment.centerRight, @@ -223,6 +233,10 @@ class LiquidityAddFormSheet extends ConsumerWidget { controlOk: liquidityAdd.isControlsOk, labelBtn: AppLocalizations.of(context)! .btn_liquidity_add, + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), onPressed: () => ref .read( LiquidityAddFormProvider diff --git a/lib/ui/views/liquidity_add/layouts/components/liquidity_add_infos.dart b/lib/ui/views/liquidity_add/layouts/components/liquidity_add_infos.dart index 3842cf61..a62b6b79 100755 --- a/lib/ui/views/liquidity_add/layouts/components/liquidity_add_infos.dart +++ b/lib/ui/views/liquidity_add/layouts/components/liquidity_add_infos.dart @@ -1,4 +1,5 @@ import 'package:aedex/ui/views/liquidity_add/bloc/provider.dart'; + import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; import 'package:flutter/material.dart'; @@ -32,7 +33,12 @@ class LiquidityAddInfos extends ConsumerWidget { message: liquidityAdd.token1!.symbol, child: SelectableText( 'Mininum amount for ${liquidityAdd.token1!.symbol.reduceSymbol()}: ', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ), const SizedBox( @@ -51,7 +57,12 @@ class LiquidityAddInfos extends ConsumerWidget { message: liquidityAdd.token2!.symbol, child: SelectableText( 'Mininum amount for ${liquidityAdd.token2!.symbol.reduceSymbol()}: ', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ), const SizedBox( @@ -68,7 +79,12 @@ class LiquidityAddInfos extends ConsumerWidget { children: [ SelectableText( 'Expected LP Token', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), const SizedBox( height: 5, @@ -93,14 +109,24 @@ class LiquidityAddInfos extends ConsumerWidget { message: liquidityAdd.token1!.symbol, child: SelectableText( 'Mininum amount for ${liquidityAdd.token1!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ), Tooltip( message: liquidityAdd.token1!.symbol, child: SelectableText( '${liquidityAdd.token1minAmount.formatNumber()} ${liquidityAdd.token1!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ), ], @@ -112,14 +138,24 @@ class LiquidityAddInfos extends ConsumerWidget { message: liquidityAdd.token2!.symbol, child: SelectableText( 'Mininum amount for ${liquidityAdd.token2!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ), Tooltip( message: liquidityAdd.token2!.symbol, child: SelectableText( '${liquidityAdd.token2minAmount.formatNumber()} ${liquidityAdd.token2!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ), ], @@ -129,11 +165,21 @@ class LiquidityAddInfos extends ConsumerWidget { children: [ SelectableText( 'Expected LP Token', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), SelectableText( '${liquidityAdd.expectedTokenLP.formatNumber()} ${liquidityAdd.expectedTokenLP > 1 ? 'LP Tokens' : 'LP Token'}', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ], ), diff --git a/lib/ui/views/liquidity_add/layouts/components/liquidity_add_settings_slippage_tolerance.dart b/lib/ui/views/liquidity_add/layouts/components/liquidity_add_settings_slippage_tolerance.dart index 7f9f9dd7..e9274303 100644 --- a/lib/ui/views/liquidity_add/layouts/components/liquidity_add_settings_slippage_tolerance.dart +++ b/lib/ui/views/liquidity_add/layouts/components/liquidity_add_settings_slippage_tolerance.dart @@ -59,7 +59,12 @@ class LiquiditySettingsSlippageToleranceState children: [ TextSpan( text: AppLocalizations.of(context)!.slippage_tolerance, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -107,7 +112,12 @@ class LiquiditySettingsSlippageToleranceState padding: const EdgeInsets.only(left: 5), child: SelectableText( '%', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ], @@ -118,6 +128,10 @@ class LiquiditySettingsSlippageToleranceState (double.tryParse(slippageToleranceController.text)! >= 0 && double.tryParse(slippageToleranceController.text)! < 100), labelBtn: AppLocalizations.of(context)!.btn_save, + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), onPressed: () { liquidityAddNotifier.setSlippageTolerance( double.tryParse(slippageToleranceController.text) ?? 0, diff --git a/lib/ui/views/liquidity_remove/layouts/components/liquidity_remove_confirm_infos.dart b/lib/ui/views/liquidity_remove/layouts/components/liquidity_remove_confirm_infos.dart index e54542f9..77b18563 100755 --- a/lib/ui/views/liquidity_remove/layouts/components/liquidity_remove_confirm_infos.dart +++ b/lib/ui/views/liquidity_remove/layouts/components/liquidity_remove_confirm_infos.dart @@ -46,20 +46,34 @@ class LiquidityRemoveConfirmInfos extends ConsumerWidget { children: [ TextSpan( text: 'Please, confirm the removal of ', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), TextSpan( text: '${liquidityRemove.lpTokenAmount.formatNumber(precision: 8)} ', style: Theme.of(context).textTheme.bodyLarge!.copyWith( color: aedappfm.AppThemeBase.secondaryColor, + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ), ), TextSpan( text: liquidityRemove.lpTokenAmount > 1 ? 'LP Tokens from the liquidity pool.' : 'LP Token from the liquidity pool.', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -81,11 +95,21 @@ class LiquidityRemoveConfirmInfos extends ConsumerWidget { children: [ SelectableText( AppLocalizations.of(context)!.confirmBeforeLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( AppLocalizations.of(context)!.confirmAfterLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -158,11 +182,21 @@ class LiquidityRemoveConfirmInfos extends ConsumerWidget { children: [ SelectableText( AppLocalizations.of(context)!.confirmBeforeLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( AppLocalizations.of(context)!.confirmAfterLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), diff --git a/lib/ui/views/liquidity_remove/layouts/components/liquidity_remove_form_sheet.dart b/lib/ui/views/liquidity_remove/layouts/components/liquidity_remove_form_sheet.dart index 906e1de3..760c9e92 100644 --- a/lib/ui/views/liquidity_remove/layouts/components/liquidity_remove_form_sheet.dart +++ b/lib/ui/views/liquidity_remove/layouts/components/liquidity_remove_form_sheet.dart @@ -98,6 +98,10 @@ class LiquidityRemoveFormSheet extends ConsumerWidget { controlOk: liquidityRemove.isControlsOk, labelBtn: AppLocalizations.of(context)! .btn_liquidity_remove, + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), onPressed: () => ref .read( LiquidityRemoveFormProvider diff --git a/lib/ui/views/liquidity_remove/layouts/components/liquidity_remove_lp_tokens_get_back.dart b/lib/ui/views/liquidity_remove/layouts/components/liquidity_remove_lp_tokens_get_back.dart index a7bca3be..6d9f40b2 100755 --- a/lib/ui/views/liquidity_remove/layouts/components/liquidity_remove_lp_tokens_get_back.dart +++ b/lib/ui/views/liquidity_remove/layouts/components/liquidity_remove_lp_tokens_get_back.dart @@ -1,6 +1,7 @@ /// SPDX-License-Identifier: AGPL-3.0-or-later import 'package:aedex/ui/views/liquidity_remove/bloc/provider.dart'; import 'package:aedex/ui/views/util/components/fiat_value.dart'; + import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; import 'package:flutter/material.dart'; @@ -27,14 +28,24 @@ class LiquidityRemoveTokensGetBack extends ConsumerWidget { children: [ SelectableText( AppLocalizations.of(context)!.liquidityRemoveTokensGetBackHeader, - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( liquidityRemove.token1!.symbol, - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), overflow: TextOverflow.visible, textAlign: TextAlign.end, ), @@ -42,7 +53,12 @@ class LiquidityRemoveTokensGetBack extends ConsumerWidget { children: [ SelectableText( '+ ${liquidityRemove.token1AmountGetBack.formatNumber(precision: 8)} ${liquidityRemove.token1!.symbol}', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), textAlign: TextAlign.end, ), const SizedBox( @@ -60,7 +76,16 @@ class LiquidityRemoveTokensGetBack extends ConsumerWidget { if (snapshot.hasData) { return SelectableText( snapshot.data!, - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ); } return const SizedBox.shrink(); @@ -75,7 +100,12 @@ class LiquidityRemoveTokensGetBack extends ConsumerWidget { children: [ Text( liquidityRemove.token2!.symbol, - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), overflow: TextOverflow.visible, textAlign: TextAlign.end, ), @@ -83,7 +113,12 @@ class LiquidityRemoveTokensGetBack extends ConsumerWidget { children: [ SelectableText( '+ ${liquidityRemove.token2AmountGetBack.formatNumber(precision: 8)} ${liquidityRemove.token2!.symbol}', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), textAlign: TextAlign.end, ), const SizedBox( @@ -101,7 +136,16 @@ class LiquidityRemoveTokensGetBack extends ConsumerWidget { if (snapshot.hasData) { return SelectableText( snapshot.data!, - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ); } return const SizedBox.shrink(); diff --git a/lib/ui/views/main_screen/layouts/app_bar.dart b/lib/ui/views/main_screen/layouts/app_bar.dart index 590771ab..7663b733 100644 --- a/lib/ui/views/main_screen/layouts/app_bar.dart +++ b/lib/ui/views/main_screen/layouts/app_bar.dart @@ -4,6 +4,7 @@ import 'package:aedex/application/session/provider.dart'; import 'package:aedex/ui/views/main_screen/layouts/connection_to_wallet_status.dart'; import 'package:aedex/ui/views/main_screen/layouts/header.dart'; import 'package:aedex/ui/views/main_screen/layouts/privacy_popup.dart'; + import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; import 'package:flutter/material.dart'; @@ -381,7 +382,16 @@ class _AppBarMainScreenState extends ConsumerState { .connectionWalletDisconnectWarning, style: Theme.of(context) .textTheme - .bodyMedium, + .bodyMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyMedium!, + ), + ), ), ), const SizedBox( @@ -406,6 +416,11 @@ class _AppBarMainScreenState extends ConsumerState { ), ), aedappfm.AppButton( + fontSize: aedappfm.Responsive + .fontSizeFromValue( + context, + desktopValue: 16, + ), labelBtn: AppLocalizations.of(context)! .yes, diff --git a/lib/ui/views/main_screen/layouts/browser_popup.dart b/lib/ui/views/main_screen/layouts/browser_popup.dart index 21f32d66..95023a60 100644 --- a/lib/ui/views/main_screen/layouts/browser_popup.dart +++ b/lib/ui/views/main_screen/layouts/browser_popup.dart @@ -51,7 +51,13 @@ class BrowserPopup extends ConsumerWidget { options: const LinkifyOptions( humanize: false, ), - linkStyle: const TextStyle(color: Colors.white), + linkStyle: TextStyle( + color: Colors.white, + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), onOpen: (link) async { final uri = Uri.parse(link.url); if (!await canLaunchUrl(uri)) return; @@ -61,6 +67,10 @@ class BrowserPopup extends ConsumerWidget { ), const SizedBox(height: 40), aedappfm.AppButton( + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), labelBtn: AppLocalizations.of(context)!.btn_understand, onPressed: () async { if (!context.mounted) return; diff --git a/lib/ui/views/main_screen/layouts/connection_to_wallet_status.dart b/lib/ui/views/main_screen/layouts/connection_to_wallet_status.dart index ba758928..59497430 100755 --- a/lib/ui/views/main_screen/layouts/connection_to_wallet_status.dart +++ b/lib/ui/views/main_screen/layouts/connection_to_wallet_status.dart @@ -3,6 +3,7 @@ import 'package:aedex/application/notification.dart'; import 'package:aedex/application/session/provider.dart'; import 'package:aedex/ui/views/notifications/layouts/tasks_notification_widget.dart'; import 'package:aedex/ui/views/swap/layouts/swap_sheet.dart'; +import 'package:aedex/ui/views/util/components/dex_env.dart'; import 'package:aedex/ui/views/util/components/format_address_link_copy.dart'; import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; @@ -46,33 +47,46 @@ class _ConnectionToWalletStatusState } if (session.isConnected == false) { - return IconButton( - onPressed: () async { - final sessionNotifier = ref.watch(SessionProviders.session.notifier); - await sessionNotifier.connectToWallet(); - if (ref.read(SessionProviders.session).error.isNotEmpty) { - if (!context.mounted) return; - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - backgroundColor: - Theme.of(context).snackBarTheme.backgroundColor, - content: SelectableText( - ref.read(SessionProviders.session).error, - style: Theme.of(context).snackBarTheme.contentTextStyle, + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + InkWell( + onTap: () async { + final sessionNotifier = + ref.watch(SessionProviders.session.notifier); + await sessionNotifier.connectToWallet(); + if (ref.read(SessionProviders.session).error.isNotEmpty) { + if (!context.mounted) return; + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + backgroundColor: + Theme.of(context).snackBarTheme.backgroundColor, + content: SelectableText( + ref.read(SessionProviders.session).error, + style: Theme.of(context).snackBarTheme.contentTextStyle, + ), + duration: const Duration(seconds: 2), + ), + ); + } + }, + child: ShaderMask( + blendMode: BlendMode.srcIn, + shaderCallback: (bounds) => + aedappfm.AppThemeBase.gradientWelcomeTxt.createShader( + Rect.fromLTWH(0, 0, bounds.width, bounds.height), + ), + child: Text( + AppLocalizations.of(context)!.btn_connect_wallet, + style: const TextStyle( + fontSize: 16, ), - duration: const Duration(seconds: 2), ), - ); - } - }, - icon: aedappfm.GradientText( - AppLocalizations.of(context)!.btn_connect_wallet, - gradient: aedappfm.AppThemeBase.gradientWelcomeTxt, - style: const TextStyle( - fontSize: 8, + ), ), - selectable: false, - ), + const DexEnv(), + ], ); } @@ -123,8 +137,10 @@ class _ConnectionToWalletStatusState address: session.genesisAddress.toUpperCase(), typeAddress: TypeAddressLinkCopy.chain, reduceAddress: true, + fontSize: 12, ), ), + const DexEnv(), ], ), const SizedBox( diff --git a/lib/ui/views/main_screen/layouts/header.dart b/lib/ui/views/main_screen/layouts/header.dart index 508e110a..ba68d293 100644 --- a/lib/ui/views/main_screen/layouts/header.dart +++ b/lib/ui/views/main_screen/layouts/header.dart @@ -24,49 +24,62 @@ class Header extends ConsumerWidget { return Stack( children: [ - Positioned( - top: 40, - left: 65, - child: SelectableText( - 'Decentralized Exchange', - style: TextStyle( - fontSize: 10.5, - color: aedappfm.ArchethicThemeBase.neutral0, + if (aedappfm.Responsive.isMobile(context) == false) + Positioned( + top: 40, + left: 65, + child: SelectableText( + 'Decentralized Exchange', + style: TextStyle( + fontSize: 10.5, + color: aedappfm.ArchethicThemeBase.neutral0, + ), ), ), - ), Row( children: [ const SizedBox( width: 16, ), - Padding( - padding: const EdgeInsets.only(top: 8), - child: SvgPicture.asset( - 'assets/images/AELogo.svg', - height: 34, + if (aedappfm.Responsive.isMobile(context) == false) + Padding( + padding: const EdgeInsets.only(top: 8), + child: SvgPicture.asset( + 'assets/images/AELogo.svg', + height: 34, + ), + ) + else + Padding( + padding: const EdgeInsets.only(top: 16, left: 5), + child: SvgPicture.asset( + 'assets/images/AELogo.svg', + height: 24, + ), ), - ), - const SizedBox( - width: 8, - ), - Padding( - padding: const EdgeInsets.only(bottom: 7), - child: SelectableText( - 'aeSwap', - style: TextStyle( - fontSize: 33, - color: aedappfm.ArchethicThemeBase.neutral0, + if (aedappfm.Responsive.isMobile(context) == false) + const SizedBox( + width: 8, + ), + if (aedappfm.Responsive.isMobile(context) == false) + Padding( + padding: const EdgeInsets.only(bottom: 7), + child: SelectableText( + 'aeSwap', + style: TextStyle( + fontSize: 33, + color: aedappfm.ArchethicThemeBase.neutral0, + ), ), ), - ), - Padding( - padding: const EdgeInsets.only(left: 5, bottom: 26), - child: SelectableText( - 'Beta', - style: Theme.of(context).textTheme.labelMedium, + if (aedappfm.Responsive.isMobile(context) == false) + Padding( + padding: const EdgeInsets.only(left: 5, bottom: 26), + child: SelectableText( + 'Beta', + style: Theme.of(context).textTheme.labelMedium, + ), ), - ), if (withMenu && aedappfm.Responsive.isMobile(context) == false && aedappfm.Responsive.isTablet(context) == false) diff --git a/lib/ui/views/main_screen/layouts/main_screen_list.dart b/lib/ui/views/main_screen/layouts/main_screen_list.dart index 28d8f6ee..a257e48c 100644 --- a/lib/ui/views/main_screen/layouts/main_screen_list.dart +++ b/lib/ui/views/main_screen/layouts/main_screen_list.dart @@ -7,7 +7,6 @@ import 'package:aedex/ui/views/main_screen/layouts/app_bar.dart'; import 'package:aedex/ui/views/main_screen/layouts/bottom_navigation_bar.dart'; import 'package:aedex/ui/views/main_screen/layouts/browser_popup.dart'; import 'package:aedex/ui/views/main_screen/layouts/privacy_popup.dart'; -import 'package:aedex/ui/views/util/components/dex_env.dart'; import 'package:aedex/ui/views/util/components/dex_main_menu_app.dart'; import 'package:aedex/util/browser_util_desktop.dart' if (dart.library.js) 'package:aedex/util/browser_util_web.dart'; @@ -110,29 +109,20 @@ class MainScreenListState extends ConsumerState { ), ), body: Stack( - alignment: Alignment.topRight, + alignment: Alignment.center, children: [ - Stack( - alignment: Alignment.center, - children: [ - const aedappfm.AppBackground( - backgroundImage: 'assets/images/background-welcome.png', - ), - widget.body - .animate() - .fade( - duration: const Duration(milliseconds: 200), - ) - .scale( - duration: const Duration(milliseconds: 200), - ), - if (_isSubMenuOpen) const DexMainMenuApp(), - ], - ), - const Padding( - padding: EdgeInsets.only(top: 80, right: 20), - child: DexEnv(), + const aedappfm.AppBackground( + backgroundImage: 'assets/images/background-welcome.png', ), + widget.body + .animate() + .fade( + duration: const Duration(milliseconds: 200), + ) + .scale( + duration: const Duration(milliseconds: 200), + ), + if (_isSubMenuOpen) const DexMainMenuApp(), ], ), bottomNavigationBar: aedappfm.Responsive.isMobile(context) || diff --git a/lib/ui/views/main_screen/layouts/main_screen_sheet.dart b/lib/ui/views/main_screen/layouts/main_screen_sheet.dart index 59a51c4f..20e39843 100644 --- a/lib/ui/views/main_screen/layouts/main_screen_sheet.dart +++ b/lib/ui/views/main_screen/layouts/main_screen_sheet.dart @@ -7,7 +7,6 @@ import 'package:aedex/ui/views/main_screen/layouts/app_bar.dart'; import 'package:aedex/ui/views/main_screen/layouts/bottom_navigation_bar.dart'; import 'package:aedex/ui/views/main_screen/layouts/browser_popup.dart'; import 'package:aedex/ui/views/main_screen/layouts/privacy_popup.dart'; -import 'package:aedex/ui/views/util/components/dex_env.dart'; import 'package:aedex/ui/views/util/components/dex_main_menu_app.dart'; import 'package:aedex/util/browser_util_desktop.dart' if (dart.library.js) 'package:aedex/util/browser_util_web.dart'; @@ -119,79 +118,70 @@ class MainScreenSheetState extends ConsumerState { ), ), body: Stack( - alignment: Alignment.topRight, + alignment: Alignment.center, children: [ - Stack( - alignment: Alignment.center, - children: [ - const aedappfm.AppBackground( - backgroundImage: 'assets/images/background-welcome.png', - ), - Align( - child: ClipRRect( - borderRadius: BorderRadius.circular(20), - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - width: 650, - decoration: BoxDecoration( - color: aedappfm.AppThemeBase.sheetBackground, - border: Border.all( - color: aedappfm.AppThemeBase.sheetBorder, - ), - borderRadius: BorderRadius.circular(20), - ), - child: Padding( - padding: const EdgeInsets.only( - left: 30, - right: 30, - top: 11, - bottom: 5, - ), - child: LayoutBuilder( - builder: (context, constraint) { - return aedappfm.ArchethicScrollbar( - child: Container( - constraints: BoxConstraints( - minHeight: 100, - maxHeight: constraint.maxHeight, - ), - child: IntrinsicHeight( - child: Column( - children: [ - if (widget.currentStep == - aedappfm.ProcessStep.form) - widget.formSheet - else - widget.confirmSheet, - if (widget.bottomWidget != null) - widget.bottomWidget!, - ], - ), - ), + const aedappfm.AppBackground( + backgroundImage: 'assets/images/background-welcome.png', + ), + Align( + child: ClipRRect( + borderRadius: BorderRadius.circular(20), + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), + child: Container( + width: 650, + decoration: BoxDecoration( + color: aedappfm.AppThemeBase.sheetBackground, + border: Border.all( + color: aedappfm.AppThemeBase.sheetBorder, + ), + borderRadius: BorderRadius.circular(20), + ), + child: Padding( + padding: const EdgeInsets.only( + left: 30, + right: 30, + top: 11, + bottom: 5, + ), + child: LayoutBuilder( + builder: (context, constraint) { + return aedappfm.ArchethicScrollbar( + child: Container( + constraints: BoxConstraints( + minHeight: 100, + maxHeight: constraint.maxHeight, + ), + child: IntrinsicHeight( + child: Column( + children: [ + if (widget.currentStep == + aedappfm.ProcessStep.form) + widget.formSheet + else + widget.confirmSheet, + if (widget.bottomWidget != null) + widget.bottomWidget!, + ], ), - ); - }, - ), - ), + ), + ), + ); + }, ), ), ), + ), + ), + ) + .animate() + .fade( + duration: const Duration(milliseconds: 200), ) - .animate() - .fade( - duration: const Duration(milliseconds: 200), - ) - .scale( - duration: const Duration(milliseconds: 200), - ), - if (_isSubMenuOpen) const DexMainMenuApp(), - ], - ), - const Padding( - padding: EdgeInsets.only(top: 80, right: 20), - child: DexEnv(), - ), + .scale( + duration: const Duration(milliseconds: 200), + ), + if (_isSubMenuOpen) const DexMainMenuApp(), ], ), bottomNavigationBar: aedappfm.Responsive.isMobile(context) || diff --git a/lib/ui/views/main_screen/layouts/privacy_popup.dart b/lib/ui/views/main_screen/layouts/privacy_popup.dart index 875d767b..4436cee5 100644 --- a/lib/ui/views/main_screen/layouts/privacy_popup.dart +++ b/lib/ui/views/main_screen/layouts/privacy_popup.dart @@ -1,6 +1,7 @@ import 'dart:ui'; import 'package:aedex/application/preferences.dart'; + import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; import 'package:flutter/material.dart'; @@ -41,27 +42,57 @@ class PrivacyPopup extends ConsumerWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - const SelectableText('Information - Testnet'), + SelectableText( + 'Information - Testnet', + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), + ), const SizedBox(height: 40), - const SelectableText( + SelectableText( 'During the testnet phase, Archethic collects logs, both functional and technical, to analyze anomalies in the Apps operation.', + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), const SizedBox(height: 20), - const SelectableText( + SelectableText( 'These logs may contain information related to the transactions performed but do not in any way allow us to alter or interfere with the transactions. These logs do not contain sensitive information such as seed or private keys.', + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), const SizedBox(height: 20), - const Text.rich( + Text.rich( TextSpan( - style: TextStyle( + style: const TextStyle( fontSize: 14, ), children: [ TextSpan( text: 'You can disable or activate logs when you want in the info menu ', + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), - WidgetSpan( + const WidgetSpan( child: Icon( Icons.info_outlined, size: 14, @@ -72,6 +103,10 @@ class PrivacyPopup extends ConsumerWidget { ), const SizedBox(height: 40), aedappfm.AppButton( + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), labelBtn: AppLocalizations.of(context)!.btn_understand, onPressed: () async { await ref diff --git a/lib/ui/views/pool_add/layouts/components/pool_add_confirm_infos.dart b/lib/ui/views/pool_add/layouts/components/pool_add_confirm_infos.dart index 42e26ba4..09bac69c 100755 --- a/lib/ui/views/pool_add/layouts/components/pool_add_confirm_infos.dart +++ b/lib/ui/views/pool_add/layouts/components/pool_add_confirm_infos.dart @@ -2,6 +2,7 @@ import 'package:aedex/ui/views/pool_add/bloc/provider.dart'; import 'package:aedex/ui/views/util/components/dex_ratio.dart'; import 'package:aedex/ui/views/util/components/dex_token_balance.dart'; import 'package:aedex/ui/views/util/components/fiat_value.dart'; + import 'package:aedex/ui/views/util/components/format_address_link.dart'; import 'package:aedex/ui/views/util/components/verified_token_icon.dart'; @@ -48,12 +49,22 @@ class PoolAddConfirmInfos extends ConsumerWidget { children: [ SelectableText( AppLocalizations.of(context)!.poolAddConfirmNewPoolLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( AppLocalizations.of(context)! .poolAddConfirmWithLiquidityLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -78,6 +89,11 @@ class PoolAddConfirmInfos extends ConsumerWidget { .bodyLarge! .copyWith( color: aedappfm.AppThemeBase.secondaryColor, + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ), ), ), @@ -105,7 +121,13 @@ class PoolAddConfirmInfos extends ConsumerWidget { ), SelectableText( ' ', - style: Theme.of(context).textTheme.bodySmall, + style: Theme.of(context).textTheme.bodySmall!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodySmall!, + ), + ), ), Row( children: [ @@ -118,6 +140,11 @@ class PoolAddConfirmInfos extends ConsumerWidget { .bodyLarge! .copyWith( color: aedappfm.AppThemeBase.secondaryColor, + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ), ), ), @@ -162,12 +189,26 @@ class PoolAddConfirmInfos extends ConsumerWidget { .copyWith( color: aedappfm.AppThemeBase.secondaryColor, + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ), ), TextSpan( text: ' ${poolAdd.token1!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -186,7 +227,18 @@ class PoolAddConfirmInfos extends ConsumerWidget { if (snapshot.hasData) { return SelectableText( snapshot.data!, - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyMedium!, + ), + ), ); } return const SizedBox.shrink(); @@ -211,13 +263,30 @@ class PoolAddConfirmInfos extends ConsumerWidget { .copyWith( color: aedappfm .AppThemeBase.secondaryColor, + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyLarge!, + ), ), ), TextSpan( text: ' ${poolAdd.token2!.symbol.reduceSymbol()}', - style: - Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyLarge!, + ), + ), ), ], ), @@ -238,7 +307,16 @@ class PoolAddConfirmInfos extends ConsumerWidget { snapshot.data!, style: Theme.of(context) .textTheme - .bodyMedium, + .bodyMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyMedium!, + ), + ), ); } return const SizedBox.shrink(); @@ -303,11 +381,21 @@ class PoolAddConfirmInfos extends ConsumerWidget { children: [ SelectableText( AppLocalizations.of(context)!.confirmBeforeLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( AppLocalizations.of(context)!.confirmAfterLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), diff --git a/lib/ui/views/pool_add/layouts/components/pool_add_form_sheet.dart b/lib/ui/views/pool_add/layouts/components/pool_add_form_sheet.dart index 225fbd3b..2fc7f137 100644 --- a/lib/ui/views/pool_add/layouts/components/pool_add_form_sheet.dart +++ b/lib/ui/views/pool_add/layouts/components/pool_add_form_sheet.dart @@ -35,7 +35,12 @@ class PoolAddFormSheet extends ConsumerWidget { child: SelectionArea( child: SelectableText( AppLocalizations.of(context)!.poolAddFormTitle, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ), @@ -94,6 +99,10 @@ class PoolAddFormSheet extends ConsumerWidget { onPressed: () => ref .read(PoolAddFormProvider.poolAddForm.notifier) .validateForm(context), + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), isConnected: ref.watch(SessionProviders.session).isConnected, displayWalletConnectOnPressed: () async { diff --git a/lib/ui/views/pool_add/layouts/components/pool_add_token_1_selection.dart b/lib/ui/views/pool_add/layouts/components/pool_add_token_1_selection.dart index e3e9d6a7..f46beabe 100644 --- a/lib/ui/views/pool_add/layouts/components/pool_add_token_1_selection.dart +++ b/lib/ui/views/pool_add/layouts/components/pool_add_token_1_selection.dart @@ -2,6 +2,7 @@ import 'package:aedex/ui/views/pool_add/bloc/provider.dart'; import 'package:aedex/ui/views/token_selection/token_selection_popup.dart'; import 'package:aedex/ui/views/util/components/dex_token_icon.dart'; + import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; import 'package:flutter/material.dart'; @@ -47,7 +48,12 @@ class PoolAddToken1Selection extends ConsumerWidget { if (poolAdd.token1 == null) Text( AppLocalizations.of(context)!.btn_selectToken, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ) else Padding( @@ -69,7 +75,16 @@ class PoolAddToken1Selection extends ConsumerWidget { Expanded( child: Text( poolAdd.token1!.symbol, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), overflow: TextOverflow.ellipsis, ), ), diff --git a/lib/ui/views/pool_add/layouts/components/pool_add_token_2_selection.dart b/lib/ui/views/pool_add/layouts/components/pool_add_token_2_selection.dart index b36255d4..b13c7d8d 100644 --- a/lib/ui/views/pool_add/layouts/components/pool_add_token_2_selection.dart +++ b/lib/ui/views/pool_add/layouts/components/pool_add_token_2_selection.dart @@ -2,6 +2,7 @@ import 'package:aedex/ui/views/pool_add/bloc/provider.dart'; import 'package:aedex/ui/views/token_selection/token_selection_popup.dart'; import 'package:aedex/ui/views/util/components/dex_token_icon.dart'; + import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; import 'package:flutter/material.dart'; @@ -47,7 +48,12 @@ class PoolAddToken2Selection extends ConsumerWidget { if (poolAdd.token2 == null) Text( AppLocalizations.of(context)!.btn_selectToken, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ) else Padding( @@ -69,7 +75,16 @@ class PoolAddToken2Selection extends ConsumerWidget { Expanded( child: Text( poolAdd.token2!.symbol, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), overflow: TextOverflow.ellipsis, ), ), diff --git a/lib/ui/views/pool_list/components/pool_add_remove_favorite_icon.dart b/lib/ui/views/pool_list/components/pool_add_remove_favorite_icon.dart index 7caeba4a..c3e88a48 100644 --- a/lib/ui/views/pool_list/components/pool_add_remove_favorite_icon.dart +++ b/lib/ui/views/pool_list/components/pool_add_remove_favorite_icon.dart @@ -1,5 +1,6 @@ /// SPDX-License-Identifier: AGPL-3.0-or-later import 'package:aedex/application/pool/dex_pool.dart'; + import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; import 'package:flutter/material.dart'; @@ -63,8 +64,18 @@ class PoolAddRemoveFavoriteIcon extends ConsumerWidget { padding: const EdgeInsets.all(10), child: Text( 'Remove the pool from favorite tab?', - style: - Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyMedium!, + ), + ), ), ), const SizedBox( @@ -79,6 +90,11 @@ class PoolAddRemoveFavoriteIcon extends ConsumerWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ aedappfm.AppButton( + fontSize: aedappfm.Responsive + .fontSizeFromValue( + context, + desktopValue: 16, + ), labelBtn: AppLocalizations.of( context, )! @@ -88,6 +104,11 @@ class PoolAddRemoveFavoriteIcon extends ConsumerWidget { }, ), aedappfm.AppButton( + fontSize: aedappfm.Responsive + .fontSizeFromValue( + context, + desktopValue: 16, + ), labelBtn: AppLocalizations.of( context, )! diff --git a/lib/ui/views/pool_list/components/pool_details_back.dart b/lib/ui/views/pool_list/components/pool_details_back.dart index 03366d9b..bf6dad8a 100755 --- a/lib/ui/views/pool_list/components/pool_details_back.dart +++ b/lib/ui/views/pool_list/components/pool_details_back.dart @@ -4,6 +4,7 @@ import 'package:aedex/domain/models/dex_pool.dart'; import 'package:aedex/ui/views/util/components/dex_pair_icons.dart'; import 'package:aedex/ui/views/util/components/dex_ratio.dart'; import 'package:aedex/ui/views/util/components/fiat_value.dart'; + import 'package:aedex/ui/views/util/components/format_address_link.dart'; import 'package:aedex/ui/views/util/components/format_address_link_copy.dart'; import 'package:aedex/ui/views/util/components/liquidity_positions_icon.dart'; @@ -59,7 +60,16 @@ class PoolDetailsBack extends ConsumerWidget { pool.pair.token1.symbol.reduceSymbol(), style: Theme.of(context) .textTheme - .headlineMedium, + .headlineMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .headlineMedium!, + ), + ), ), ), const SelectableText('/'), @@ -69,7 +79,16 @@ class PoolDetailsBack extends ConsumerWidget { pool.pair.token2.symbol.reduceSymbol(), style: Theme.of(context) .textTheme - .headlineMedium, + .headlineMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .headlineMedium!, + ), + ), ), ), Padding( @@ -202,7 +221,16 @@ class PoolDetailsBack extends ConsumerWidget { children: [ SelectableText( 'Deposited', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), const SizedBox( width: 5, @@ -234,7 +262,16 @@ class PoolDetailsBack extends ConsumerWidget { '${pool.pair.token1.reserve.formatNumber()} ${pool.pair.token1.symbol.reduceSymbol()}', style: Theme.of(context) .textTheme - .bodyLarge, + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyLarge!, + ), + ), ), ), ], @@ -251,7 +288,16 @@ class PoolDetailsBack extends ConsumerWidget { snapshot.data!, style: Theme.of(context) .textTheme - .bodyMedium, + .bodyMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyMedium!, + ), + ), ); } return const SizedBox.shrink(); @@ -270,7 +316,16 @@ class PoolDetailsBack extends ConsumerWidget { '${pool.pair.token2.reserve.formatNumber()} ${pool.pair.token2.symbol.reduceSymbol()}', style: Theme.of(context) .textTheme - .bodyLarge, + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyLarge!, + ), + ), ), ), ], @@ -287,7 +342,16 @@ class PoolDetailsBack extends ConsumerWidget { snapshot.data!, style: Theme.of(context) .textTheme - .bodyMedium, + .bodyMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyMedium!, + ), + ), ); } return const SizedBox.shrink(); @@ -330,14 +394,34 @@ class PoolDetailsBack extends ConsumerWidget { ), style: Theme.of(context) .textTheme - .bodyLarge, + .bodyLarge! + .copyWith( + fontSize: aedappfm + .Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyLarge!, + ), + ), ), if (pool.lpToken.supply > 0) SelectableText( ' / ${pool.lpToken.supply.formatNumber()} ${pool.lpToken.supply > 1 ? 'LP Tokens' : 'LP Token'}', style: Theme.of(context) .textTheme - .bodyLarge, + .bodyLarge! + .copyWith( + fontSize: aedappfm + .Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyLarge!, + ), + ), ) else SelectableText( @@ -346,7 +430,17 @@ class PoolDetailsBack extends ConsumerWidget { : 'LP Token', style: Theme.of(context) .textTheme - .bodyLarge, + .bodyLarge! + .copyWith( + fontSize: aedappfm + .Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyLarge!, + ), + ), ), ], ), @@ -354,7 +448,17 @@ class PoolDetailsBack extends ConsumerWidget { '(${percentage.formatNumber(precision: 8)}%)', style: Theme.of(context) .textTheme - .bodyMedium, + .bodyMedium! + .copyWith( + fontSize: aedappfm + .Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyMedium!, + ), + ), ), ], ); @@ -379,11 +483,23 @@ class PoolDetailsBack extends ConsumerWidget { children: [ SelectableText( 'Swap fees', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( '${pool.infos?.fees ?? '-- '}%', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -393,11 +509,23 @@ class PoolDetailsBack extends ConsumerWidget { children: [ SelectableText( 'Protocol fees', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( '${pool.infos?.protocolFees ?? '-- '}%', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -411,7 +539,14 @@ class PoolDetailsBack extends ConsumerWidget { ratio: pool.infos!.ratioToken1Token2, token1Symbol: pool.pair.token1.symbol, token2Symbol: pool.pair.token2.symbol, - textStyle: Theme.of(context).textTheme.bodyLarge, + textStyle: + Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -422,7 +557,14 @@ class PoolDetailsBack extends ConsumerWidget { ratio: pool.infos!.ratioToken2Token1, token1Symbol: pool.pair.token2.symbol, token2Symbol: pool.pair.token1.symbol, - textStyle: Theme.of(context).textTheme.bodyLarge, + textStyle: + Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), diff --git a/lib/ui/views/pool_list/components/pool_details_front.dart b/lib/ui/views/pool_list/components/pool_details_front.dart index 32acd197..ccab8b08 100755 --- a/lib/ui/views/pool_list/components/pool_details_front.dart +++ b/lib/ui/views/pool_list/components/pool_details_front.dart @@ -8,6 +8,7 @@ import 'package:aedex/ui/views/liquidity_remove/layouts/liquidity_remove_sheet.d import 'package:aedex/ui/views/swap/layouts/swap_sheet.dart'; import 'package:aedex/ui/views/util/components/dex_pair_icons.dart'; + import 'package:aedex/ui/views/util/components/liquidity_positions_icon.dart'; import 'package:aedex/ui/views/util/components/pool_favorite_icon.dart'; import 'package:aedex/ui/views/util/components/verified_pool_icon.dart'; @@ -59,7 +60,18 @@ class PoolDetailsFront extends ConsumerWidget { message: pool.pair.token1.symbol, child: SelectableText( pool.pair.token1.symbol.reduceSymbol(), - style: Theme.of(context).textTheme.headlineMedium, + style: Theme.of(context) + .textTheme + .headlineMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .headlineMedium!, + ), + ), ), ), const SelectableText('/'), @@ -67,7 +79,18 @@ class PoolDetailsFront extends ConsumerWidget { message: pool.pair.token2.symbol, child: SelectableText( pool.pair.token2.symbol.reduceSymbol(), - style: Theme.of(context).textTheme.headlineMedium, + style: Theme.of(context) + .textTheme + .headlineMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .headlineMedium!, + ), + ), ), ), Padding( @@ -113,7 +136,13 @@ class PoolDetailsFront extends ConsumerWidget { children: [ SelectableText( 'TVL', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( '\$${tvl.formatNumber(precision: 2)}', @@ -121,6 +150,11 @@ class PoolDetailsFront extends ConsumerWidget { .textTheme .headlineMedium! .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.headlineMedium!, + ), color: aedappfm.AppThemeBase.secondaryColor, ), ), @@ -137,14 +171,32 @@ class PoolDetailsFront extends ConsumerWidget { padding: const EdgeInsets.only(bottom: 10), child: SelectableText( '24h', - style: Theme.of(context).textTheme.bodySmall, + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodySmall!, + ), + ), ), ), Padding( padding: const EdgeInsets.only(right: 25), child: SelectableText( 'APR', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ], @@ -156,6 +208,11 @@ class PoolDetailsFront extends ConsumerWidget { .textTheme .headlineMedium! .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.headlineMedium!, + ), color: aedappfm.AppThemeBase.secondaryColor, ), ) @@ -166,6 +223,11 @@ class PoolDetailsFront extends ConsumerWidget { .textTheme .headlineMedium! .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.headlineMedium!, + ), color: aedappfm.AppThemeBase.secondaryColor, ), ), @@ -188,14 +250,32 @@ class PoolDetailsFront extends ConsumerWidget { padding: const EdgeInsets.only(bottom: 10), child: SelectableText( '24h', - style: Theme.of(context).textTheme.bodySmall, + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodySmall!, + ), + ), ), ), Padding( padding: const EdgeInsets.only(right: 25), child: SelectableText( 'Volume', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ], @@ -207,14 +287,32 @@ class PoolDetailsFront extends ConsumerWidget { padding: const EdgeInsets.only(bottom: 10), child: SelectableText( '24h', - style: Theme.of(context).textTheme.bodySmall, + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodySmall!, + ), + ), ), ), Padding( padding: const EdgeInsets.only(right: 25), child: SelectableText( 'Fees', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ], @@ -226,11 +324,23 @@ class PoolDetailsFront extends ConsumerWidget { children: [ SelectableText( '\$${stats.volume24h.formatNumber(precision: stats.volume24h > 1 ? 2 : 8)}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( '\$${stats.fee24h.formatNumber(precision: stats.fee24h > 1 ? 2 : 8)}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -247,14 +357,32 @@ class PoolDetailsFront extends ConsumerWidget { padding: const EdgeInsets.only(bottom: 10), child: SelectableText( 'All', - style: Theme.of(context).textTheme.bodySmall, + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodySmall!, + ), + ), ), ), Padding( padding: const EdgeInsets.only(right: 17), child: SelectableText( 'Volume', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ], @@ -266,14 +394,32 @@ class PoolDetailsFront extends ConsumerWidget { padding: const EdgeInsets.only(bottom: 10), child: SelectableText( 'All', - style: Theme.of(context).textTheme.bodySmall, + style: Theme.of(context) + .textTheme + .bodySmall! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodySmall!, + ), + ), ), ), Padding( padding: const EdgeInsets.only(right: 17), child: SelectableText( 'Fees', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ], @@ -285,11 +431,23 @@ class PoolDetailsFront extends ConsumerWidget { children: [ SelectableText( '\$${stats.volumeAllTime.formatNumber(precision: stats.volumeAllTime > 1 ? 2 : 8)}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( '\$${stats.feeAllTime.formatNumber(precision: stats.feeAllTime > 1 ? 2 : 8)}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -301,6 +459,10 @@ class PoolDetailsFront extends ConsumerWidget { Column( children: [ aedappfm.AppButton( + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), background: aedappfm.ArchethicThemeBase.purple500, labelBtn: 'Swap these tokens', onPressed: () { @@ -333,7 +495,13 @@ class PoolDetailsFront extends ConsumerWidget { child: aedappfm.ButtonValidate( background: aedappfm.ArchethicThemeBase.purple500, controlOk: true, - labelBtn: 'Add Liquidity', + labelBtn: aedappfm.Responsive.isDesktop(context) + ? 'Add Liquidity' + : 'Add Liquid.', + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), onPressed: () { final poolJson = jsonEncode(pool.toJson()); final pairJson = jsonEncode(pool.pair.toJson()); @@ -386,7 +554,13 @@ class PoolDetailsFront extends ConsumerWidget { child: aedappfm.ButtonValidate( background: aedappfm.ArchethicThemeBase.purple500, controlOk: pool.lpTokenInUserBalance, - labelBtn: 'Remove liquidity', + labelBtn: aedappfm.Responsive.isDesktop(context) + ? 'Remove liquidity' + : 'Rmv Liquid.', + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), onPressed: () { final poolJson = jsonEncode(pool.toJson()); final pairJson = jsonEncode(pool.pair.toJson()); diff --git a/lib/ui/views/pool_list/components/pool_list_search.dart b/lib/ui/views/pool_list/components/pool_list_search.dart index 03cf195c..3438088f 100644 --- a/lib/ui/views/pool_list/components/pool_list_search.dart +++ b/lib/ui/views/pool_list/components/pool_list_search.dart @@ -26,103 +26,135 @@ class _PoolListSearchState extends ConsumerState { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.only(top: 20, left: 30, right: 30), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only(top: 1), - child: FlutterToggleTab( - width: 40, - unSelectedBackgroundColors: [ - aedappfm.ArchethicThemeBase.purple500.withOpacity(0.5), - aedappfm.ArchethicThemeBase.purple500.withOpacity(0.5), + return aedappfm.Responsive.isDesktop(context) + ? Padding( + padding: const EdgeInsets.only(top: 20, left: 30, right: 30), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _getTabs(), + _addPool(context), + const PoolListSearchBar(), ], - borderRadius: 20, - height: 30, - selectedIndex: ref - .watch(PoolListFormProvider.poolListForm) - .tabIndexSelected - .index, - selectedBackgroundColors: [ - aedappfm.ArchethicThemeBase.purple500, - aedappfm.ArchethicThemeBase.purple500, + ), + ) + : Padding( + padding: const EdgeInsets.only( + top: 20, + ), + child: Column( + children: [ + _getTabs(), + const SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const PoolListSearchBar(), + _addPool(context), + ], + ), ], - selectedTextStyle: const TextStyle( - color: Colors.white, - fontSize: 12, - fontWeight: FontWeight.w400, - ), - unSelectedTextStyle: TextStyle( - color: Colors.white.withOpacity(0.5), - fontSize: 12, - fontWeight: FontWeight.w400, + ), + ); + } + + Widget _addPool(BuildContext context) { + return aedappfm.ButtonValidate( + background: aedappfm.ArchethicThemeBase.purple500, + controlOk: true, + labelBtn: aedappfm.Responsive.isDesktop(context) ? 'Create Pool' : '+', + onPressed: () { + context.go(PoolAddSheet.routerPage); + }, + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 12, + ), + height: 30, + isConnected: ref.watch(SessionProviders.session).isConnected, + displayWalletConnectOnPressed: () async { + final sessionNotifier = ref.read(SessionProviders.session.notifier); + await sessionNotifier.connectToWallet(); + + final session = ref.read(SessionProviders.session); + if (session.error.isNotEmpty) { + if (!context.mounted) return; + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + backgroundColor: Theme.of(context).snackBarTheme.backgroundColor, + content: SelectableText( + session.error, + style: Theme.of(context).snackBarTheme.contentTextStyle, ), - labels: const [ - 'Verified pools', - 'My pools', - 'Favorites', - 'Results', - ], - icons: const [ - aedappfm.Iconsax.verify, - aedappfm.Iconsax.receipt, - aedappfm.Iconsax.star, - aedappfm.Iconsax.search_zoom_in, - ], - iconSize: 12, - selectedLabelIndex: (index) { - setState(() { - ref - .read(PoolListFormProvider.poolListForm.notifier) - .setTabIndexSelected(PoolsListTab.values[index]); - ref.invalidate(PoolListFormProvider.poolsToDisplay); - }); - }, - isScroll: false, + duration: const Duration(seconds: 2), ), - ), - aedappfm.ButtonValidate( - background: aedappfm.ArchethicThemeBase.purple500, - controlOk: true, - labelBtn: 'Create Pool', - onPressed: () { - context.go(PoolAddSheet.routerPage); - }, - fontSize: 12, - height: 30, - isConnected: ref.watch(SessionProviders.session).isConnected, - displayWalletConnectOnPressed: () async { - final sessionNotifier = - ref.read(SessionProviders.session.notifier); - await sessionNotifier.connectToWallet(); + ); + } else { + if (!context.mounted) return; + context.go( + '/', + ); + } + }, + ); + } - final session = ref.read(SessionProviders.session); - if (session.error.isNotEmpty) { - if (!context.mounted) return; - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - backgroundColor: - Theme.of(context).snackBarTheme.backgroundColor, - content: SelectableText( - session.error, - style: Theme.of(context).snackBarTheme.contentTextStyle, - ), - duration: const Duration(seconds: 2), - ), - ); - } else { - if (!context.mounted) return; - context.go( - '/', - ); - } - }, - ), - const PoolListSearchBar(), + Widget _getTabs() { + return Padding( + padding: const EdgeInsets.only(top: 1), + child: FlutterToggleTab( + begin: Alignment.center, + end: Alignment.center, + width: aedappfm.Responsive.isDesktop(context) ? 40 : 95, + unSelectedBackgroundColors: [ + aedappfm.ArchethicThemeBase.purple500.withOpacity(0.5), + aedappfm.ArchethicThemeBase.purple500.withOpacity(0.5), + ], + borderRadius: 20, + height: 30, + selectedIndex: + ref.watch(PoolListFormProvider.poolListForm).tabIndexSelected.index, + selectedBackgroundColors: [ + aedappfm.ArchethicThemeBase.purple500, + aedappfm.ArchethicThemeBase.purple500, + ], + selectedTextStyle: TextStyle( + color: Colors.white, + fontSize: + aedappfm.Responsive.fontSizeFromValue(context, desktopValue: 12), + fontWeight: FontWeight.w400, + ), + unSelectedTextStyle: TextStyle( + color: Colors.white.withOpacity(0.5), + fontSize: + aedappfm.Responsive.fontSizeFromValue(context, desktopValue: 12), + fontWeight: FontWeight.w400, + ), + labels: const [ + 'Verified pools', + 'My pools', + 'Favorites', + 'Results', + ], + icons: const [ + aedappfm.Iconsax.verify, + aedappfm.Iconsax.receipt, + aedappfm.Iconsax.star, + aedappfm.Iconsax.search_zoom_in, ], + iconSize: 12, + selectedLabelIndex: (index) { + setState(() { + ref + .read(PoolListFormProvider.poolListForm.notifier) + .setTabIndexSelected(PoolsListTab.values[index]); + ref.invalidate(PoolListFormProvider.poolsToDisplay); + }); + }, + isScroll: false, ), ); } diff --git a/lib/ui/views/pool_list/components/pool_list_search_bar.dart b/lib/ui/views/pool_list/components/pool_list_search_bar.dart index 4208be2f..750db907 100644 --- a/lib/ui/views/pool_list/components/pool_list_search_bar.dart +++ b/lib/ui/views/pool_list/components/pool_list_search_bar.dart @@ -28,7 +28,9 @@ class PoolListSearchBarState extends ConsumerState { Widget build(BuildContext context) { return Container( padding: const EdgeInsets.only(top: 2), - width: 300, + width: aedappfm.Responsive.isDesktop(context) + ? 300 + : MediaQuery.of(context).size.width - 100, height: 31, decoration: BoxDecoration( borderRadius: BorderRadius.circular( diff --git a/lib/ui/views/pool_list/pool_list_sheet.dart b/lib/ui/views/pool_list/pool_list_sheet.dart index 604a0114..28ef226b 100755 --- a/lib/ui/views/pool_list/pool_list_sheet.dart +++ b/lib/ui/views/pool_list/pool_list_sheet.dart @@ -61,7 +61,7 @@ Widget _body(BuildContext context, WidgetRef ref) { Center( child: Padding( padding: EdgeInsets.only( - top: 140, + top: aedappfm.Responsive.isDesktop(context) ? 140 : 200, bottom: aedappfm.Responsive.isDesktop(context) ? 40 : 80, ), child: asyncPools.when( @@ -75,12 +75,24 @@ Widget _body(BuildContext context, WidgetRef ref) { if (selectedTab == PoolsListTab.searchPool) SelectableText( 'Searching in progress. Please wait', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ) else SelectableText( 'Loading in progress. Please wait', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), const SizedBox( width: 10, @@ -112,7 +124,12 @@ Widget _body(BuildContext context, WidgetRef ref) { children: [ SelectableText( 'Please, connect your wallet to list your pools with position.', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ); @@ -125,7 +142,13 @@ Widget _body(BuildContext context, WidgetRef ref) { children: [ SelectableText( 'Please enter your search criteria.', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ); @@ -135,7 +158,13 @@ Widget _body(BuildContext context, WidgetRef ref) { children: [ SelectableText( 'No results found.', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ); @@ -143,12 +172,16 @@ Widget _body(BuildContext context, WidgetRef ref) { } if (pools.isEmpty && poolListForm.tabIndexSelected == PoolsListTab.favoritePools) { - return Row( - mainAxisAlignment: MainAxisAlignment.center, + return Wrap( children: [ SelectableText( 'To add your favorite pools to this tab, please click on the', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), const Padding( padding: EdgeInsets.only(left: 2, right: 5), @@ -159,21 +192,30 @@ Widget _body(BuildContext context, WidgetRef ref) { ), SelectableText( 'icon in the pool cards header.', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ); } return GridView.builder( - gridDelegate: const aedappfm.SliverGridDelegateWithFixedSize( - crossAxisExtent: 500, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: MediaQuery.of(context).size.width >= 1500 + ? 3 + : aedappfm.Responsive.isDesktop(context) + ? 2 + : 1, mainAxisExtent: 550, crossAxisSpacing: 30, mainAxisSpacing: 10, ), - padding: const EdgeInsets.only( - left: 50, - right: 50, + padding: EdgeInsets.only( + left: aedappfm.Responsive.isDesktop(context) ? 50 : 5, + right: aedappfm.Responsive.isDesktop(context) ? 50 : 5, ), itemCount: pools.length, itemBuilder: (context, index) { diff --git a/lib/ui/views/swap/layouts/components/swap_confirm_infos.dart b/lib/ui/views/swap/layouts/components/swap_confirm_infos.dart index 2586e1f4..e4fb7b18 100755 --- a/lib/ui/views/swap/layouts/components/swap_confirm_infos.dart +++ b/lib/ui/views/swap/layouts/components/swap_confirm_infos.dart @@ -47,11 +47,21 @@ class SwapConfirmInfos extends ConsumerWidget { children: [ SelectableText( 'Swap', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( 'Mininum received', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -65,11 +75,22 @@ class SwapConfirmInfos extends ConsumerWidget { ' - ${swap.tokenToSwapAmount.formatNumber(precision: 8)}', style: Theme.of(context).textTheme.bodyLarge!.copyWith( color: aedappfm.AppThemeBase.secondaryColor, + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ), ), TextSpan( text: ' ${swap.tokenToSwap!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -92,12 +113,26 @@ class SwapConfirmInfos extends ConsumerWidget { .bodyLarge! .copyWith( color: aedappfm.AppThemeBase.secondaryColor, + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ), ), TextSpan( text: ' ${swap.tokenSwapped!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -110,7 +145,16 @@ class SwapConfirmInfos extends ConsumerWidget { message: swap.tokenSwapped!.symbol, child: SelectableText( '${swap.minToReceive.formatNumber(precision: 8)} ${swap.tokenSwapped!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), FutureBuilder( @@ -123,7 +167,16 @@ class SwapConfirmInfos extends ConsumerWidget { if (snapshot.hasData) { return SelectableText( snapshot.data!, - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ); } return const SizedBox.shrink(); @@ -150,11 +203,21 @@ class SwapConfirmInfos extends ConsumerWidget { children: [ SelectableText( AppLocalizations.of(context)!.confirmBeforeLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), SelectableText( AppLocalizations.of(context)!.confirmAfterLbl, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -225,7 +288,13 @@ class SwapConfirmInfos extends ConsumerWidget { message: swap.tokenToSwap!.symbol, child: SelectableText( 'Fees: ${swap.swapTotalFees.formatNumber(precision: 8)} ${swap.tokenToSwap!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), const SizedBox( @@ -241,7 +310,16 @@ class SwapConfirmInfos extends ConsumerWidget { if (snapshot.hasData) { return SelectableText( snapshot.data!, - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ); } return const SizedBox.shrink(); diff --git a/lib/ui/views/swap/layouts/components/swap_form_sheet.dart b/lib/ui/views/swap/layouts/components/swap_form_sheet.dart index c3dd2bfa..a3943987 100644 --- a/lib/ui/views/swap/layouts/components/swap_form_sheet.dart +++ b/lib/ui/views/swap/layouts/components/swap_form_sheet.dart @@ -84,6 +84,10 @@ class SwapFormSheet extends ConsumerWidget { aedappfm.ButtonValidate( controlOk: swap.isControlsOk, labelBtn: AppLocalizations.of(context)!.btn_swap, + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), onPressed: () => ref .read(SwapFormProvider.swapForm.notifier) .validateForm(context), diff --git a/lib/ui/views/swap/layouts/components/swap_infos.dart b/lib/ui/views/swap/layouts/components/swap_infos.dart index ec0aa9d8..0acc99c3 100644 --- a/lib/ui/views/swap/layouts/components/swap_infos.dart +++ b/lib/ui/views/swap/layouts/components/swap_infos.dart @@ -58,7 +58,12 @@ class SwapInfos extends ConsumerWidget { children: [ SelectableText( 'Fees', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), const SizedBox( height: 5, @@ -74,7 +79,12 @@ class SwapInfos extends ConsumerWidget { children: [ SelectableText( 'Price impact', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), const SizedBox( height: 5, @@ -90,7 +100,12 @@ class SwapInfos extends ConsumerWidget { children: [ SelectableText( 'Minimum received', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), const SizedBox( height: 5, @@ -106,7 +121,12 @@ class SwapInfos extends ConsumerWidget { children: [ SelectableText( 'TVL', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), const SizedBox( height: 5, @@ -122,7 +142,12 @@ class SwapInfos extends ConsumerWidget { children: [ SelectableText( 'Ratio', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), const SizedBox( height: 5, @@ -170,7 +195,12 @@ class SwapInfos extends ConsumerWidget { children: [ SelectableText( 'Fees', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), Row( children: [ @@ -178,7 +208,12 @@ class SwapInfos extends ConsumerWidget { message: swap.tokenToSwap!.symbol, child: SelectableText( '${swap.swapTotalFees.formatNumber(precision: 8)} ${swap.tokenToSwap!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ), const SizedBox( @@ -194,7 +229,16 @@ class SwapInfos extends ConsumerWidget { if (snapshot.hasData) { return SelectableText( snapshot.data!, - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ); } return const SizedBox.shrink(); @@ -224,12 +268,22 @@ class SwapInfos extends ConsumerWidget { children: [ SelectableText( 'Price impact', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), DexPriceImpact( priceImpact: swap.priceImpact, withLabel: false, - textStyle: Theme.of(context).textTheme.bodyMedium, + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ], ), @@ -238,7 +292,12 @@ class SwapInfos extends ConsumerWidget { children: [ SelectableText( 'Minimum received', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), Row( children: [ @@ -246,7 +305,12 @@ class SwapInfos extends ConsumerWidget { message: swap.tokenSwapped!.symbol, child: SelectableText( '${swap.minToReceive.formatNumber(precision: 8)} ${swap.tokenSwapped!.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ), const SizedBox( @@ -262,7 +326,16 @@ class SwapInfos extends ConsumerWidget { if (snapshot.hasData) { return SelectableText( snapshot.data!, - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ); } return const SizedBox.shrink(); @@ -277,11 +350,21 @@ class SwapInfos extends ConsumerWidget { children: [ SelectableText( 'TVL', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), SelectableText( '\$${tvl.formatNumber(precision: 2)}', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ], ), @@ -290,7 +373,12 @@ class SwapInfos extends ConsumerWidget { children: [ SelectableText( 'Ratio', - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), DexRatio( ratio: tokenAddressRatioPrimary.toUpperCase() == @@ -305,7 +393,12 @@ class SwapInfos extends ConsumerWidget { swap.pool!.pair.token1.address!.toUpperCase() ? swap.pool!.pair.token2.symbol : swap.pool!.pair.token1.symbol, - textStyle: Theme.of(context).textTheme.bodyMedium, + textStyle: Theme.of(context).textTheme.bodyMedium!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), ], ), diff --git a/lib/ui/views/swap/layouts/components/swap_settings_slippage_tolerance.dart b/lib/ui/views/swap/layouts/components/swap_settings_slippage_tolerance.dart index 1a83ca2c..288d579a 100644 --- a/lib/ui/views/swap/layouts/components/swap_settings_slippage_tolerance.dart +++ b/lib/ui/views/swap/layouts/components/swap_settings_slippage_tolerance.dart @@ -61,7 +61,12 @@ class SwapSettingsSlippageToleranceState children: [ TextSpan( text: AppLocalizations.of(context)!.slippage_tolerance, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ], ), @@ -109,7 +114,12 @@ class SwapSettingsSlippageToleranceState padding: const EdgeInsets.only(left: 5), child: SelectableText( '%', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ], @@ -120,6 +130,10 @@ class SwapSettingsSlippageToleranceState (double.tryParse(slippageToleranceController.text)! >= 0 && double.tryParse(slippageToleranceController.text)! < 100), labelBtn: AppLocalizations.of(context)!.btn_save, + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: 16, + ), onPressed: () { swapNotifier.setSlippageTolerance( double.tryParse(slippageToleranceController.text) ?? 0, diff --git a/lib/ui/views/swap/layouts/components/swap_textfield_token_swapped_amount.dart b/lib/ui/views/swap/layouts/components/swap_textfield_token_swapped_amount.dart index c45e9472..c1d6fa22 100644 --- a/lib/ui/views/swap/layouts/components/swap_textfield_token_swapped_amount.dart +++ b/lib/ui/views/swap/layouts/components/swap_textfield_token_swapped_amount.dart @@ -82,7 +82,12 @@ class _SwapTokenSwappedAmountState children: [ SelectableText( AppLocalizations.of(context)!.swapToEstimatedLbl, - style: Theme.of(context).textTheme.bodySmall, + style: Theme.of(context).textTheme.bodySmall!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodySmall!, + ), + ), ), Stack( alignment: Alignment.centerLeft, @@ -221,7 +226,16 @@ class _SwapTokenSwappedAmountState if (snapshot.hasData) { return SelectableText( snapshot.data!, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ); } return const SizedBox.shrink(); diff --git a/lib/ui/views/swap/layouts/components/swap_textfield_token_to_swap_amount.dart b/lib/ui/views/swap/layouts/components/swap_textfield_token_to_swap_amount.dart index 6c0d0beb..e2fbfffc 100644 --- a/lib/ui/views/swap/layouts/components/swap_textfield_token_to_swap_amount.dart +++ b/lib/ui/views/swap/layouts/components/swap_textfield_token_to_swap_amount.dart @@ -88,14 +88,24 @@ class _SwapTokenToSwapAmountState extends ConsumerState { children: [ SelectableText( AppLocalizations.of(context)!.swapFromLbl, - style: Theme.of(context).textTheme.bodySmall, + style: Theme.of(context).textTheme.bodySmall!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodySmall!, + ), + ), ), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ SelectableText( '${AppLocalizations.of(context)!.slippage_tolerance} ${swap.slippageTolerance}%', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), const Align( alignment: Alignment.centerRight, @@ -245,7 +255,16 @@ class _SwapTokenToSwapAmountState extends ConsumerState { if (snapshot.hasData) { return SelectableText( snapshot.data!, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ); } return const SizedBox.shrink(); diff --git a/lib/ui/views/swap/layouts/components/swap_token_swapped_selection.dart b/lib/ui/views/swap/layouts/components/swap_token_swapped_selection.dart index 8db72972..7e257721 100644 --- a/lib/ui/views/swap/layouts/components/swap_token_swapped_selection.dart +++ b/lib/ui/views/swap/layouts/components/swap_token_swapped_selection.dart @@ -2,6 +2,7 @@ import 'package:aedex/ui/views/swap/bloc/provider.dart'; import 'package:aedex/ui/views/token_selection/token_selection_popup.dart'; import 'package:aedex/ui/views/util/components/dex_token_icon.dart'; + import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; import 'package:flutter/material.dart'; @@ -44,7 +45,12 @@ class SwapTokenSwappedSelection extends ConsumerWidget { if (swap.tokenSwapped == null) Text( AppLocalizations.of(context)!.btn_selectToken, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ) else Padding( @@ -66,7 +72,16 @@ class SwapTokenSwappedSelection extends ConsumerWidget { Expanded( child: Text( swap.tokenSwapped!.symbol, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), overflow: TextOverflow.fade, ), ), diff --git a/lib/ui/views/swap/layouts/components/swap_token_to_swap_selection.dart b/lib/ui/views/swap/layouts/components/swap_token_to_swap_selection.dart index 7303c9ca..65fcf93d 100644 --- a/lib/ui/views/swap/layouts/components/swap_token_to_swap_selection.dart +++ b/lib/ui/views/swap/layouts/components/swap_token_to_swap_selection.dart @@ -2,6 +2,7 @@ import 'package:aedex/ui/views/swap/bloc/provider.dart'; import 'package:aedex/ui/views/token_selection/token_selection_popup.dart'; import 'package:aedex/ui/views/util/components/dex_token_icon.dart'; + import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; import 'package:flutter/material.dart'; @@ -44,7 +45,12 @@ class SwapTokenToSwapSelection extends ConsumerWidget { if (swap.tokenToSwap == null) Text( AppLocalizations.of(context)!.btn_selectToken, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ) else Padding( @@ -66,7 +72,16 @@ class SwapTokenToSwapSelection extends ConsumerWidget { Expanded( child: Text( swap.tokenToSwap!.symbol, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), overflow: TextOverflow.fade, ), ), diff --git a/lib/ui/views/token_selection/components/token_list.dart b/lib/ui/views/token_selection/components/token_list.dart index 6a172438..9e2392cd 100644 --- a/lib/ui/views/token_selection/components/token_list.dart +++ b/lib/ui/views/token_selection/components/token_list.dart @@ -3,6 +3,8 @@ import 'package:aedex/application/session/provider.dart'; import 'package:aedex/domain/models/dex_token.dart'; import 'package:aedex/ui/views/token_selection/bloc/provider.dart'; import 'package:aedex/ui/views/token_selection/components/token_single.dart'; +import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' + as aedappfm; import 'package:flutter/material.dart'; import 'package:flutter_animate/flutter_animate.dart'; import 'package:flutter_gen/gen_l10n/localizations.dart'; @@ -27,7 +29,12 @@ class TokenList extends ConsumerWidget { padding: const EdgeInsets.symmetric(vertical: 10), child: Text( AppLocalizations.of(context)!.token_selection_your_tokens_title, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), SizedBox( @@ -49,7 +56,16 @@ class TokenList extends ConsumerWidget { Text( AppLocalizations.of(context)! .token_selection_get_tokens_from_wallet, - style: Theme.of(context).textTheme.bodyMedium, + style: Theme.of(context) + .textTheme + .bodyMedium! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyMedium!, + ), + ), ), const SizedBox(width: 10), const SizedBox( diff --git a/lib/ui/views/token_selection/components/token_selection_common_bases.dart b/lib/ui/views/token_selection/components/token_selection_common_bases.dart index df7d81a1..12e54f9e 100644 --- a/lib/ui/views/token_selection/components/token_selection_common_bases.dart +++ b/lib/ui/views/token_selection/components/token_selection_common_bases.dart @@ -1,4 +1,5 @@ import 'package:aedex/domain/models/dex_token.dart'; + import 'package:aedex/ui/views/util/components/verified_token_icon.dart'; import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; @@ -25,7 +26,12 @@ class TokenSelectionCommonBases extends ConsumerWidget { padding: const EdgeInsets.symmetric(vertical: 10), child: Text( AppLocalizations.of(context)!.token_selection_common_bases_title, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), Wrap( @@ -95,7 +101,16 @@ class TokenSelectionCommonBases extends ConsumerWidget { padding: const EdgeInsets.only(top: 1), child: Text( token.symbol, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), const SizedBox( diff --git a/lib/ui/views/token_selection/components/token_selection_search_bar.dart b/lib/ui/views/token_selection/components/token_selection_search_bar.dart index 27d72263..7c7fe9e6 100644 --- a/lib/ui/views/token_selection/components/token_selection_search_bar.dart +++ b/lib/ui/views/token_selection/components/token_selection_search_bar.dart @@ -1,4 +1,5 @@ import 'package:aedex/ui/views/token_selection/bloc/provider.dart'; + import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' as aedappfm; import 'package:flutter/material.dart'; @@ -107,8 +108,16 @@ class TokenSelectionSearchBarState border: InputBorder.none, hintText: AppLocalizations.of(context)! .token_selection_search_bar_hint, - hintStyle: - Theme.of(context).textTheme.bodyLarge, + hintStyle: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), contentPadding: const EdgeInsets.only(left: 10), ), ), diff --git a/lib/ui/views/token_selection/components/token_single.dart b/lib/ui/views/token_selection/components/token_single.dart index 7bc85277..91c846d4 100644 --- a/lib/ui/views/token_selection/components/token_single.dart +++ b/lib/ui/views/token_selection/components/token_single.dart @@ -1,5 +1,6 @@ import 'package:aedex/domain/models/dex_token.dart'; import 'package:aedex/ui/views/util/components/dex_token_icon.dart'; + import 'package:aedex/ui/views/util/components/format_address_link_copy.dart'; import 'package:aedex/ui/views/util/components/verified_token_icon.dart'; import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutter.dart' @@ -59,7 +60,16 @@ class SingleToken extends StatelessWidget { if (token.isLpToken == false) Text( token.symbol, - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), if (token.isLpToken == false) const SizedBox( @@ -79,7 +89,16 @@ class SingleToken extends StatelessWidget { 'LP Token for pair ${token.lpTokenPair!.token1.isUCO ? 'UCO' : token.lpTokenPair!.token1.symbol}/${token.lpTokenPair!.token2.isUCO ? 'UCO' : token.lpTokenPair!.token2.symbol}', child: Text( 'LP Token for pair ${token.lpTokenPair!.token1.isUCO ? 'UCO' : token.lpTokenPair!.token1.symbol.reduceSymbol()}/${token.lpTokenPair!.token2.isUCO ? 'UCO' : token.lpTokenPair!.token2.symbol.reduceSymbol()}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ], diff --git a/lib/ui/views/util/components/dex_env.dart b/lib/ui/views/util/components/dex_env.dart index 6c8d1f1b..a9cab59c 100755 --- a/lib/ui/views/util/components/dex_env.dart +++ b/lib/ui/views/util/components/dex_env.dart @@ -7,7 +7,6 @@ import 'package:archethic_dapp_framework_flutter/archethic_dapp_framework_flutte as aedappfm; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:flutter_svg/flutter_svg.dart'; class DexEnv extends ConsumerStatefulWidget { const DexEnv({ @@ -24,13 +23,12 @@ class _DexEnvState extends ConsumerState { final session = ref.watch(SessionProviders.session); return SizedBox( - width: 200, + width: 150, child: MenuAnchor( style: MenuStyle( - backgroundColor: MaterialStateProperty.all(Colors.transparent), + backgroundColor: MaterialStateProperty.all(Colors.black), elevation: MaterialStateProperty.all(0), ), - alignmentOffset: Offset(MediaQuery.of(context).size.width, 10), builder: (context, controller, child) { return InkWell( onTap: () { @@ -41,26 +39,19 @@ class _DexEnvState extends ConsumerState { } }, child: Row( - mainAxisAlignment: MainAxisAlignment.end, children: [ - SvgPicture.asset( - 'assets/images/AELogo.svg', - semanticsLabel: 'AE Logo', - height: 14, - colorFilter: ColorFilter.mode( - aedappfm.EndpointUtil.getEnvironnementLabel( + Text( + aedappfm.EndpointUtil.getEnvironnementLabel(session.endpoint), + style: TextStyle( + fontSize: 12, + color: aedappfm.EndpointUtil.getEnvironnementLabel( session.endpoint, ) != 'Archethic Mainnet' ? Colors.red : Colors.white, - BlendMode.srcIn, ), ), - const SizedBox(width: 10), - Text( - aedappfm.EndpointUtil.getEnvironnementLabel(session.endpoint), - ), const SizedBox(width: 5), if (session.isConnected == false) Padding( @@ -79,6 +70,7 @@ class _DexEnvState extends ConsumerState { menuChildren: [ if (session.isConnected == false) MenuItemButton( + requestFocusOnHover: false, style: ButtonStyle( shape: MaterialStateProperty.all( const RoundedRectangleBorder( @@ -89,48 +81,39 @@ class _DexEnvState extends ConsumerState { ), ), ), - child: Padding( - padding: const EdgeInsets.only(right: 20), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - SvgPicture.asset( - 'assets/images/AELogo.svg', - semanticsLabel: 'AE Logo', - height: 14, - colorFilter: const ColorFilter.mode( - Colors.red, - BlendMode.srcIn, - ), + child: Row( + children: [ + // TODO(reddwarf03): MAINNET + Text( + '${aedappfm.EndpointUtil.getEnvironnementLabel( + 'https://mainnet.archethic.net', + )} (Soon)', + style: const TextStyle( + fontSize: 12, + // TODO(reddwarf03): MAINNET + color: Colors.grey, ), - const SizedBox(width: 10), - Text( - aedappfm.EndpointUtil.getEnvironnementLabel( - 'https://testnet.archethic.net', - ), - style: const TextStyle( - fontSize: 14, + ), + if (session.endpoint == 'https://mainnet.archethic.net') + const Padding( + padding: EdgeInsets.only(left: 10), + child: Icon( + Icons.check, + size: 18, ), ), - if (session.endpoint == 'https://testnet.archethic.net') - const Padding( - padding: EdgeInsets.only(left: 10), - child: Icon( - Icons.check, - size: 18, - ), - ), - ], - ), + ], ), onPressed: () async { - if (session.endpoint == 'https://testnet.archethic.net') return; + // TODO(reddwarf03): MAINNET + //return; + if (session.endpoint == 'https://mainnet.archethic.net') return; final poolsListDatasource = await HivePoolsListDatasource.getInstance(); await poolsListDatasource.clearAll(); ref .read(SessionProviders.session.notifier) - .connectEndpoint('testnet'); + .connectEndpoint('mainnet'); final preferences = await HivePreferencesDatasource.getInstance(); aedappfm.sl.get().logsActived = @@ -149,48 +132,36 @@ class _DexEnvState extends ConsumerState { ), ), ), - child: Padding( - padding: const EdgeInsets.only(right: 20), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - SvgPicture.asset( - 'assets/images/AELogo.svg', - semanticsLabel: 'AE Logo', - height: 14, - colorFilter: const ColorFilter.mode( - Colors.white, - BlendMode.srcIn, - ), + child: Row( + children: [ + Text( + aedappfm.EndpointUtil.getEnvironnementLabel( + 'https://testnet.archethic.net', ), - const SizedBox(width: 10), - Text( - aedappfm.EndpointUtil.getEnvironnementLabel( - 'https://mainnet.archethic.net', - ), - style: const TextStyle( - fontSize: 14, - ), + style: const TextStyle( + color: Colors.red, + fontSize: 12, ), - if (session.endpoint == 'https://mainnet.archethic.net') - const Padding( - padding: EdgeInsets.only(left: 10), - child: Icon( - Icons.check, - size: 18, - ), + ), + if (session.endpoint == 'https://testnet.archethic.net') + const Padding( + padding: EdgeInsets.only(left: 10), + child: Icon( + Icons.check, + size: 18, + color: Colors.red, ), - ], - ), + ), + ], ), onPressed: () async { - if (session.endpoint == 'https://mainnet.archethic.net') return; + if (session.endpoint == 'https://testnet.archethic.net') return; final poolsListDatasource = await HivePoolsListDatasource.getInstance(); await poolsListDatasource.clearAll(); ref .read(SessionProviders.session.notifier) - .connectEndpoint('mainnet'); + .connectEndpoint('testnet'); final preferences = await HivePreferencesDatasource.getInstance(); aedappfm.sl.get().logsActived = diff --git a/lib/ui/views/util/components/dex_price_impact.dart b/lib/ui/views/util/components/dex_price_impact.dart index cc1fe940..5e2f85aa 100644 --- a/lib/ui/views/util/components/dex_price_impact.dart +++ b/lib/ui/views/util/components/dex_price_impact.dart @@ -27,6 +27,10 @@ class DexPriceImpact extends StatelessWidget { ) ?? Theme.of(context).textTheme.bodyLarge!.copyWith( color: aedappfm.ArchethicThemeBase.systemDanger500, + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ) : priceImpact > 1 ? textStyle?.copyWith( @@ -35,8 +39,20 @@ class DexPriceImpact extends StatelessWidget { Theme.of(context).textTheme.bodyLarge!.copyWith( color: aedappfm.ArchethicThemeBase.systemWarning600, + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), ) - : textStyle ?? Theme.of(context).textTheme.bodyLarge, + : textStyle ?? + Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ) else SelectableText( @@ -56,7 +72,14 @@ class DexPriceImpact extends StatelessWidget { color: aedappfm.ArchethicThemeBase.systemWarning600, ) - : textStyle ?? Theme.of(context).textTheme.bodyLarge, + : textStyle ?? + Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: + aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), if (priceImpact > 1) Padding( diff --git a/lib/ui/views/util/components/dex_ratio.dart b/lib/ui/views/util/components/dex_ratio.dart index ca766a24..f4016a16 100755 --- a/lib/ui/views/util/components/dex_ratio.dart +++ b/lib/ui/views/util/components/dex_ratio.dart @@ -29,14 +29,26 @@ class DexRatio extends StatelessWidget { token2Symbol == token2Symbol.reduceSymbol() ? SelectableText( '${double.parse('1').formatNumber()} ${token1Symbol.reduceSymbol()} = ${ratio.formatNumber()} ${token2Symbol.reduceSymbol()}', - style: textStyle ?? Theme.of(context).textTheme.bodyLarge, + style: textStyle ?? + Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ) : Tooltip( message: '${double.parse('1').formatNumber()} $token1Symbol = ${ratio.formatNumber()} $token2Symbol', child: SelectableText( '${double.parse('1').formatNumber()} ${token1Symbol.reduceSymbol()} = ${ratio.formatNumber()} ${token2Symbol.reduceSymbol()}', - style: textStyle ?? Theme.of(context).textTheme.bodyLarge, + style: textStyle ?? + Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ); diff --git a/lib/ui/views/util/components/dex_token_balance.dart b/lib/ui/views/util/components/dex_token_balance.dart index 1a035a7c..5bd1ef75 100755 --- a/lib/ui/views/util/components/dex_token_balance.dart +++ b/lib/ui/views/util/components/dex_token_balance.dart @@ -67,7 +67,12 @@ class DexTokenBalance extends ConsumerWidget { opacity: opacity, child: SelectableText( '${tokenBalance.formatNumber(precision: 8)} ${getSymbolDisplay(token!, tokenBalance)}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ], @@ -93,7 +98,16 @@ class DexTokenBalance extends ConsumerWidget { ), style: fiatTextStyleMedium ? Theme.of(context).textTheme.bodyMedium - : Theme.of(context).textTheme.bodyLarge, + : Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ) @@ -112,7 +126,18 @@ class DexTokenBalance extends ConsumerWidget { snapshot.data!, style: fiatTextStyleMedium ? Theme.of(context).textTheme.bodyMedium - : Theme.of(context).textTheme.bodyLarge, + : Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyLarge!, + ), + ), ), ); } @@ -146,7 +171,12 @@ class DexTokenBalance extends ConsumerWidget { opacity: opacity, child: SelectableText( '${tokenBalance.formatNumber(precision: 8)} ${getSymbolDisplay(token!, tokenBalance)}', - style: Theme.of(context).textTheme.bodyLarge, + style: Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive.fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), if (withFiat) @@ -167,7 +197,13 @@ class DexTokenBalance extends ConsumerWidget { ), style: fiatTextStyleMedium ? Theme.of(context).textTheme.bodyMedium - : Theme.of(context).textTheme.bodyLarge, + : Theme.of(context).textTheme.bodyLarge!.copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context).textTheme.bodyLarge!, + ), + ), ), ), ) @@ -190,7 +226,18 @@ class DexTokenBalance extends ConsumerWidget { snapshot.data!, style: fiatTextStyleMedium ? Theme.of(context).textTheme.bodyMedium - : Theme.of(context).textTheme.bodyLarge, + : Theme.of(context) + .textTheme + .bodyLarge! + .copyWith( + fontSize: aedappfm.Responsive + .fontSizeFromTextStyle( + context, + Theme.of(context) + .textTheme + .bodyLarge!, + ), + ), ), ), ); diff --git a/lib/ui/views/util/components/format_address_link_copy.dart b/lib/ui/views/util/components/format_address_link_copy.dart index 4bc1efc3..8aed6137 100644 --- a/lib/ui/views/util/components/format_address_link_copy.dart +++ b/lib/ui/views/util/components/format_address_link_copy.dart @@ -41,7 +41,10 @@ class FormatAddressLinkCopy extends ConsumerWidget { child: SelectableText( '$header ${reduceAddress ? aedappfm.AddressUtil.reduceAddress(address) : address}', style: TextStyle( - fontSize: fontSize, + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: fontSize, + ), ), ), ) @@ -53,7 +56,10 @@ class FormatAddressLinkCopy extends ConsumerWidget { ? aedappfm.AddressUtil.reduceAddress(address) : address, style: TextStyle( - fontSize: fontSize, + fontSize: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: fontSize, + ), ), ), ), @@ -84,13 +90,21 @@ class FormatAddressLinkCopy extends ConsumerWidget { child: tooltipCopy == null ? Icon( aedappfm.Iconsax.copy, - size: fontSize - 1, + size: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: fontSize, + ) - + 1, ) : Tooltip( message: tooltipCopy, child: Icon( aedappfm.Iconsax.copy, - size: fontSize - 1, + size: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: fontSize, + ) - + 1, ), ), ), @@ -130,13 +144,21 @@ class FormatAddressLinkCopy extends ConsumerWidget { child: tooltipCopy == null ? Icon( aedappfm.Iconsax.export_3, - size: fontSize - 1, + size: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: fontSize, + ) - + 1, ) : Tooltip( message: tooltipLink, child: Icon( aedappfm.Iconsax.export_3, - size: fontSize - 1, + size: aedappfm.Responsive.fontSizeFromValue( + context, + desktopValue: fontSize, + ) - + 1, ), ), ), diff --git a/lib/ui/views/util/components/pool_info_card.dart b/lib/ui/views/util/components/pool_info_card.dart index d736571e..30fbabff 100755 --- a/lib/ui/views/util/components/pool_info_card.dart +++ b/lib/ui/views/util/components/pool_info_card.dart @@ -28,10 +28,10 @@ class PoolInfoCard extends ConsumerWidget { BuildContext context, WidgetRef ref, ) { - const cardHeight = 125.0; + final cardHeight = aedappfm.Responsive.isDesktop(context) ? 125.0 : 220.0; if (poolGenesisAddress.isEmpty) { - return const SizedBox(height: cardHeight); + return SizedBox(height: cardHeight); } return FutureBuilder( @@ -40,7 +40,7 @@ class PoolInfoCard extends ConsumerWidget { if (snapshot.hasData) { final pool = snapshot.data; if (pool == null) { - return const SizedBox(height: cardHeight); + return SizedBox(height: cardHeight); } final tvl = ref.watch( @@ -62,177 +62,346 @@ class PoolInfoCard extends ConsumerWidget { left: 20, right: 20, ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - DexTokenIcon( - tokenAddress: pool.pair.token1.address == null - ? 'UCO' - : pool.pair.token1.address!, - ), - const SizedBox( - width: 10, - ), - Tooltip( - message: pool.pair.token1.symbol, - child: SelectableText( - pool.pair.token1.symbol.reduceSymbol(), - style: Theme.of(context).textTheme.titleLarge, - ), - ), - const Padding( - padding: EdgeInsets.only(left: 10, right: 10), - child: SelectableText('/'), - ), - DexTokenIcon( - tokenAddress: pool.pair.token2.address == null - ? 'UCO' - : pool.pair.token2.address!, - ), - const SizedBox( - width: 10, - ), - Tooltip( - message: pool.pair.token2.symbol, - child: SelectableText( - pool.pair.token2.symbol.reduceSymbol(), - style: Theme.of(context).textTheme.titleLarge, - ), - ), - ], - ), - const SizedBox( - height: 10, - ), - DexRatio( - ratio: tokenAddressRatioPrimary.toUpperCase() == - pool.pair.token1.address!.toUpperCase() - ? pool.infos!.ratioToken1Token2 - : pool.infos!.ratioToken2Token1, - token1Symbol: tokenAddressRatioPrimary.toUpperCase() == - pool.pair.token1.address!.toUpperCase() - ? pool.pair.token1.symbol.reduceSymbol() - : pool.pair.token2.symbol.reduceSymbol(), - token2Symbol: tokenAddressRatioPrimary.toUpperCase() == - pool.pair.token1.address!.toUpperCase() - ? pool.pair.token2.symbol.reduceSymbol() - : pool.pair.token1.symbol.reduceSymbol(), - ), - const SizedBox( - height: 10, - ), - VerifiedPoolIcon( - isVerified: pool.isVerified, - withLabel: true, - ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.end, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - SelectableText( - AppLocalizations.of(context)!.poolCardPooled, - style: Theme.of(context).textTheme.labelSmall, - ), - const SizedBox( - width: 5, - ), - FormatAddressLink( - address: pool.poolAddress, - typeAddress: TypeAddressLink.chain, - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.end, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - children: [ - VerifiedTokenIcon( - address: pool.pair.token1.address!, + child: aedappfm.Responsive.isDesktop(context) + ? Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + DexTokenIcon( + tokenAddress: pool.pair.token1.address == null + ? 'UCO' + : pool.pair.token1.address!, + ), + const SizedBox( + width: 10, + ), + Tooltip( + message: pool.pair.token1.symbol, + child: SelectableText( + pool.pair.token1.symbol.reduceSymbol(), + style: + Theme.of(context).textTheme.titleLarge, ), - const SizedBox( - width: 5, + ), + const Padding( + padding: EdgeInsets.only(left: 10, right: 10), + child: SelectableText('/'), + ), + DexTokenIcon( + tokenAddress: pool.pair.token2.address == null + ? 'UCO' + : pool.pair.token2.address!, + ), + const SizedBox( + width: 10, + ), + Tooltip( + message: pool.pair.token2.symbol, + child: SelectableText( + pool.pair.token2.symbol.reduceSymbol(), + style: + Theme.of(context).textTheme.titleLarge, ), - Tooltip( - message: pool.pair.token1.symbol, - child: SelectableText( - '${pool.pair.token1.reserve.formatNumber()} ${pool.pair.token1.symbol.reduceSymbol()}', + ), + ], + ), + const SizedBox( + height: 10, + ), + DexRatio( + ratio: tokenAddressRatioPrimary.toUpperCase() == + pool.pair.token1.address!.toUpperCase() + ? pool.infos!.ratioToken1Token2 + : pool.infos!.ratioToken2Token1, + token1Symbol: tokenAddressRatioPrimary + .toUpperCase() == + pool.pair.token1.address!.toUpperCase() + ? pool.pair.token1.symbol.reduceSymbol() + : pool.pair.token2.symbol.reduceSymbol(), + token2Symbol: tokenAddressRatioPrimary + .toUpperCase() == + pool.pair.token1.address!.toUpperCase() + ? pool.pair.token2.symbol.reduceSymbol() + : pool.pair.token1.symbol.reduceSymbol(), + ), + const SizedBox( + height: 10, + ), + VerifiedPoolIcon( + isVerified: pool.isVerified, + withLabel: true, + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + SelectableText( + AppLocalizations.of(context)!.poolCardPooled, + style: Theme.of(context).textTheme.labelSmall, + ), + const SizedBox( + width: 5, + ), + FormatAddressLink( + address: pool.poolAddress, + typeAddress: TypeAddressLink.chain, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + VerifiedTokenIcon( + address: pool.pair.token1.address!, + ), + const SizedBox( + width: 5, + ), + Tooltip( + message: pool.pair.token1.symbol, + child: SelectableText( + '${pool.pair.token1.reserve.formatNumber()} ${pool.pair.token1.symbol.reduceSymbol()}', + ), + ), + const SizedBox( + width: 5, + ), + if (pool.pair.token1.isUCO == false) + FormatAddressLink( + address: pool.pair.token1.address!, + ) + else + const SizedBox( + width: 12, + ), + ], ), - ), - const SizedBox( - width: 5, - ), - if (pool.pair.token1.isUCO == false) - FormatAddressLink( - address: pool.pair.token1.address!, - ) - else - const SizedBox( - width: 12, + Row( + children: [ + VerifiedTokenIcon( + address: pool.pair.token2.address!, + ), + const SizedBox( + width: 5, + ), + Tooltip( + message: pool.pair.token2.symbol, + child: SelectableText( + '${pool.pair.token2.reserve.formatNumber()} ${pool.pair.token2.symbol.reduceSymbol()}', + ), + ), + const SizedBox( + width: 5, + ), + if (pool.pair.token2.isUCO == false) + FormatAddressLink( + address: pool.pair.token2.address!, + ) + else + const SizedBox( + width: 12, + ), + ], ), - ], - ), - Row( - children: [ - VerifiedTokenIcon( - address: pool.pair.token2.address!, + ], + ), + ], + ), + SelectableText( + 'TVL: \$${tvl.formatNumber(precision: 2)}', + ), + DexFees( + fees: pool.infos!.fees, + ), + ], + ), + ], + ) + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + children: [ + Row( + children: [ + DexTokenIcon( + tokenAddress: pool.pair.token1.address == null + ? 'UCO' + : pool.pair.token1.address!, + ), + const SizedBox( + width: 10, + ), + Tooltip( + message: pool.pair.token1.symbol, + child: SelectableText( + pool.pair.token1.symbol.reduceSymbol(), + style: + Theme.of(context).textTheme.titleLarge, ), - const SizedBox( - width: 5, + ), + const Padding( + padding: EdgeInsets.only(left: 10, right: 10), + child: SelectableText('/'), + ), + DexTokenIcon( + tokenAddress: pool.pair.token2.address == null + ? 'UCO' + : pool.pair.token2.address!, + ), + const SizedBox( + width: 10, + ), + Tooltip( + message: pool.pair.token2.symbol, + child: SelectableText( + pool.pair.token2.symbol.reduceSymbol(), + style: + Theme.of(context).textTheme.titleLarge, ), - Tooltip( - message: pool.pair.token2.symbol, - child: SelectableText( - '${pool.pair.token2.reserve.formatNumber()} ${pool.pair.token2.symbol.reduceSymbol()}', + ), + ], + ), + const SizedBox( + height: 10, + ), + DexRatio( + ratio: tokenAddressRatioPrimary.toUpperCase() == + pool.pair.token1.address!.toUpperCase() + ? pool.infos!.ratioToken1Token2 + : pool.infos!.ratioToken2Token1, + token1Symbol: tokenAddressRatioPrimary + .toUpperCase() == + pool.pair.token1.address!.toUpperCase() + ? pool.pair.token1.symbol.reduceSymbol() + : pool.pair.token2.symbol.reduceSymbol(), + token2Symbol: tokenAddressRatioPrimary + .toUpperCase() == + pool.pair.token1.address!.toUpperCase() + ? pool.pair.token2.symbol.reduceSymbol() + : pool.pair.token1.symbol.reduceSymbol(), + ), + const SizedBox( + height: 10, + ), + VerifiedPoolIcon( + isVerified: pool.isVerified, + withLabel: true, + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + SelectableText( + AppLocalizations.of(context)!.poolCardPooled, + style: Theme.of(context).textTheme.labelSmall, + ), + const SizedBox( + width: 5, + ), + FormatAddressLink( + address: pool.poolAddress, + typeAddress: TypeAddressLink.chain, + ), + ], + ), + Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + VerifiedTokenIcon( + address: pool.pair.token1.address!, + ), + const SizedBox( + width: 5, + ), + Tooltip( + message: pool.pair.token1.symbol, + child: SelectableText( + '${pool.pair.token1.reserve.formatNumber()} ${pool.pair.token1.symbol.reduceSymbol()}', + ), + ), + const SizedBox( + width: 5, + ), + if (pool.pair.token1.isUCO == false) + FormatAddressLink( + address: pool.pair.token1.address!, + ) + else + const SizedBox( + width: 12, + ), + ], ), - ), - const SizedBox( - width: 5, - ), - if (pool.pair.token2.isUCO == false) - FormatAddressLink( - address: pool.pair.token2.address!, - ) - else - const SizedBox( - width: 12, + Row( + children: [ + VerifiedTokenIcon( + address: pool.pair.token2.address!, + ), + const SizedBox( + width: 5, + ), + Tooltip( + message: pool.pair.token2.symbol, + child: SelectableText( + '${pool.pair.token2.reserve.formatNumber()} ${pool.pair.token2.symbol.reduceSymbol()}', + ), + ), + const SizedBox( + width: 5, + ), + if (pool.pair.token2.isUCO == false) + FormatAddressLink( + address: pool.pair.token2.address!, + ) + else + const SizedBox( + width: 12, + ), + ], ), - ], - ), - ], - ), - ], - ), - SelectableText( - 'TVL: \$${tvl.formatNumber(precision: 2)}', - ), - DexFees( - fees: pool.infos!.fees, - ), - ], - ), - ], - ), + ], + ), + ], + ), + SelectableText( + 'TVL: \$${tvl.formatNumber(precision: 2)}', + ), + DexFees( + fees: pool.infos!.fees, + ), + ], + ), + ], + ), ), ) .animate() .fade(duration: const Duration(milliseconds: 200)) .scale(duration: const Duration(milliseconds: 200)); } - return const SizedBox(height: cardHeight); + return SizedBox(height: cardHeight); }, ); } diff --git a/lib/ui/views/util/router/router.dart b/lib/ui/views/util/router/router.dart index c4dc8003..2ef08566 100644 --- a/lib/ui/views/util/router/router.dart +++ b/lib/ui/views/util/router/router.dart @@ -335,13 +335,13 @@ final routerProvider = Provider( }); var session = ref.read(SessionProviders.session); - if (session.isConnected == false) { + if (session.isConnected == false && session.endpoint.isEmpty) { await ref.read(SessionProviders.session.notifier).connectToWallet( forceConnection: false, ); } session = ref.read(SessionProviders.session); - if (session.isConnected == false) { + if (session.isConnected == false && session.endpoint.isEmpty) { if (context.mounted) { ref .read(SessionProviders.session.notifier) diff --git a/pubspec.lock b/pubspec.lock index 353c5173..5371dfd7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: "direct main" description: name: archethic_dapp_framework_flutter - sha256: c0391de6003ed358d977c6bb46c9632516321e973b0b82398c911241e24eb75f + sha256: a2212dc60e645f13dc21b5e5f304b331128da2ee63bfd823a98fa250fac3a229 url: "https://pub.dev" source: hosted - version: "0.0.3" + version: "0.0.4" archethic_lib_dart: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 7ab3a996..d981d71c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: aedex description: Enable direct peer-to-peer trading of digital assets on the Archethic blockchain, eliminating the need for centralized intermediaries. publish_to: "none" -version: 0.0.11+31 +version: 0.0.11+32 environment: sdk: ">=3.1.0 <4.0.0"