-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve radio search and update yaru
- Loading branch information
1 parent
9f956ba
commit 475fb94
Showing
18 changed files
with
231 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:yaru/yaru.dart'; | ||
|
||
import '../data/audio.dart'; | ||
import 'icons.dart'; | ||
import 'theme.dart'; | ||
import '../../extensions/build_context_x.dart'; | ||
import '../../extensions/theme_data_x.dart'; | ||
|
||
class AudioFallBackIcon extends StatelessWidget { | ||
const AudioFallBackIcon({ | ||
super.key, | ||
required this.audio, | ||
this.iconSize, | ||
this.dimension, | ||
this.color, | ||
}); | ||
|
||
final double? iconSize; | ||
final Audio? audio; | ||
final double? dimension; | ||
final Color? color; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final theme = context.theme; | ||
final light = theme.isLight; | ||
final fallBackColor = theme.primaryColor; | ||
final gradientColor = color ?? | ||
getAlphabetColor( | ||
audio?.title ?? audio?.album ?? '', | ||
fallBackColor, | ||
); | ||
return Container( | ||
height: dimension ?? double.infinity, | ||
width: dimension ?? double.infinity, | ||
decoration: BoxDecoration( | ||
gradient: LinearGradient( | ||
begin: Alignment.bottomLeft, | ||
end: Alignment.topRight, | ||
colors: [ | ||
gradientColor.scale(lightness: light ? 0 : -0.4, saturation: -0.5), | ||
gradientColor.scale( | ||
lightness: light ? -0.1 : -0.2, | ||
saturation: -0.5, | ||
), | ||
], | ||
), | ||
), | ||
child: Icon( | ||
audio?.audioType?.iconData ?? Iconz.musicNote, | ||
size: iconSize, | ||
color: contrastColor(gradientColor).withOpacity(0.7), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.