From 5e7f8f666cc6d799c4d75163c7f528a3816f5f59 Mon Sep 17 00:00:00 2001 From: digitalheartxs Date: Tue, 24 Sep 2024 14:29:55 +0200 Subject: [PATCH] feat: My account, account page, add correct bg asset --- .../lib/pages/account/account_page.dart | 150 ++++++++++-------- .../lib/generated/assets.gen.dart | 23 +-- 2 files changed, 98 insertions(+), 75 deletions(-) diff --git a/catalyst_voices/lib/pages/account/account_page.dart b/catalyst_voices/lib/pages/account/account_page.dart index a6cc518b79..ee1991277e 100644 --- a/catalyst_voices/lib/pages/account/account_page.dart +++ b/catalyst_voices/lib/pages/account/account_page.dart @@ -22,6 +22,7 @@ final class AccountPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + const SizedBox(height: 32), _Tab(), const SizedBox(height: 48), const _KeychainCard( @@ -43,6 +44,85 @@ final class AccountPage extends StatelessWidget { } } +class _Header extends StatelessWidget { + @override + Widget build(BuildContext context) { + return SizedBox( + height: 350, + child: Stack( + children: [ + Container( + decoration: BoxDecoration( + image: DecorationImage( + image: CatalystImage.asset( + VoicesAssets.images.accountBg.path, + ).image, + fit: BoxFit.cover, + ), + ), + ), + Positioned( + top: 24, + left: 8, + child: VoicesIconButton.filled( + onTap: () { + GoRouter.of(context).pop(); + }, + style: ButtonStyle( + backgroundColor: WidgetStateProperty.all( + Theme.of(context).colors.elevationsOnSurfaceNeutralLv1White, + ), + foregroundColor: WidgetStateProperty.all( + Theme.of(context).colors.iconsForeground, + ), + ), + child: VoicesAssets.icons.arrowNarrowLeft.buildIcon(), + ), + ), + Positioned( + bottom: 48, + left: 32, + child: Wrap( + direction: Axis.vertical, + children: [ + Text( + 'My Account / Profile & Keychain', + style: Theme.of(context).textTheme.displayMedium?.copyWith( + color: Colors.white, + ), + ), + const SizedBox(height: 4), + Text( + 'Set your base profile, wallet addresses and preferences', + style: Theme.of(context).textTheme.titleMedium?.copyWith( + color: Colors.white, + ), + ), + ], + ), + ), + ], + ), + ); + } +} + +class _Tab extends StatelessWidget { + @override + Widget build(BuildContext context) { + return const DefaultTabController( + length: 1, + child: TabBar( + padding: EdgeInsets.symmetric(horizontal: 20), + isScrollable: true, + tabs: [ + Tab(text: 'Profile & Keychain'), + ], + ), + ); + } +} + class _KeychainCard extends StatelessWidget { final String? connectedWallet; final List roles; @@ -120,7 +200,10 @@ class _KeychainCard extends StatelessWidget { ), if (roles.isNotEmpty) Padding( - padding: const EdgeInsets.symmetric(vertical: 24), + padding: const EdgeInsets.only( + top: 40, + bottom: 24, + ), child: Text( 'Current Role registrations', style: Theme.of(context).textTheme.titleMedium, @@ -136,68 +219,3 @@ class _KeychainCard extends StatelessWidget { ); } } - -class _Tab extends StatelessWidget { - @override - Widget build(BuildContext context) { - return const DefaultTabController( - length: 1, - child: TabBar( - padding: EdgeInsets.symmetric(horizontal: 20), - isScrollable: true, - tabs: [ - Tab(text: 'Profile & Keychain'), - ], - ), - ); - } -} - -class _Header extends StatelessWidget { - @override - Widget build(BuildContext context) { - return SizedBox( - height: 350, - child: Stack( - children: [ - Positioned( - top: 16, - left: 8, - child: VoicesIconButton.filled( - onTap: () { - GoRouter.of(context).pop(); - }, - style: ButtonStyle( - backgroundColor: WidgetStateProperty.all( - Theme.of(context).colors.elevationsOnSurfaceNeutralLv1White, - ), - foregroundColor: WidgetStateProperty.all( - Theme.of(context).colors.iconsForeground, - ), - ), - child: VoicesAssets.icons.arrowNarrowLeft.buildIcon(), - ), - ), - Positioned( - bottom: 48, - left: 32, - child: Wrap( - direction: Axis.vertical, - children: [ - Text( - 'My Account / Profile & Keychain', - style: Theme.of(context).textTheme.displayMedium, - ), - const SizedBox(height: 4), - Text( - 'Set your base profile, wallet addresses and preferences', - style: Theme.of(context).textTheme.titleMedium, - ), - ], - ), - ), - ], - ), - ); - } -} diff --git a/catalyst_voices/packages/catalyst_voices_assets/lib/generated/assets.gen.dart b/catalyst_voices/packages/catalyst_voices_assets/lib/generated/assets.gen.dart index 6eb993c8b4..6746029a03 100644 --- a/catalyst_voices/packages/catalyst_voices_assets/lib/generated/assets.gen.dart +++ b/catalyst_voices/packages/catalyst_voices_assets/lib/generated/assets.gen.dart @@ -7,10 +7,10 @@ // ignore_for_file: type=lint // ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use -import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; -import 'package:flutter_svg/flutter_svg.dart' as _svg; -import 'package:vector_graphics/vector_graphics.dart' as _vg; +import 'package:flutter/services.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:vector_graphics/vector_graphics.dart'; class $AssetsIconsGen { const $AssetsIconsGen(); @@ -1157,6 +1157,10 @@ class $AssetsIconsGen { class $AssetsImagesGen { const $AssetsImagesGen(); + /// File path: assets/images/account_bg.png + AssetGenImage get accountBg => + const AssetGenImage('assets/images/account_bg.png'); + /// File path: assets/images/catalyst_logo.svg SvgGenImage get catalystLogo => const SvgGenImage('assets/images/catalyst_logo.svg'); @@ -1222,6 +1226,7 @@ class $AssetsImagesGen { /// List of all assets List get values => [ + accountBg, catalystLogo, catalystLogoIcon, catalystLogoIconWhite, @@ -1348,7 +1353,7 @@ class SvgGenImage { final Set flavors; final bool _isVecFormat; - _svg.SvgPicture svg({ + SvgPicture svg({ Key? key, bool matchTextDirection = false, AssetBundle? bundle, @@ -1361,29 +1366,29 @@ class SvgGenImage { WidgetBuilder? placeholderBuilder, String? semanticsLabel, bool excludeFromSemantics = false, - _svg.SvgTheme? theme, + SvgTheme? theme, ColorFilter? colorFilter, Clip clipBehavior = Clip.hardEdge, @deprecated Color? color, @deprecated BlendMode colorBlendMode = BlendMode.srcIn, @deprecated bool cacheColorFilter = false, }) { - final _svg.BytesLoader loader; + final BytesLoader loader; if (_isVecFormat) { - loader = _vg.AssetBytesLoader( + loader = AssetBytesLoader( _assetName, assetBundle: bundle, packageName: package, ); } else { - loader = _svg.SvgAssetLoader( + loader = SvgAssetLoader( _assetName, assetBundle: bundle, packageName: package, theme: theme, ); } - return _svg.SvgPicture( + return SvgPicture( loader, key: key, matchTextDirection: matchTextDirection,