Skip to content

Commit

Permalink
fix: app style after Flutter upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
phanan committed Jun 6, 2024
1 parent 6a84342 commit 35c0758
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 14 deletions.
3 changes: 2 additions & 1 deletion lib/constants/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion lib/ui/screens/add_to_playlist.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/screens/albums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class _AlbumsScreenState extends State<AlbumsScreen> {
controller: _scrollController,
slivers: <Widget>[
const CupertinoSliverNavigationBar(
backgroundColor: AppColors.screenHeaderBackground,
backgroundColor: AppColors.staticScreenHeaderBackground,
largeTitle: LargeTitle(text: 'Albums'),
),
SliverList(
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/screens/artists.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class _ArtistsScreenState extends State<ArtistsScreen> {
controller: _scrollController,
slivers: [
const CupertinoSliverNavigationBar(
backgroundColor: AppColors.screenHeaderBackground,
backgroundColor: AppColors.staticScreenHeaderBackground,
largeTitle: LargeTitle(text: 'Artists'),
),
SliverList(
Expand Down
4 changes: 3 additions & 1 deletion lib/ui/screens/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class _HomeScreenState extends State<HomeScreen> {
body: CupertinoTheme(
data: const CupertinoThemeData(
primaryColor: AppColors.white,
barBackgroundColor: AppColors.screenHeaderBackground,
barBackgroundColor: AppColors.staticScreenHeaderBackground,
),
child: PullToRefresh(
onRefresh: () => context.read<OverviewProvider>().refresh(),
Expand All @@ -118,6 +118,8 @@ class _HomeScreenState extends State<HomeScreen> {
? [SliverToBoxAdapter(child: const EmptyHomeScreen())]
: <Widget>[
CupertinoSliverNavigationBar(
backgroundColor:
AppColors.staticScreenHeaderBackground,
largeTitle: const LargeTitle(text: 'Home'),
trailing: Row(
mainAxisSize: MainAxisSize.min,
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/screens/library.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class LibraryScreen extends StatelessWidget {
child: CustomScrollView(
slivers: <Widget>[
const CupertinoSliverNavigationBar(
backgroundColor: AppColors.screenHeaderBackground,
backgroundColor: AppColors.staticScreenHeaderBackground,
largeTitle: const LargeTitle(text: 'Library'),
),
SliverPadding(
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/screens/playlists.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class _PlaylistsScreenState extends State<PlaylistsScreen> {
);
},
child: CupertinoSliverNavigationBar(
backgroundColor: AppColors.screenHeaderBackground,
backgroundColor: AppColors.staticScreenHeaderBackground,
largeTitle: const LargeTitle(text: 'Playlists'),
trailing: IconButton(
onPressed: () => widget.router.showCreatePlaylistSheet(context),
Expand Down
16 changes: 11 additions & 5 deletions lib/ui/widgets/app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AppBar extends StatelessWidget {
end: Alignment.bottomCenter,
colors: [
Colors.transparent,
AppColors.screenHeaderBackground,
AppColors.flexibleScreenHeaderBackground,
],
),
),
Expand All @@ -44,17 +44,22 @@ 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,
),
child: Text(
headingText,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.headlineSmall,
),
),
background: Stack(
Expand Down Expand Up @@ -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
Expand All @@ -163,7 +169,7 @@ class CoverImage extends StatelessWidget {
),
boxShadow: const <BoxShadow>[
const BoxShadow(
color: AppColors.screenHeaderBackground,
color: AppColors.flexibleScreenHeaderBackground,
blurRadius: 10.0,
offset: const Offset(0, 6),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/widgets/qr_login_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/widgets/song_list_sort_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class SortButton extends StatelessWidget {
Widget build(BuildContext context) {
return PopupMenuButton<String>(
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 =
Expand Down

0 comments on commit 35c0758

Please sign in to comment.