From 35c07582f52718d7367ea2289d54352ac08edadf Mon Sep 17 00:00:00 2001 From: Phan An Date: Thu, 6 Jun 2024 22:45:24 +0200 Subject: [PATCH] fix: app style after Flutter upgrade --- lib/constants/colors.dart | 3 ++- lib/ui/screens/add_to_playlist.dart | 2 +- lib/ui/screens/albums.dart | 2 +- lib/ui/screens/artists.dart | 2 +- lib/ui/screens/home.dart | 4 +++- lib/ui/screens/library.dart | 2 +- lib/ui/screens/playlists.dart | 2 +- lib/ui/widgets/app_bar.dart | 16 +++++++++++----- lib/ui/widgets/qr_login_button.dart | 2 +- lib/ui/widgets/song_list_sort_button.dart | 2 +- 10 files changed, 23 insertions(+), 14 deletions(-) diff --git a/lib/constants/colors.dart b/lib/constants/colors.dart index c4de63e..f7b8b57 100644 --- a/lib/constants/colors.dart +++ b/lib/constants/colors.dart @@ -12,5 +12,6 @@ class AppColors { static const highlight = const Color(0xFFF80A95); static const highlightAccent = const Color(0xFFC20C75); - static const screenHeaderBackground = Color.fromRGBO(25, 0, 64, .5); + static const staticScreenHeaderBackground = Colors.transparent; + static const flexibleScreenHeaderBackground = Color.fromRGBO(25, 0, 64, .5); } diff --git a/lib/ui/screens/add_to_playlist.dart b/lib/ui/screens/add_to_playlist.dart index aa626a6..dcf9791 100644 --- a/lib/ui/screens/add_to_playlist.dart +++ b/lib/ui/screens/add_to_playlist.dart @@ -65,7 +65,7 @@ class AddToPlaylistScreen extends StatelessWidget { ); }, child: CupertinoSliverNavigationBar( - backgroundColor: AppColors.screenHeaderBackground, + backgroundColor: AppColors.staticScreenHeaderBackground, largeTitle: const LargeTitle(text: 'Add to a Playlist'), trailing: IconButton( onPressed: () => router.showCreatePlaylistSheet(context), diff --git a/lib/ui/screens/albums.dart b/lib/ui/screens/albums.dart index 32174b0..f89dfcc 100644 --- a/lib/ui/screens/albums.dart +++ b/lib/ui/screens/albums.dart @@ -102,7 +102,7 @@ class _AlbumsScreenState extends State { controller: _scrollController, slivers: [ const CupertinoSliverNavigationBar( - backgroundColor: AppColors.screenHeaderBackground, + backgroundColor: AppColors.staticScreenHeaderBackground, largeTitle: LargeTitle(text: 'Albums'), ), SliverList( diff --git a/lib/ui/screens/artists.dart b/lib/ui/screens/artists.dart index aa34ffa..803336a 100644 --- a/lib/ui/screens/artists.dart +++ b/lib/ui/screens/artists.dart @@ -102,7 +102,7 @@ class _ArtistsScreenState extends State { controller: _scrollController, slivers: [ const CupertinoSliverNavigationBar( - backgroundColor: AppColors.screenHeaderBackground, + backgroundColor: AppColors.staticScreenHeaderBackground, largeTitle: LargeTitle(text: 'Artists'), ), SliverList( diff --git a/lib/ui/screens/home.dart b/lib/ui/screens/home.dart index 7064022..cbbcb46 100644 --- a/lib/ui/screens/home.dart +++ b/lib/ui/screens/home.dart @@ -109,7 +109,7 @@ class _HomeScreenState extends State { body: CupertinoTheme( data: const CupertinoThemeData( primaryColor: AppColors.white, - barBackgroundColor: AppColors.screenHeaderBackground, + barBackgroundColor: AppColors.staticScreenHeaderBackground, ), child: PullToRefresh( onRefresh: () => context.read().refresh(), @@ -118,6 +118,8 @@ class _HomeScreenState extends State { ? [SliverToBoxAdapter(child: const EmptyHomeScreen())] : [ CupertinoSliverNavigationBar( + backgroundColor: + AppColors.staticScreenHeaderBackground, largeTitle: const LargeTitle(text: 'Home'), trailing: Row( mainAxisSize: MainAxisSize.min, diff --git a/lib/ui/screens/library.dart b/lib/ui/screens/library.dart index 804f8e7..fcc54c0 100644 --- a/lib/ui/screens/library.dart +++ b/lib/ui/screens/library.dart @@ -72,7 +72,7 @@ class LibraryScreen extends StatelessWidget { child: CustomScrollView( slivers: [ const CupertinoSliverNavigationBar( - backgroundColor: AppColors.screenHeaderBackground, + backgroundColor: AppColors.staticScreenHeaderBackground, largeTitle: const LargeTitle(text: 'Library'), ), SliverPadding( diff --git a/lib/ui/screens/playlists.dart b/lib/ui/screens/playlists.dart index 3dacefe..0f632d1 100644 --- a/lib/ui/screens/playlists.dart +++ b/lib/ui/screens/playlists.dart @@ -101,7 +101,7 @@ class _PlaylistsScreenState extends State { ); }, child: CupertinoSliverNavigationBar( - backgroundColor: AppColors.screenHeaderBackground, + backgroundColor: AppColors.staticScreenHeaderBackground, largeTitle: const LargeTitle(text: 'Playlists'), trailing: IconButton( onPressed: () => widget.router.showCreatePlaylistSheet(context), diff --git a/lib/ui/widgets/app_bar.dart b/lib/ui/widgets/app_bar.dart index d7f5003..104d358 100644 --- a/lib/ui/widgets/app_bar.dart +++ b/lib/ui/widgets/app_bar.dart @@ -29,7 +29,7 @@ class AppBar extends StatelessWidget { end: Alignment.bottomCenter, colors: [ Colors.transparent, - AppColors.screenHeaderBackground, + AppColors.flexibleScreenHeaderBackground, ], ), ), @@ -44,10 +44,14 @@ class AppBar extends StatelessWidget { pinned: true, expandedHeight: 290, actions: actions, - backgroundColor: AppColors.screenHeaderBackground, - shadowColor: Colors.transparent, + backgroundColor: AppColors.flexibleScreenHeaderBackground, flexibleSpace: FrostedGlassBackground( child: FlexibleSpaceBar( + expandedTitleScale: 1.3, + titlePadding: EdgeInsets.symmetric( + horizontal: 48, + vertical: 12, + ), title: Padding( padding: const EdgeInsets.symmetric( horizontal: AppDimensions.hPadding, @@ -55,6 +59,7 @@ class AppBar extends StatelessWidget { child: Text( headingText, overflow: TextOverflow.ellipsis, + style: Theme.of(context).textTheme.headlineSmall, ), ), background: Stack( @@ -152,7 +157,8 @@ class CoverImage extends StatelessWidget { decoration: BoxDecoration( image: DecorationImage( colorFilter: ColorFilter.mode( - AppColors.screenHeaderBackground.withOpacity(overlayOpacity), + AppColors.flexibleScreenHeaderBackground + .withOpacity(overlayOpacity), BlendMode.srcOver, ), image: imageUrl == null @@ -163,7 +169,7 @@ class CoverImage extends StatelessWidget { ), boxShadow: const [ const BoxShadow( - color: AppColors.screenHeaderBackground, + color: AppColors.flexibleScreenHeaderBackground, blurRadius: 10.0, offset: const Offset(0, 6), ), diff --git a/lib/ui/widgets/qr_login_button.dart b/lib/ui/widgets/qr_login_button.dart index f6635cb..3863f59 100644 --- a/lib/ui/widgets/qr_login_button.dart +++ b/lib/ui/widgets/qr_login_button.dart @@ -11,7 +11,7 @@ class QrLoginButton extends StatelessWidget { @override Widget build(BuildContext context) { return ElevatedButton( - child: Icon(Icons.qr_code_scanner_rounded, size: 32), + child: Icon(Icons.qr_code, size: 32), style: ElevatedButton.styleFrom( backgroundColor: Colors.transparent, shape: CircleBorder(), diff --git a/lib/ui/widgets/song_list_sort_button.dart b/lib/ui/widgets/song_list_sort_button.dart index b193c94..2af9fcd 100644 --- a/lib/ui/widgets/song_list_sort_button.dart +++ b/lib/ui/widgets/song_list_sort_button.dart @@ -58,7 +58,7 @@ class SortButton extends StatelessWidget { Widget build(BuildContext context) { return PopupMenuButton( offset: const Offset(-12, 48), - icon: const Icon(CupertinoIcons.sort_down, size: 24), + icon: const Icon(CupertinoIcons.sort_down), onSelected: (item) { if (item == currentField) { currentOrder =