Skip to content

Commit

Permalink
💄 DAppCard click is disabled when link == null.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chralu committed May 21, 2024
1 parent 8155726 commit 9c15d0f
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions lib/ui/views/dapps/components/card_dapps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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<HapticUtil>().feedback(
FeedbackType.light,
preferences.activeVibrations,
);
context.go(
dAppsInfo.dAppLink ?? '',
);
},
onPressed: link == null
? null
: () {
sl.get<HapticUtil>().feedback(
FeedbackType.light,
preferences.activeVibrations,
);
context.go(
link,
);
},
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width / 4,
Expand All @@ -88,9 +96,7 @@ class CardDapps extends ConsumerWidget {
Row(
children: [
Text(
dAppsInfo.dAppName ?? '',
style: ArchethicThemeStyles
.textStyleSize16W600Primary,
dAppsInfo.dAppName,
),
const SizedBox(
width: 5,
Expand Down

0 comments on commit 9c15d0f

Please sign in to comment.