Minor improvements
This commit is contained in:
parent
563a460e48
commit
5725737385
|
@ -24,7 +24,8 @@
|
|||
<service
|
||||
android:name=".DownloadService"
|
||||
android:enabled="true"
|
||||
android:exported="true"></service>
|
||||
android:exported="true"
|
||||
android:process=':downloads'></service>
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
|
|
|
@ -430,7 +430,7 @@ class ImageDetails {
|
|||
//JSON
|
||||
factory ImageDetails.fromPrivateString(String art, {String type='cover'}) => ImageDetails(
|
||||
fullUrl: 'https://e-cdns-images.dzcdn.net/images/$type/$art/1400x1400-000000-80-0-0.jpg',
|
||||
thumbUrl: 'https://e-cdns-images.dzcdn.net/images/$type/$art/180x180-000000-80-0-0.jpg'
|
||||
thumbUrl: 'https://e-cdns-images.dzcdn.net/images/$type/$art/140x140-000000-80-0-0.jpg'
|
||||
);
|
||||
factory ImageDetails.fromPrivateJson(Map<dynamic, dynamic> json) => ImageDetails.fromPrivateString(
|
||||
json['MD5'].split('-').first,
|
||||
|
|
|
@ -148,7 +148,19 @@ class _HomePageScreenState extends State<HomePageScreen> {
|
|||
physics: NeverScrollableScrollPhysics(),
|
||||
itemCount: _homePage.sections.length,
|
||||
itemBuilder: (context, i) {
|
||||
HomePageSection section = _homePage.sections[i];
|
||||
return HomepageSectionWidget(_homePage.sections[i]);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class HomepageSectionWidget extends StatelessWidget {
|
||||
|
||||
final HomePageSection section;
|
||||
HomepageSectionWidget(this.section);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
@ -196,7 +208,6 @@ class _HomePageScreenState extends State<HomePageScreen> {
|
|||
}
|
||||
return Container(height: 0, width: 0);
|
||||
}
|
||||
|
||||
//Show item
|
||||
HomePageItem item = section.items[i];
|
||||
return HomePageItemWidget(item);
|
||||
|
@ -206,12 +217,11 @@ class _HomePageScreenState extends State<HomePageScreen> {
|
|||
Container(height: 8.0),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class HomePageItemWidget extends StatelessWidget {
|
||||
|
||||
HomePageItem item;
|
||||
|
|
|
@ -182,6 +182,7 @@ class _PlayerScreenHorizontalState extends State<PlayerScreenHorizontal> {
|
|||
setState(() => _lyrics = !_lyrics);
|
||||
},
|
||||
),
|
||||
if (AudioService.currentMediaItem.extras['qualityString'] != null)
|
||||
FlatButton(
|
||||
onPressed: () => Navigator.push(
|
||||
context,
|
||||
|
@ -192,6 +193,7 @@ class _PlayerScreenHorizontalState extends State<PlayerScreenHorizontal> {
|
|||
style: TextStyle(fontSize: ScreenUtil().setSp(24)),
|
||||
),
|
||||
),
|
||||
RepeatButton(ScreenUtil().setWidth(32)),
|
||||
IconButton(
|
||||
icon: Icon(Icons.more_vert, size: ScreenUtil().setWidth(32)),
|
||||
onPressed: () {
|
||||
|
@ -305,6 +307,7 @@ class _PlayerScreenVerticalState extends State<PlayerScreenVertical> {
|
|||
setState(() => _lyrics = !_lyrics);
|
||||
},
|
||||
),
|
||||
if (AudioService.currentMediaItem.extras['qualityString'] != null)
|
||||
FlatButton(
|
||||
onPressed: () => Navigator.push(
|
||||
context,
|
||||
|
@ -317,15 +320,7 @@ class _PlayerScreenVerticalState extends State<PlayerScreenVertical> {
|
|||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.sentiment_very_dissatisfied, size: ScreenUtil().setWidth(46)),
|
||||
onPressed: () async {
|
||||
await deezerAPI.dislikeTrack(AudioService.currentMediaItem.id);
|
||||
if (playerHelper.queueIndex < (AudioService.queue??[]).length - 1) {
|
||||
AudioService.skipToNext();
|
||||
}
|
||||
}
|
||||
),
|
||||
RepeatButton(ScreenUtil().setWidth(46)),
|
||||
IconButton(
|
||||
icon: Icon(Icons.more_vert, size: ScreenUtil().setWidth(46)),
|
||||
onPressed: () {
|
||||
|
@ -342,6 +337,54 @@ class _PlayerScreenVerticalState extends State<PlayerScreenVertical> {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class RepeatButton extends StatefulWidget {
|
||||
|
||||
final double iconSize;
|
||||
RepeatButton(this.iconSize, {Key key}): super(key: key);
|
||||
|
||||
@override
|
||||
_RepeatButtonState createState() => _RepeatButtonState();
|
||||
}
|
||||
|
||||
class _RepeatButtonState extends State<RepeatButton> {
|
||||
|
||||
Icon get repeatIcon {
|
||||
switch (playerHelper.repeatType) {
|
||||
case LoopMode.off:
|
||||
return Icon(
|
||||
Icons.repeat,
|
||||
size: widget.iconSize
|
||||
);
|
||||
case LoopMode.all:
|
||||
return Icon(
|
||||
Icons.repeat,
|
||||
color: Theme.of(context).primaryColor,
|
||||
size: widget.iconSize
|
||||
);
|
||||
case LoopMode.one:
|
||||
return Icon(
|
||||
Icons.repeat_one,
|
||||
color: Theme.of(context).primaryColor,
|
||||
size: widget.iconSize
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return IconButton(
|
||||
icon: repeatIcon,
|
||||
onPressed: () async {
|
||||
await playerHelper.changeRepeat();
|
||||
setState(() {});
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class PlaybackControls extends StatefulWidget {
|
||||
|
||||
final double iconSize;
|
||||
|
@ -353,28 +396,6 @@ class PlaybackControls extends StatefulWidget {
|
|||
|
||||
class _PlaybackControlsState extends State<PlaybackControls> {
|
||||
|
||||
Icon get repeatIcon {
|
||||
switch (playerHelper.repeatType) {
|
||||
case LoopMode.off:
|
||||
return Icon(
|
||||
Icons.repeat,
|
||||
size: widget.iconSize * 0.64
|
||||
);
|
||||
case LoopMode.all:
|
||||
return Icon(
|
||||
Icons.repeat,
|
||||
color: Theme.of(context).primaryColor,
|
||||
size: widget.iconSize * 0.64
|
||||
);
|
||||
case LoopMode.one:
|
||||
return Icon(
|
||||
Icons.repeat_one,
|
||||
color: Theme.of(context).primaryColor,
|
||||
size: widget.iconSize * 0.64,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Icon get libraryIcon {
|
||||
if (cache.checkTrackFavorite(Track.fromMediaItem(AudioService.currentMediaItem))) {
|
||||
return Icon(Icons.favorite, size: widget.iconSize * 0.64);
|
||||
|
@ -391,11 +412,13 @@ class _PlaybackControlsState extends State<PlaybackControls> {
|
|||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: repeatIcon,
|
||||
icon: Icon(Icons.sentiment_very_dissatisfied, size: ScreenUtil().setWidth(46)),
|
||||
onPressed: () async {
|
||||
await playerHelper.changeRepeat();
|
||||
setState(() {});
|
||||
},
|
||||
await deezerAPI.dislikeTrack(AudioService.currentMediaItem.id);
|
||||
if (playerHelper.queueIndex < (AudioService.queue??[]).length - 1) {
|
||||
AudioService.skipToNext();
|
||||
}
|
||||
}
|
||||
),
|
||||
PrevNextButton(widget.iconSize, prev: true),
|
||||
PlayPauseButton(widget.iconSize * 1.25),
|
||||
|
|
|
@ -134,9 +134,8 @@ class ArtistTile extends StatelessWidget {
|
|||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
width: 150,
|
||||
child: Card(
|
||||
child: Container(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
elevation: 0.0,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
onLongPress: onHold,
|
||||
|
@ -245,9 +244,8 @@ class PlaylistCardTile extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
return Container(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
elevation: 0.0,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
onLongPress: onHold,
|
||||
|
@ -291,8 +289,7 @@ class SmartTrackListTile extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
elevation: 0,
|
||||
return Container(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
|
@ -338,9 +335,8 @@ class AlbumCard extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
return Container(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
elevation: 0.0,
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
onLongPress: onHold,
|
||||
|
|
|
@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
version: 0.6.1+1
|
||||
version: 0.6.2+1
|
||||
|
||||
environment:
|
||||
sdk: ">=2.8.0 <3.0.0"
|
||||
|
@ -69,7 +69,7 @@ dependencies:
|
|||
share: ^0.6.5+2
|
||||
numberpicker: ^1.2.1
|
||||
quick_actions: ^0.4.0+10
|
||||
photo_view:
|
||||
photo_view: ^0.10.2
|
||||
|
||||
audio_session: ^0.0.9
|
||||
audio_service:
|
||||
|
|
Loading…
Reference in New Issue