From 778b8465a3bee4ed027b8044c0f7d6e69d7c02a2 Mon Sep 17 00:00:00 2001 From: d-reader-luka Date: Mon, 22 Apr 2024 15:50:15 +0200 Subject: [PATCH] chore: prevent app update dialog on dapp store change mint box ui --- assets/icons/lock.svg | 5 + .../screens/comic_issue_details.dart | 4 +- .../widgets/tabs/about/about.dart | 2 +- .../tabs/about/expandable_container.dart | 265 +++++++++++------- .../presentation/widgets/follow_box.dart | 3 +- .../widgets/cards/owned_issue_card.dart | 10 +- .../animations/mint_animation_screen.dart | 240 ++++++++-------- .../widgets/install_wallet_bottom_sheet.dart | 8 +- lib/main_dev.dart | 9 +- lib/main_prod.dart | 9 +- .../dio_network_service_provider.dart | 1 + .../check_for_app_version_provider.dart | 8 + lib/shared/utils/formatter.dart | 4 + lib/shared/utils/url_utils.dart | 2 +- .../widgets/icons/favorite_icon_count.dart | 5 +- .../widgets/wrappers/app_update_wrapper.dart | 2 +- publishing/config.yaml | 2 +- 17 files changed, 335 insertions(+), 244 deletions(-) create mode 100644 assets/icons/lock.svg diff --git a/assets/icons/lock.svg b/assets/icons/lock.svg new file mode 100644 index 00000000..16fc8838 --- /dev/null +++ b/assets/icons/lock.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/lib/features/comic_issue/presentation/screens/comic_issue_details.dart b/lib/features/comic_issue/presentation/screens/comic_issue_details.dart index 689b94ba..00d5faa0 100644 --- a/lib/features/comic_issue/presentation/screens/comic_issue_details.dart +++ b/lib/features/comic_issue/presentation/screens/comic_issue_details.dart @@ -146,7 +146,9 @@ class _ComicIssueDetailsState extends ConsumerState child: Stack( children: [ CachedImageBgPlaceholder( - height: 431, + height: MediaQuery.sizeOf(context).height > 780 + ? 431 + : 460, imageUrl: issue.cover, overrideBorderRadius: BorderRadius.circular(0), foregroundDecoration: BoxDecoration( diff --git a/lib/features/comic_issue/presentation/widgets/tabs/about/about.dart b/lib/features/comic_issue/presentation/widgets/tabs/about/about.dart index eb212866..e36d7503 100644 --- a/lib/features/comic_issue/presentation/widgets/tabs/about/about.dart +++ b/lib/features/comic_issue/presentation/widgets/tabs/about/about.dart @@ -62,7 +62,7 @@ class IssueAbout extends ConsumerWidget { height: 16, ), ...snapshot.data?.groups.map((candyMachineGroup) { - return ExpandableContainer( + return MintInfoContainer( candyMachineGroup: candyMachineGroup, totalSupply: snapshot.data?.supply ?? 0, ); diff --git a/lib/features/comic_issue/presentation/widgets/tabs/about/expandable_container.dart b/lib/features/comic_issue/presentation/widgets/tabs/about/expandable_container.dart index 351dde1a..9a0d2157 100644 --- a/lib/features/comic_issue/presentation/widgets/tabs/about/expandable_container.dart +++ b/lib/features/comic_issue/presentation/widgets/tabs/about/expandable_container.dart @@ -6,6 +6,7 @@ import 'package:d_reader_flutter/shared/theme/app_colors.dart'; import 'package:d_reader_flutter/shared/utils/formatter.dart'; import 'package:d_reader_flutter/shared/widgets/unsorted/solana_price.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; String mintNumbersText({required int itemsMinted, required int totalSupply}) { @@ -16,10 +17,10 @@ String myMintNumbersText({required int itemsMinted, int? supply}) { return 'You minted: $itemsMinted/${supply ?? '∞'}'; } -class ExpandableContainer extends ConsumerWidget { +class MintInfoContainer extends ConsumerWidget { final CandyMachineGroupModel candyMachineGroup; final int totalSupply; - const ExpandableContainer({ + const MintInfoContainer({ super.key, required this.candyMachineGroup, required this.totalSupply, @@ -36,118 +37,168 @@ class ExpandableContainer extends ConsumerWidget { ref.read(expandedCandyMachineGroup.notifier).update((state) => state != candyMachineGroup.label ? candyMachineGroup.label : ''); }, - child: AnimatedContainer( - height: ref.watch(expandedCandyMachineGroup) == candyMachineGroup.label - ? 108 - : 46, - duration: const Duration(milliseconds: 150), - margin: const EdgeInsets.only(bottom: 8), - child: _DecoratedContainer( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Text( - candyMachineGroup.displayLabel, - style: textTheme.titleMedium, - ), - const SizedBox( - width: 4, - ), + child: _DecoratedContainer( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Text( + 'Mint', + style: textTheme.titleMedium, + ), + const SizedBox( + width: 4, + ), + candyMachineGroup.isActive + ? const CircleAvatar( + backgroundColor: ColorPalette.dReaderYellow100, + radius: 6, + ) + : const SizedBox(), + const SizedBox( + width: 4, + ), + Text( candyMachineGroup.isActive - ? const CircleAvatar( - backgroundColor: ColorPalette.dReaderYellow100, - radius: 6, - ) - : const SizedBox(), - const SizedBox( - width: 4, - ), - Text( - candyMachineGroup.isActive - ? 'Live' + ? 'Live' + : isFutureMint + ? 'Starts in ${Formatter.formatDateInRelative(candyMachineGroup.startDate)}' + : 'Ended', + style: textTheme.titleMedium?.copyWith( + color: candyMachineGroup.isActive + ? ColorPalette.dReaderYellow100 : isFutureMint - ? 'Starts in ${Formatter.formatDateInRelative(candyMachineGroup.startDate)}' - : 'Ended', - style: textTheme.titleMedium?.copyWith( - color: candyMachineGroup.isActive - ? ColorPalette.dReaderYellow100 - : isFutureMint - ? ColorPalette.dReaderYellow300 - : ColorPalette.greyscale200, - ), + ? ColorPalette.dReaderYellow300 + : ColorPalette.greyscale200, ), - ], - ), - SolanaPrice( - price: candyMachineGroup.mintPrice > 0 - ? Formatter.formatPriceWithSignificant( - candyMachineGroup.mintPrice.round(), - ) - : null, - ) - ], - ), - Column( - children: [ - const SizedBox( - height: 16, - ), - LinearProgressIndicator( - backgroundColor: ColorPalette.greyscale400, - minHeight: 8, - valueColor: AlwaysStoppedAnimation( - candyMachineGroup.isActive - ? ColorPalette.dReaderYellow100 - : ColorPalette.greyscale200, ), - value: candyMachineGroup.itemsMinted / - candyMachineGroup.supply, - borderRadius: BorderRadius.circular(8), + ], + ), + SolanaPrice( + price: candyMachineGroup.mintPrice > 0 + ? Formatter.formatPriceWithSignificant( + candyMachineGroup.mintPrice.round(), + ) + : null, + ) + ], + ), + const SizedBox( + height: 24, + ), + if (candyMachineGroup.isActive) ...[ + LinearProgressIndicator( + backgroundColor: ColorPalette.greyscale400, + minHeight: 8, + valueColor: AlwaysStoppedAnimation( + candyMachineGroup.isActive + ? ColorPalette.dReaderYellow100 + : ColorPalette.greyscale200, + ), + value: candyMachineGroup.itemsMinted / candyMachineGroup.supply, + borderRadius: BorderRadius.circular(8), + ), + const SizedBox( + height: 24, + ), + ], + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + myMintNumbersText( + itemsMinted: candyMachineGroup.user?.itemsMinted ?? + candyMachineGroup.wallet?.itemsMinted ?? + 0, + supply: candyMachineGroup.user?.supply ?? + candyMachineGroup.wallet?.supply, ), - const SizedBox( - height: 8, + style: textTheme.bodySmall?.copyWith( + color: ColorPalette.greyscale100, ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - myMintNumbersText( - itemsMinted: candyMachineGroup.user?.itemsMinted ?? - candyMachineGroup.wallet?.itemsMinted ?? - 0, - supply: candyMachineGroup.user?.supply ?? - candyMachineGroup.wallet?.supply, - ), - style: textTheme.bodySmall?.copyWith( - color: ColorPalette.greyscale100, + ), + Text( + candyMachineGroup.label == publicGroupLabel + ? mintNumbersText( + itemsMinted: candyMachineState?.itemsMinted ?? + candyMachineGroup.itemsMinted, + totalSupply: candyMachineState?.supply ?? + candyMachineGroup.supply) + : mintNumbersText( + itemsMinted: candyMachineGroup.itemsMinted, + totalSupply: candyMachineGroup.supply, ), - ), - Text( - candyMachineGroup.label == publicGroupLabel - ? mintNumbersText( - itemsMinted: candyMachineState?.itemsMinted ?? - candyMachineGroup.itemsMinted, - totalSupply: candyMachineState?.supply ?? - candyMachineGroup.supply) - : mintNumbersText( - itemsMinted: candyMachineGroup.itemsMinted, - totalSupply: candyMachineGroup.supply, - ), - style: textTheme.bodySmall?.copyWith( - color: ColorPalette.greyscale100, - ), - ), - ], + style: textTheme.bodySmall?.copyWith( + color: ColorPalette.greyscale100, ), - ], - ), - ], - ), + ), + ], + ), + const SizedBox( + height: 16, + ), + const _ComicVaultContainer(), + ], + ), + ), + ); + } +} + +class _ComicVaultContainer extends ConsumerWidget { + const _ComicVaultContainer(); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final textTheme = Theme.of(context).textTheme; + return Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: ColorPalette.greyscale400, + ), + child: GestureDetector( + onTap: () { + ref + .read(expandedCandyMachineGroup.notifier) + .update((state) => state == 'ComicVault' ? '' : 'ComicVault'); + }, + child: Column( + children: [ + Row( + children: [ + SvgPicture.asset( + 'assets/icons/lock.svg', + ), + const SizedBox( + width: 8, + ), + Text( + 'Comic Vault', + style: textTheme.bodySmall?.copyWith( + color: ColorPalette.greyscale100, + ), + ), + ], + ), + // Column( + // children: [ + // const SizedBox( + // height: 8, + // ), + // Text( + // 'Comic Vault stores portion of the supply of each issue to later use in giveaways & other activities where we reward loyal users', + // style: textTheme.bodySmall?.copyWith( + // color: ColorPalette.greyscale100, + // ), + // ), + // ], + // ), + ], ), ), ); @@ -165,7 +216,7 @@ class _DecoratedContainer extends StatelessWidget { return SingleChildScrollView( physics: const NeverScrollableScrollPhysics(), child: Container( - padding: const EdgeInsets.all(12), + padding: const EdgeInsets.all(16), decoration: BoxDecoration( color: ColorPalette.greyscale500, borderRadius: BorderRadius.circular(8), diff --git a/lib/features/creator/presentation/widgets/follow_box.dart b/lib/features/creator/presentation/widgets/follow_box.dart index 560ac780..8904d9df 100644 --- a/lib/features/creator/presentation/widgets/follow_box.dart +++ b/lib/features/creator/presentation/widgets/follow_box.dart @@ -2,6 +2,7 @@ import 'package:d_reader_flutter/features/creator/domain/providers/creator_provi import 'package:d_reader_flutter/features/library/presentation/providers/creators/creators_providers.dart'; import 'package:d_reader_flutter/shared/presentations/providers/common/count_provider.dart'; import 'package:d_reader_flutter/shared/theme/app_colors.dart'; +import 'package:d_reader_flutter/shared/utils/formatter.dart'; import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; @@ -70,7 +71,7 @@ class FollowBox extends HookConsumerWidget { color: ColorPalette.greyscale400, ), child: Text( - '${followingHook.value.count}', + Formatter.formatCount(followingHook.value.count), textAlign: TextAlign.center, style: textTheme.titleMedium?.copyWith( color: ColorPalette.greyscale100, diff --git a/lib/features/library/presentation/widgets/cards/owned_issue_card.dart b/lib/features/library/presentation/widgets/cards/owned_issue_card.dart index b8e23123..cb5b0823 100644 --- a/lib/features/library/presentation/widgets/cards/owned_issue_card.dart +++ b/lib/features/library/presentation/widgets/cards/owned_issue_card.dart @@ -1,3 +1,4 @@ +import 'package:d_reader_flutter/constants/constants.dart'; import 'package:d_reader_flutter/constants/routes.dart'; import 'package:d_reader_flutter/features/comic_issue/domain/models/owned_issue.dart'; import 'package:d_reader_flutter/features/library/presentation/providers/owned/owned_controller.dart'; @@ -41,9 +42,12 @@ class OwnedIssueCard extends ConsumerWidget { children: [ Expanded( flex: 3, - child: CachedImageBgPlaceholder( - imageUrl: issue.cover, - bgImageFit: BoxFit.fill, + child: AspectRatio( + aspectRatio: comicIssueAspectRatio, + child: CachedImageBgPlaceholder( + imageUrl: issue.cover, + bgImageFit: BoxFit.cover, + ), ), ), const SizedBox( diff --git a/lib/features/nft/presentation/screens/animations/mint_animation_screen.dart b/lib/features/nft/presentation/screens/animations/mint_animation_screen.dart index 60ec1d12..0abb4b64 100644 --- a/lib/features/nft/presentation/screens/animations/mint_animation_screen.dart +++ b/lib/features/nft/presentation/screens/animations/mint_animation_screen.dart @@ -132,21 +132,25 @@ class _DoneMintingAnimationState extends State with TickerProviderStateMixin { late VideoPlayerController _controller; late Future _initializeVideoPlayerFuture; - late final AnimationController _animationController; + late final AnimationController _fadeAnimationController; late final AnimationController _bgAnimationController; - + late final Animation _scaleAnimationController; @override void initState() { super.initState(); _controller = VideoPlayerController.asset('assets/animation_files/nft-mint-bg.mp4'); - _animationController = AnimationController( + _fadeAnimationController = AnimationController( vsync: this, duration: const Duration(milliseconds: 1500), ); + _scaleAnimationController = CurvedAnimation( + parent: _fadeAnimationController, + curve: Curves.bounceOut, + ); _bgAnimationController = AnimationController( vsync: this, - duration: const Duration(milliseconds: 2500), + duration: const Duration(milliseconds: 2000), ); _initializeVideoPlayerFuture = _controller.initialize(); _controller.setLooping(true); @@ -155,10 +159,10 @@ class _DoneMintingAnimationState extends State _bgAnimationController.forward(); Future.delayed( const Duration( - milliseconds: 2000, + milliseconds: 1300, ), () { - _animationController.forward(); + _fadeAnimationController.forward(); }, ); } @@ -166,7 +170,7 @@ class _DoneMintingAnimationState extends State @override void dispose() { _controller.dispose(); - _animationController.dispose(); + _fadeAnimationController.dispose(); _bgAnimationController.dispose(); super.dispose(); } @@ -206,127 +210,131 @@ class _DoneMintingAnimationState extends State }, ), FadeTransition( - opacity: _animationController, - child: GestureDetector( - onTap: () { - nextScreenReplace( - context: context, - path: '${RoutePath.nftDetails}/${widget.nft.address}', - homeSubRoute: true, - ); - }, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AspectRatio( - aspectRatio: 276 / 220, - child: CachedNetworkImage( - imageUrl: widget.nft.image, - ), - ), - const SizedBox( - height: 8, - ), - Text( - widget.nft.comicName, - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.w500, - color: ColorPalette.greyscale100, + opacity: _fadeAnimationController, + child: ScaleTransition( + scale: _scaleAnimationController, + child: GestureDetector( + onTap: () { + nextScreenReplace( + context: context, + path: '${RoutePath.nftDetails}/${widget.nft.address}', + homeSubRoute: true, + ); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AspectRatio( + aspectRatio: 276 / 220, + child: CachedNetworkImage( + imageUrl: widget.nft.image, + ), ), - ), - const SizedBox( - height: 8, - ), - Text( - 'Congrats! You own ${shortenNftName(widget.nft.name)}', - style: const TextStyle( - fontSize: 18, - fontWeight: FontWeight.w700, + const SizedBox( + height: 8, ), - ), - const SizedBox( - height: 16, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const RoyaltyWidget( - iconPath: 'assets/icons/mint_icon.svg', - text: 'Mint', - color: ColorPalette.dReaderGreen, + Text( + widget.nft.comicName, + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: ColorPalette.greyscale100, ), - widget.nft.isSigned - ? const RoyaltyWidget( - iconPath: 'assets/icons/signed_icon.svg', - text: 'Signed', - color: ColorPalette.dReaderOrange, - ) - : const SizedBox(), - RarityWidget( - rarity: widget.nft.rarity.rarityEnum, - iconPath: 'assets/icons/rarity.svg', + ), + const SizedBox( + height: 8, + ), + Text( + 'Congrats! You own ${shortenNftName(widget.nft.name)}', + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.w700, ), - ], - ), - const SizedBox( - height: 16, - ), - Consumer( - builder: (context, ref, child) { - return GestureDetector( - onTap: () async { - final nft = widget.nft; - final dReaderWebUrl = ref - .read(environmentProvider) - .solanaCluster == - SolanaCluster.devnet.value - ? 'https://dev-devnet.dreader.app/mint/${nft.comicIssueId}' - : 'https://dreader.app/mint/${nft.comicIssueId}'; - final uri = Uri.encodeFull( - 'https://twitter.com/intent/tweet?text=I just minted a ${nft.rarity.toLowerCase()} copy of the ${nft.name.split('#')[0]}!\n\nMint yours here while the supply lasts.👇\n\n$dReaderWebUrl', - ); - await openUrl(uri); - }, - child: Container( - padding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 8, - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular( - 8, - ), - border: Border.all( - color: Colors.white, + ), + const SizedBox( + height: 16, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const RoyaltyWidget( + iconPath: 'assets/icons/mint_icon.svg', + text: 'Mint', + color: ColorPalette.dReaderGreen, + ), + widget.nft.isSigned + ? const RoyaltyWidget( + iconPath: 'assets/icons/signed_icon.svg', + text: 'Signed', + color: ColorPalette.dReaderOrange, + ) + : const SizedBox(), + RarityWidget( + rarity: widget.nft.rarity.rarityEnum, + iconPath: 'assets/icons/rarity.svg', + ), + ], + ), + const SizedBox( + height: 16, + ), + Consumer( + builder: (context, ref, child) { + return GestureDetector( + onTap: () async { + final nft = widget.nft; + final dReaderWebUrl = ref + .read(environmentProvider) + .solanaCluster == + SolanaCluster.devnet.value + ? 'https://dev-devnet.dreader.app/mint/${nft.comicIssueId}' + : 'https://dreader.app/mint/${nft.comicIssueId}'; + final uri = Uri.encodeFull( + 'https://twitter.com/intent/tweet?text=I just minted a ${nft.rarity.toLowerCase()} copy of the ${nft.name.split('#')[0]}!\n\nMint yours here while the supply lasts.👇\n\n$dReaderWebUrl', + ); + await openUrl(uri); + }, + child: Container( + padding: const EdgeInsets.symmetric( + horizontal: 16, + vertical: 8, ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Text( - 'Share on', - style: Theme.of(context).textTheme.bodySmall, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular( + 8, ), - const SizedBox( - width: 8, + border: Border.all( + color: Colors.white, ), - SvgPicture.asset( - 'assets/icons/x.svg', - ), - ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + 'Share on', + style: + Theme.of(context).textTheme.bodySmall, + ), + const SizedBox( + width: 8, + ), + SvgPicture.asset( + 'assets/icons/x.svg', + ), + ], + ), ), - ), - ); - }, - ), - ], + ); + }, + ), + ], + ), ), ), ), FadeTransition( - opacity: _animationController, + opacity: _fadeAnimationController, child: Container( alignment: Alignment.bottomCenter, padding: const EdgeInsets.all(8), diff --git a/lib/features/wallet/presentation/widgets/install_wallet_bottom_sheet.dart b/lib/features/wallet/presentation/widgets/install_wallet_bottom_sheet.dart index cf2337fa..2861bbac 100644 --- a/lib/features/wallet/presentation/widgets/install_wallet_bottom_sheet.dart +++ b/lib/features/wallet/presentation/widgets/install_wallet_bottom_sheet.dart @@ -52,7 +52,7 @@ class InstallWalletBottomSheet extends ConsumerWidget { appName: 'Espresso Cash', iconPath: 'assets/icons/wallets/espresso_cash.png', onPressed: () { - openExternalApp('com.pleasecrypto.flutter'); + openPlayStoreApp('com.pleasecrypto.flutter'); }, ), const Divider( @@ -62,7 +62,7 @@ class InstallWalletBottomSheet extends ConsumerWidget { appName: 'Ultimate', iconPath: 'assets/icons/wallets/ultimate.svg', onPressed: () { - openExternalApp('fi.unstoppable.ultimate.android'); + openPlayStoreApp('fi.unstoppable.ultimate.android'); }, ), const Divider( @@ -72,7 +72,7 @@ class InstallWalletBottomSheet extends ConsumerWidget { appName: 'Solflare', iconPath: 'assets/icons/wallets/solflare.svg', onPressed: () { - openExternalApp('com.solflare.mobile'); + openPlayStoreApp('com.solflare.mobile'); }, ), const Divider( @@ -82,7 +82,7 @@ class InstallWalletBottomSheet extends ConsumerWidget { appName: 'Phantom', iconPath: 'assets/icons/wallets/phantom.svg', onPressed: () { - openExternalApp('app.phantom'); + openPlayStoreApp('app.phantom'); }, ), ], diff --git a/lib/main_dev.dart b/lib/main_dev.dart index 592e79bd..232321ae 100644 --- a/lib/main_dev.dart +++ b/lib/main_dev.dart @@ -119,14 +119,17 @@ class MyApp extends ConsumerWidget { selectionColor: ColorPalette.dReaderBlue, selectionHandleColor: ColorPalette.dReaderYellow100, ), - dialogTheme: const DialogTheme( + dialogTheme: DialogTheme( backgroundColor: ColorPalette.greyscale400, - contentTextStyle: TextStyle( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + contentTextStyle: const TextStyle( fontSize: 16, fontWeight: FontWeight.w500, color: Colors.white, ), - titleTextStyle: TextStyle( + titleTextStyle: const TextStyle( fontSize: 18, fontWeight: FontWeight.w700, color: Colors.white, diff --git a/lib/main_prod.dart b/lib/main_prod.dart index 1367aeda..46c6b5de 100644 --- a/lib/main_prod.dart +++ b/lib/main_prod.dart @@ -130,14 +130,17 @@ class MyApp extends ConsumerWidget { selectionColor: ColorPalette.dReaderBlue, selectionHandleColor: ColorPalette.dReaderYellow100, ), - dialogTheme: const DialogTheme( + dialogTheme: DialogTheme( backgroundColor: ColorPalette.greyscale400, - contentTextStyle: TextStyle( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + contentTextStyle: const TextStyle( fontSize: 16, fontWeight: FontWeight.w500, color: Colors.white, ), - titleTextStyle: TextStyle( + titleTextStyle: const TextStyle( fontSize: 18, fontWeight: FontWeight.w700, color: Colors.white, diff --git a/lib/shared/domain/providers/dio_network_service_provider.dart b/lib/shared/domain/providers/dio_network_service_provider.dart index a6e9b13b..10e18254 100644 --- a/lib/shared/domain/providers/dio_network_service_provider.dart +++ b/lib/shared/domain/providers/dio_network_service_provider.dart @@ -76,6 +76,7 @@ final networkServiceProvider = Provider( return handler .resolve(await refreshTokenDio.fetch(error.requestOptions)); } + return handler.next(error); }, ), ], diff --git a/lib/shared/presentations/providers/app_version/check_for_app_version_provider.dart b/lib/shared/presentations/providers/app_version/check_for_app_version_provider.dart index e8bcf4ac..9b993093 100644 --- a/lib/shared/presentations/providers/app_version/check_for_app_version_provider.dart +++ b/lib/shared/presentations/providers/app_version/check_for_app_version_provider.dart @@ -1,12 +1,14 @@ import 'dart:io' show Platform; import 'package:d_reader_flutter/shared/data/local/local_store.dart'; import 'package:d_reader_flutter/shared/presentations/providers/global/global_providers.dart'; +import 'package:device_info_plus/device_info_plus.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:upgrader/upgrader.dart'; part 'check_for_app_version_provider.g.dart'; const String appCheckKey = 'app_check_date'; +const String sagaModel = 'Saga'; @riverpod Future shouldTriggerAppVersionUpdate(Ref ref) async { @@ -54,6 +56,12 @@ bool _areDifferentVersions({ Future getStoreVersion(String myAppBundleId) async { String? storeVersion; + final deviceModel = + await DeviceInfoPlugin().deviceInfo.then((value) => value.data['model']); + + if (deviceModel == sagaModel) { + return null; + } if (Platform.isAndroid) { PlayStoreSearchAPI playStoreSearchAPI = PlayStoreSearchAPI(); final result = await playStoreSearchAPI.lookupById(myAppBundleId); diff --git a/lib/shared/utils/formatter.dart b/lib/shared/utils/formatter.dart index 40bfffec..19670cf6 100644 --- a/lib/shared/utils/formatter.dart +++ b/lib/shared/utils/formatter.dart @@ -81,4 +81,8 @@ class Formatter { return formatted; } } + + static String formatCount(int count) { + return NumberFormat.compact().format(count); + } } diff --git a/lib/shared/utils/url_utils.dart b/lib/shared/utils/url_utils.dart index fdc541ff..ba3a0f42 100644 --- a/lib/shared/utils/url_utils.dart +++ b/lib/shared/utils/url_utils.dart @@ -15,7 +15,7 @@ Future openUrl( } } -Future openExternalApp(String appId) async { +Future openPlayStoreApp(String appId) async { final url = Uri.parse("market://details?id=$appId"); launchUrl( url, diff --git a/lib/shared/widgets/icons/favorite_icon_count.dart b/lib/shared/widgets/icons/favorite_icon_count.dart index 3e3a6f8c..fe4c150e 100644 --- a/lib/shared/widgets/icons/favorite_icon_count.dart +++ b/lib/shared/widgets/icons/favorite_icon_count.dart @@ -3,6 +3,7 @@ import 'package:d_reader_flutter/features/comic_issue/domain/providers/comic_iss import 'package:d_reader_flutter/features/comic_issue/presentation/providers/comic_issue_providers.dart'; import 'package:d_reader_flutter/shared/presentations/providers/global/global_providers.dart'; import 'package:d_reader_flutter/shared/theme/app_colors.dart'; +import 'package:d_reader_flutter/shared/utils/formatter.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; @@ -74,7 +75,7 @@ class FavoriteIconCount extends HookConsumerWidget { width: 4, ), Text( - favouritesCount.toString(), + Formatter.formatCount(favouritesCount), style: textTheme.bodyMedium?.copyWith( color: ColorPalette.greyscale100, letterSpacing: .2, @@ -96,7 +97,7 @@ class FavoriteIconCount extends HookConsumerWidget { width: 4, ), Text( - favouritesCount.toString(), + Formatter.formatCount(favouritesCount), style: textTheme.bodySmall?.copyWith( color: ColorPalette.greyscale100, ), diff --git a/lib/shared/widgets/wrappers/app_update_wrapper.dart b/lib/shared/widgets/wrappers/app_update_wrapper.dart index ec301a91..69176c4f 100644 --- a/lib/shared/widgets/wrappers/app_update_wrapper.dart +++ b/lib/shared/widgets/wrappers/app_update_wrapper.dart @@ -2,7 +2,7 @@ import 'dart:io' show Platform; import 'package:d_reader_flutter/shared/presentations/providers/app_version/check_for_app_version_provider.dart'; import 'package:d_reader_flutter/shared/widgets/scaffolds/d_reader_scaffold.dart'; -import 'package:flutter/widgets.dart'; +import 'package:flutter/material.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:upgrader/upgrader.dart'; diff --git a/publishing/config.yaml b/publishing/config.yaml index 017c2dc1..5e35d27c 100644 --- a/publishing/config.yaml +++ b/publishing/config.yaml @@ -13,7 +13,7 @@ app: urls: license_url: https://github.com/d-reader-organization/d-reader-flutter/blob/main/LICENSE copyright_url: https://github.com/d-reader-organization/d-reader-flutter/blob/main/LICENSE - privacy_policy_url: https://dreader.io/ + privacy_policy_url: https://dreader.app/privacy-policy website: https://dreader.io/ media: - purpose: icon