Skip to content

Commit

Permalink
Bug fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ShokhrukhbekYuldoshev committed Nov 6, 2024
1 parent fa9a4d6 commit 1f79d47
Show file tree
Hide file tree
Showing 73 changed files with 189 additions and 122 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ Meloplay is a local music player app that plays music from your device built wit
| [flutter_staggered_animations](https://pub.dev/packages/flutter_staggered_animations) | 1.1.1 | A plugin for adding staggered animations to your Flutter apps |
| [fluttertoast](https://pub.dev/packages/fluttertoast) | 8.2.8 | Flutter plugin for displaying toast messages. |
| [flutter_cache_manager](https://pub.dev/packages/flutter_cache_manager) | 3.4.1 | A Flutter plugin for caching images and other resources. |
| [flutter_svg](https://pub.dev/packages/flutter_svg) | 2.0.11 | Flutter plugin for displaying SVG images. |
| [flutter_svg](https://pub.dev/packages/flutter_svg) | 2.0.13 | Flutter plugin for displaying SVG images. |
| [get_it](https://pub.dev/packages/get_it) | 8.0.2 | Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App |
| [hive](https://pub.dev/packages/hive) | 2.2.3 | A lightweight and blazing fast key-value database |
| [hive_flutter](https://pub.dev/packages/hive_flutter) | 1.1.0 | Hive database implementation for Flutter |
| [just_audio](https://pub.dev/packages/just_audio) | 0.9.42 | A feature-rich audio player for Flutter |
| [just_audio_background](https://pub.dev/packages/just_audio_background) | 0.0.1-beta.11 | A plugin for playing audio in the background on Android and iOS. |
| [just_audio_background](https://pub.dev/packages/just_audio_background) | 0.0.1-beta.13 | A plugin for playing audio in the background on Android and iOS. |
| [lottie](https://pub.dev/packages/lottie) | 3.1.3 | Lottie is a mobile library for Android and iOS that parses Lottie and JSON-based animations and renders them natively on mobile. |
| [marquee](https://pub.dev/packages/marquee) | 2.3.0 | A Flutter widget that scrolls text infinitely. |
| [on_audio_query](https://pub.dev/packages/on_audio_query) | 2.9.0 | A Flutter plugin to query songs on Android and iOS |
Expand Down Expand Up @@ -182,7 +182,7 @@ Pull requests are welcome. For major changes, please open an issue first to disc

## 📝 License

Distributed under the MIT License. See [LICENSE](LICENSE) for more information.
Distributed under the Attribution-NonCommercial-ShareAlike 4.0 International License. See [LICENSE](LICENSE) for more information.

## 📧 Contact

Expand Down
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20~ipad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29~ipad.png
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/[email protected]
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon~ipad.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
1 change: 1 addition & 0 deletions lib/src/core/theme/app_theme_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class AppThemeData {
bottomSheetTheme: BottomSheetThemeData(
backgroundColor: theme.primaryColor,
),
dialogBackgroundColor: theme.primaryColor,
);
}
}
2 changes: 1 addition & 1 deletion lib/src/presentation/pages/home/search_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class _SearchPageState extends State<SearchPage> {
title: TextField(
autofocus: true,
onChanged: (value) {
context.read<SearchBloc>().add(SearchQueryChanged(value));
context.read<SearchBloc>().add(SearchQueryChanged(value.trim()));
},
controller: searchController,
decoration: const InputDecoration(
Expand Down
19 changes: 18 additions & 1 deletion lib/src/presentation/pages/home/views/songs_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ class _SongsViewState extends State<SongsView>
SvgPicture.asset(
Assets.shuffleSvg,
width: 20,
colorFilter: ColorFilter.mode(
Theme.of(context)
.textTheme
.bodyMedium!
.color!,
BlendMode.srcIn,
),
),
const SizedBox(width: 8),
Text(
Expand Down Expand Up @@ -164,7 +171,17 @@ class _SongsViewState extends State<SongsView>
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(Assets.playSvg, width: 20),
SvgPicture.asset(
Assets.playSvg,
width: 20,
colorFilter: ColorFilter.mode(
Theme.of(context)
.textTheme
.bodyMedium!
.color!,
BlendMode.srcIn,
),
),
const SizedBox(width: 8),
Text(
'Play',
Expand Down
162 changes: 89 additions & 73 deletions lib/src/presentation/pages/player/player_page.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:ui';

import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:just_audio/just_audio.dart';
Expand Down Expand Up @@ -170,11 +171,7 @@ class _PlayerPageState extends State<PlayerPage> {
return AnimatedFavoriteButton(
isFavorite: sl<SongRepository>()
.isFavorite(mediaItem.id),
onTap: () {
context.read<SongBloc>().add(
ToggleFavorite(mediaItem.id),
);
},
mediaItem: mediaItem,
);
},
),
Expand Down Expand Up @@ -206,39 +203,52 @@ class _PlayerPageState extends State<PlayerPage> {
children: [
SizedBox(
height: 30,
child: mediaItem!.title.length > 50
? Marquee(
text: mediaItem.title,
blankSpace: 100,
startAfter:
const Duration(seconds: 3),
pauseAfterRound:
const Duration(seconds: 3),
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
),
)
: Text(
mediaItem.title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
child: AutoSizeText(
mediaItem!.title,
maxLines: 1,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
),
minFontSize: 20,
overflowReplacement: Marquee(
text: mediaItem.title,
blankSpace: 100,
startAfter:
const Duration(seconds: 3),
pauseAfterRound:
const Duration(seconds: 3),
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
),
Text(
mediaItem.artist ?? 'Unknown',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
color: Colors.white,
SizedBox(
height: 30,
child: AutoSizeText(
mediaItem.artist ?? 'Unknown',
maxLines: 1,
style: const TextStyle(
fontSize: 16,
color: Colors.white,
),
minFontSize: 16,
overflowReplacement: Marquee(
text: mediaItem.artist ?? 'Unknown',
blankSpace: 100,
startAfter:
const Duration(seconds: 3),
pauseAfterRound:
const Duration(seconds: 3),
style: const TextStyle(
fontSize: 16,
color: Colors.white,
),
),
),
),
],
Expand Down Expand Up @@ -304,11 +314,7 @@ class _PlayerPageState extends State<PlayerPage> {
return AnimatedFavoriteButton(
isFavorite: sl<SongRepository>()
.isFavorite(mediaItem.id),
onTap: () {
context.read<SongBloc>().add(
ToggleFavorite(mediaItem.id),
);
},
mediaItem: mediaItem,
);
},
),
Expand All @@ -334,38 +340,48 @@ class _PlayerPageState extends State<PlayerPage> {
children: [
SizedBox(
height: 30,
child: mediaItem!.title.length > 30
? Marquee(
text: mediaItem.title,
blankSpace: 100,
startAfter: const Duration(seconds: 3),
pauseAfterRound:
const Duration(seconds: 3),
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
),
)
: Text(
mediaItem.title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
child: AutoSizeText(
mediaItem!.title,
maxLines: 1,
minFontSize: 20,
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
),
overflowReplacement: Marquee(
text: mediaItem.title,
blankSpace: 100,
startAfter: const Duration(seconds: 3),
pauseAfterRound: const Duration(seconds: 3),
style: const TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
),
Text(
mediaItem.artist ?? 'Unknown',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 15,
fontWeight: FontWeight.bold,
color: Colors.white,
SizedBox(
height: 30,
child: AutoSizeText(
mediaItem.artist ?? 'Unknown',
maxLines: 1,
minFontSize: 15,
style: const TextStyle(
fontSize: 15,
color: Colors.white,
),
overflowReplacement: Marquee(
text: mediaItem.artist ?? 'Unknown',
blankSpace: 100,
startAfter: const Duration(seconds: 3),
pauseAfterRound: const Duration(seconds: 3),
style: const TextStyle(
fontSize: 15,
color: Colors.white,
),
),
),
),
],
Expand Down
11 changes: 8 additions & 3 deletions lib/src/presentation/widgets/animated_favorite_button.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:just_audio_background/just_audio_background.dart';
import 'package:meloplay/src/bloc/song/song_bloc.dart';

class AnimatedFavoriteButton extends StatefulWidget {
final bool isFavorite;
final Function onTap;
final MediaItem mediaItem;

const AnimatedFavoriteButton({
super.key,
required this.isFavorite,
required this.onTap,
required this.mediaItem,
});

@override
Expand Down Expand Up @@ -42,7 +45,9 @@ class _AnimatedFavoriteButtonState extends State<AnimatedFavoriteButton>
return GestureDetector(
onTap: () {
_controller.forward();
widget.onTap();
context.read<SongBloc>().add(
ToggleFavorite(widget.mediaItem.id),
);
},
child: Container(
margin: const EdgeInsets.only(right: 16, bottom: 16),
Expand Down
6 changes: 4 additions & 2 deletions lib/src/presentation/widgets/buttons/play_pause_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ class PlayPauseButton extends StatelessWidget {
const PlayPauseButton({
super.key,
this.width = 40,
this.color = Colors.white,
});

final double width;
final Color color;

@override
Widget build(BuildContext context) {
Expand All @@ -33,15 +35,15 @@ class PlayPauseButton extends StatelessWidget {
? SvgPicture.asset(
Assets.pauseSvg,
colorFilter: ColorFilter.mode(
Colors.white,
color,
BlendMode.srcIn,
),
width: width,
)
: SvgPicture.asset(
Assets.playSvg,
colorFilter: ColorFilter.mode(
Colors.white,
color,
BlendMode.srcIn,
),
width: width,
Expand Down
Loading

0 comments on commit 1f79d47

Please sign in to comment.