0.6.11 - noone cares or reads this anyway, the repo is for issues, and the code so bad, it's practically obfuscated
This commit is contained in:
parent
9f850a6f30
commit
aa7f82b399
11 changed files with 111 additions and 31 deletions
|
@ -286,6 +286,7 @@ class _MakeAlbumOfflineState extends State<MakeAlbumOffline> {
|
|||
return;
|
||||
}
|
||||
downloadManager.removeOfflineAlbum(widget.album.id);
|
||||
Fluttertoast.showToast(msg: "Removed album from offline!".i18n, gravity: ToastGravity.BOTTOM, toastLength: Toast.LENGTH_SHORT);
|
||||
setState(() {
|
||||
_offline = false;
|
||||
});
|
||||
|
@ -1098,6 +1099,7 @@ class _MakePlaylistOfflineState extends State<MakePlaylistOffline> {
|
|||
return;
|
||||
}
|
||||
downloadManager.removeOfflinePlaylist(widget.playlist.id);
|
||||
Fluttertoast.showToast(msg: "Playlist removed from offline!".i18n, gravity: ToastGravity.BOTTOM, toastLength: Toast.LENGTH_SHORT);
|
||||
setState(() {
|
||||
_offline = false;
|
||||
});
|
||||
|
|
|
@ -145,16 +145,23 @@ class _HomePageScreenState extends State<HomePageScreen> {
|
|||
return ErrorScreen();
|
||||
return Column(
|
||||
children: List.generate(_homePage.sections.length, (i) {
|
||||
return HomepageSectionWidget(_homePage.sections[i]);
|
||||
switch (_homePage.sections[i].layout) {
|
||||
case HomePageSectionLayout.ROW:
|
||||
return HomepageRowSection(_homePage.sections[i]);
|
||||
case HomePageSectionLayout.GRID:
|
||||
return HomePageGridSection(_homePage.sections[i]);
|
||||
default:
|
||||
return HomepageRowSection(_homePage.sections[i]);
|
||||
}
|
||||
},
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
class HomepageSectionWidget extends StatelessWidget {
|
||||
class HomepageRowSection extends StatelessWidget {
|
||||
|
||||
final HomePageSection section;
|
||||
HomepageSectionWidget(this.section);
|
||||
HomepageRowSection(this.section);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -192,9 +199,9 @@ class HomepageSectionWidget extends StatelessWidget {
|
|||
builder: (context) => Scaffold(
|
||||
appBar: FreezerAppBar(section.title),
|
||||
body: SingleChildScrollView(
|
||||
child: HomePageScreen(
|
||||
channel: DeezerChannel(target: section.pagePath)
|
||||
)
|
||||
child: HomePageScreen(
|
||||
channel: DeezerChannel(target: section.pagePath)
|
||||
)
|
||||
),
|
||||
),
|
||||
)),
|
||||
|
@ -213,6 +220,41 @@ class HomepageSectionWidget extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
|
||||
class HomePageGridSection extends StatelessWidget {
|
||||
|
||||
final HomePageSection section;
|
||||
HomePageGridSection(this.section);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListTile(
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 4.0, vertical: 2.0),
|
||||
title: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 4.0, horizontal: 6.0),
|
||||
child: Text(
|
||||
section.title??'',
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 20.0,
|
||||
fontWeight: FontWeight.w900
|
||||
),
|
||||
),
|
||||
),
|
||||
subtitle: Wrap(
|
||||
alignment: WrapAlignment.spaceAround,
|
||||
children: List.generate(section.items.length, (i) {
|
||||
|
||||
//Item
|
||||
return HomePageItemWidget(section.items[i]);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
class HomePageItemWidget extends StatelessWidget {
|
||||
|
|
|
@ -323,6 +323,7 @@ class MenuSheet {
|
|||
onTap: () async {
|
||||
if (isOffline) {
|
||||
await downloadManager.removeOfflineTracks([track]);
|
||||
Fluttertoast.showToast(msg: "Track removed from offline!".i18n, gravity: ToastGravity.BOTTOM, toastLength: Toast.LENGTH_SHORT);
|
||||
} else {
|
||||
await downloadManager.addOfflineTrack(track, private: true, context: context);
|
||||
}
|
||||
|
|
|
@ -77,13 +77,18 @@ class PlayerBar extends StatelessWidget {
|
|||
overflow: TextOverflow.clip,
|
||||
maxLines: 1,
|
||||
),
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
PrevNextButton(iconSize, prev: true, hidePrev: true,),
|
||||
PlayPauseButton(iconSize),
|
||||
PrevNextButton(iconSize)
|
||||
],
|
||||
trailing: IconTheme(
|
||||
data: IconThemeData(
|
||||
color: settings.isDark ? Colors.white : Colors.grey[600]
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
PrevNextButton(iconSize, prev: true, hidePrev: true,),
|
||||
PlayPauseButton(iconSize),
|
||||
PrevNextButton(iconSize)
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:audio_service/audio_service.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/screenutil.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:freezer/api/cache.dart';
|
||||
import 'package:freezer/api/deezer.dart';
|
||||
import 'package:freezer/api/download.dart';
|
||||
|
@ -379,6 +380,18 @@ class _PlayerScreenVerticalState extends State<PlayerScreenVertical> {
|
|||
updateColor();
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(Icons.file_download),
|
||||
onPressed: () async {
|
||||
Track t = Track.fromMediaItem(AudioService.currentMediaItem);
|
||||
if (await downloadManager.addOfflineTrack(t, private: false, context: context, isSingleton: true) != false)
|
||||
Fluttertoast.showToast(
|
||||
msg: 'Downloads added!'.i18n,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
toastLength: Toast.LENGTH_SHORT
|
||||
);
|
||||
},
|
||||
),
|
||||
QualityInfoWidget(),
|
||||
RepeatButton(ScreenUtil().setWidth(46)),
|
||||
PlayerMenuButton()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue