Skip to content

Commit

Permalink
Improve: Improved miscellaneous missed details
Browse files Browse the repository at this point in the history
  • Loading branch information
gokadzev committed Oct 25, 2024
1 parent 4dc4fff commit 343a90a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 30 deletions.
35 changes: 13 additions & 22 deletions lib/screens/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import 'package:musify/main.dart';
import 'package:musify/screens/playlist_page.dart';
import 'package:musify/services/router_service.dart';
import 'package:musify/services/settings_manager.dart';
import 'package:musify/widgets/marque.dart';
import 'package:musify/widgets/playlist_cube.dart';
import 'package:musify/widgets/section_title.dart';
import 'package:musify/widgets/song_bar.dart';
import 'package:musify/widgets/spinner.dart';

Expand Down Expand Up @@ -93,6 +93,7 @@ class _HomePageState extends State<HomePage> {
_buildSectionHeader(
title: context.l10n!.suggestedPlaylists,
actionButton: IconButton(
padding: const EdgeInsets.only(right: 10),
onPressed: () => NavigationManager.router.go('/home/library'),
icon: Icon(
FluentIcons.more_horizontal_24_regular,
Expand Down Expand Up @@ -220,6 +221,7 @@ class _HomePageState extends State<HomePage> {
_buildSectionHeader(
title: context.l10n!.recommendedForYou,
actionButton: IconButton(
padding: const EdgeInsets.only(right: 10),
onPressed: () {
setActivePlaylist({
'title': context.l10n!.recommendedForYou,
Expand All @@ -246,27 +248,16 @@ class _HomePageState extends State<HomePage> {
}

Widget _buildSectionHeader({required String title, Widget? actionButton}) {
return Padding(
padding: const EdgeInsets.all(20),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SizedBox(
width: MediaQuery.sizeOf(context).width * 0.7,
child: MarqueeWidget(
child: Text(
title,
style: TextStyle(
color: Theme.of(context).colorScheme.primary,
fontSize: 20,
fontWeight: FontWeight.bold,
),
),
),
),
if (actionButton != null) actionButton,
],
),
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SectionTitle(
title,
Theme.of(context).colorScheme.primary,
fontSize: 20,
),
if (actionButton != null) actionButton,
],
);
}
}
1 change: 1 addition & 0 deletions lib/screens/library_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class _LibraryPageState extends State<LibraryPage> {
children: [
SectionTitle(context.l10n!.userPlaylists, primaryColor),
IconButton(
padding: const EdgeInsets.only(right: 10),
onPressed: _showAddPlaylistDialog,
icon: Icon(
FluentIcons.add_24_filled,
Expand Down
28 changes: 20 additions & 8 deletions lib/widgets/section_title.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
import 'package:flutter/material.dart';
import 'package:musify/widgets/marque.dart';

class SectionTitle extends StatelessWidget {
const SectionTitle(this.title, this.primaryColor, {super.key});
const SectionTitle(
this.title,
this.primaryColor, {
this.fontSize = 15,
super.key,
});
final Color primaryColor;
final String title;
final double? fontSize;

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 25),
padding: const EdgeInsets.all(25),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
title,
style: TextStyle(
color: primaryColor,
fontSize: 15,
fontWeight: FontWeight.w600,
child: SizedBox(
width: MediaQuery.sizeOf(context).width * 0.7,
child: MarqueeWidget(
child: Text(
title,
style: TextStyle(
color: primaryColor,
fontSize: fontSize,
fontWeight: FontWeight.bold,
),
),
),
),
),
Expand Down

0 comments on commit 343a90a

Please sign in to comment.