From 9c15d0f76b80382d3fc768ed410410dbb4fe4295 Mon Sep 17 00:00:00 2001 From: Chralu Date: Tue, 21 May 2024 10:25:41 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20DAppCard=20click=20is=20disabled?= =?UTF-8?q?=20when=20`link=20=3D=3D=20null`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ui/views/dapps/components/card_dapps.dart | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/lib/ui/views/dapps/components/card_dapps.dart b/lib/ui/views/dapps/components/card_dapps.dart index a64b708f3..d947d986f 100644 --- a/lib/ui/views/dapps/components/card_dapps.dart +++ b/lib/ui/views/dapps/components/card_dapps.dart @@ -28,6 +28,8 @@ class CardDapps extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final preferences = ref.watch(SettingsProviders.settings); + final link = dAppsInfo.dAppLink; + return Padding( padding: const EdgeInsets.only(bottom: 20), child: ClipRRect( @@ -58,20 +60,26 @@ class CardDapps extends ConsumerWidget { color: aedappfm.AppThemeBase.sheetBorder, ), ), - child: InkWell( - customBorder: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(16), + child: TextButton( + style: TextButton.styleFrom( + backgroundColor: Colors.transparent, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + textStyle: ArchethicThemeStyles.textStyleSize16W600Primary, ), key: Key('dAppsInfo${dAppsInfo.dAppName}'), - onTap: () { - sl.get().feedback( - FeedbackType.light, - preferences.activeVibrations, - ); - context.go( - dAppsInfo.dAppLink ?? '', - ); - }, + onPressed: link == null + ? null + : () { + sl.get().feedback( + FeedbackType.light, + preferences.activeVibrations, + ); + context.go( + link, + ); + }, child: Container( width: MediaQuery.of(context).size.width, height: MediaQuery.of(context).size.width / 4, @@ -88,9 +96,7 @@ class CardDapps extends ConsumerWidget { Row( children: [ Text( - dAppsInfo.dAppName ?? '', - style: ArchethicThemeStyles - .textStyleSize16W600Primary, + dAppsInfo.dAppName, ), const SizedBox( width: 5,