From b31b1940d855568c44700285d5fab0605dd8b611 Mon Sep 17 00:00:00 2001 From: tuxpizza Date: Sat, 21 Dec 2024 23:16:00 -0500 Subject: [PATCH] Update [skip ci] --- lib/src/screens/dashboard/dashboard_page.dart | 146 +++++++++++++++++- .../screens/dashboard/pages/balance_page.dart | 10 +- .../dashboard/pages/cake_features_page.dart | 102 +++++++++++- 3 files changed, 247 insertions(+), 11 deletions(-) diff --git a/lib/src/screens/dashboard/dashboard_page.dart b/lib/src/screens/dashboard/dashboard_page.dart index b8bfbd45d..480401baa 100644 --- a/lib/src/screens/dashboard/dashboard_page.dart +++ b/lib/src/screens/dashboard/dashboard_page.dart @@ -38,6 +38,8 @@ import 'package:cake_wallet/src/screens/release_notes/release_notes_screen.dart' import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; +import '../../../themes/theme_base.dart'; + class DashboardPage extends StatefulWidget { DashboardPage({ required this.bottomSheetService, @@ -297,7 +299,8 @@ class _DashboardPageView extends BasePage { ), ), ), - Positioned( + currentTheme.type == ThemeType.bright + ? Positioned( top: 560, bottom: 0, left: 0, @@ -346,7 +349,7 @@ class _DashboardPageView extends BasePage { child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 50, sigmaY: 50), child: Container( - clipBehavior: Clip.hardEdge, + //clipBehavior: Clip.hardEdge, decoration: BoxDecoration( borderRadius: BorderRadius.circular(50.0), border: Border.all( @@ -358,6 +361,14 @@ class _DashboardPageView extends BasePage { color: Theme.of(context) .extension()! .syncedBackgroundColor, + boxShadow: [ + BoxShadow( + color: Theme.of(context).extension()!.cardBorderColor + .withAlpha(50), + spreadRadius: 5, + blurRadius: 7 + ) + ], ), child: Container( padding: EdgeInsets.symmetric(horizontal: 10), @@ -416,13 +427,142 @@ class _DashboardPageView extends BasePage { ), ), ), - //], + // ], ), ), ), ); }, ), + ) + : + Positioned( + top: 560, + bottom: 0, + left: 0, + right: 0, + child: Observer( + builder: (_) { + return ClipRect( + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Theme.of(context) + .extension()! + .thirdGradientBackgroundColor + .withAlpha(10), + Theme.of(context) + .extension()! + .thirdGradientBackgroundColor + .withAlpha(75), + Theme.of(context) + .extension()! + .thirdGradientBackgroundColor + .withAlpha(150), + Theme.of(context) + .extension()! + .thirdGradientBackgroundColor, + Theme.of(context) + .extension()! + .thirdGradientBackgroundColor + // Color.fromARGB(10, 245, 8, 82), + // Color.fromARGB(75, 245, 8, 82), + // Color.fromARGB(150, 245, 8, 82), + // Color.fromARGB(200, 245, 8, 82), + // Color.fromARGB(255, 245, 8, 82), + ], + ), + ), + child: Container( + alignment: Alignment.bottomCenter, + padding: const EdgeInsets.only( + left: 16, right: 16, bottom: 24, top: 48), + child: Container( + //clipBehavior: Clip.hardEdge, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(50.0), + border: Border.all( + color: Theme.of(context) + .extension()! + .cardBorderColor, + width: 1, + ), + color: Theme.of(context) + .extension()! + .syncedBackgroundColor, + boxShadow: [ + BoxShadow( + color: Theme.of(context).extension()!.cardBorderColor + .withAlpha(50), + spreadRadius: 5, + blurRadius: 7 + ) + ], + ), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 10), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: MainActions.all + .where((element) => + element.canShow + ?.call(dashboardViewModel) ?? + true) + .map( + (action) => Expanded( + child: Semantics( + button: true, + enabled: (action.isEnabled?.call( + dashboardViewModel) ?? + true), + child: ActionButton( + key: ValueKey( + 'dashboard_page_${action.name(context)}_action_button_key'), + image: Image.asset( + action.image, + height: 24, + width: 24, + color: action.isEnabled?.call( + dashboardViewModel) ?? + true + ? Theme.of(context) + .extension< + DashboardPageTheme>()! + .mainActionsIconColor + : Theme.of(context) + .extension< + BalancePageTheme>()! + .labelTextColor, + ), + title: action.name(context), + onClick: () async => + await action.onTap(context, + dashboardViewModel), + textColor: action.isEnabled?.call( + dashboardViewModel) ?? + true + ? null + : Theme.of(context) + .extension< + BalancePageTheme>()! + .labelTextColor, + ), + ), + ), + ) + .toList(), + ), + ), + ), + ), + ), + ); + }, + ), ), ], ), diff --git a/lib/src/screens/dashboard/pages/balance_page.dart b/lib/src/screens/dashboard/pages/balance_page.dart index a71a6288b..2832c8617 100644 --- a/lib/src/screens/dashboard/pages/balance_page.dart +++ b/lib/src/screens/dashboard/pages/balance_page.dart @@ -304,7 +304,7 @@ class CryptoBalanceWidget extends StatelessWidget { )) ], if (dashboardViewModel.showSilentPaymentsCard) ...[ - SizedBox(height: 10), + SizedBox(height: 15), Padding( padding: const EdgeInsets.fromLTRB(16, 0, 16, 8), child: DashBoardRoundedCardWidget( @@ -579,6 +579,14 @@ class BalanceRowWidget extends StatelessWidget { Container( margin: const EdgeInsets.only(left: 16, right: 16), decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Theme.of(context).extension()!.cardBorderColor + .withAlpha(50), + spreadRadius: 3, + blurRadius: 7 + ) + ], borderRadius: BorderRadius.circular(30.0), border: Border.all( color: Theme.of(context).extension()!.cardBorderColor, diff --git a/lib/src/screens/dashboard/pages/cake_features_page.dart b/lib/src/screens/dashboard/pages/cake_features_page.dart index bd96fd534..9348f6457 100644 --- a/lib/src/screens/dashboard/pages/cake_features_page.dart +++ b/lib/src/screens/dashboard/pages/cake_features_page.dart @@ -22,14 +22,12 @@ class CakeFeaturesPage extends StatelessWidget { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 10.0), - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 10.0), + return Padding( + padding: EdgeInsets.symmetric(horizontal: 20), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox(height: 50), + SizedBox(height: 10), Text( 'Cake ${S.of(context).features}', style: TextStyle( @@ -60,6 +58,96 @@ class CakeFeaturesPage extends StatelessWidget { ), ), SizedBox(height: 10), + DashBoardRoundedCardWidget( + onTap: () { + if (Platform.isMacOS) { + _launchUrl("buy.cakepay.com"); + } else { + _navigatorToGiftCardsPage(context); + } + }, + title: 'Cake Pay', + subTitle: S.of(context).cake_pay_subtitle, + image: Image.asset( + 'assets/images/cards.png', + height: 100, + width: 115, + fit: BoxFit.cover, + ), + ), + SizedBox(height: 10), + DashBoardRoundedCardWidget( + onTap: () { + if (Platform.isMacOS) { + _launchUrl("buy.cakepay.com"); + } else { + _navigatorToGiftCardsPage(context); + } + }, + title: 'Cake Pay', + subTitle: S.of(context).cake_pay_subtitle, + image: Image.asset( + 'assets/images/cards.png', + height: 100, + width: 115, + fit: BoxFit.cover, + ), + ), + SizedBox(height: 10), + DashBoardRoundedCardWidget( + onTap: () { + if (Platform.isMacOS) { + _launchUrl("buy.cakepay.com"); + } else { + _navigatorToGiftCardsPage(context); + } + }, + title: 'Cake Pay', + subTitle: S.of(context).cake_pay_subtitle, + image: Image.asset( + 'assets/images/cards.png', + height: 100, + width: 115, + fit: BoxFit.cover, + ), + ), + SizedBox(height: 10), + DashBoardRoundedCardWidget( + onTap: () { + if (Platform.isMacOS) { + _launchUrl("buy.cakepay.com"); + } else { + _navigatorToGiftCardsPage(context); + } + }, + title: 'Cake Pay', + subTitle: S.of(context).cake_pay_subtitle, + image: Image.asset( + 'assets/images/cards.png', + height: 100, + width: 115, + fit: BoxFit.cover, + ), + ), + SizedBox(height: 10), + DashBoardRoundedCardWidget( + onTap: () { + if (Platform.isMacOS) { + _launchUrl("buy.cakepay.com"); + } else { + _navigatorToGiftCardsPage(context); + } + }, + title: 'Cake Pay', + subTitle: S.of(context).cake_pay_subtitle, + image: Image.asset( + 'assets/images/cards.png', + height: 100, + width: 115, + fit: BoxFit.cover, + ), + ), + SizedBox(height: 10), DashBoardRoundedCardWidget( onTap: () => _launchUrl("cake.nano-gpt.com"), title: "NanoGPT", @@ -90,13 +178,13 @@ class CakeFeaturesPage extends StatelessWidget { ); }, ), + SizedBox(height: 125), ], ), ), ], ), - ), - ); + ); } void _launchUrl(String url) {