code fixes:
- remove unused imports - remove clipboard plugin and directly use flutter's clipboard class - replace deprecated stuff
This commit is contained in:
parent
3105ed6c1d
commit
519adc910f
|
|
@ -1,9 +1,6 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:freezer/api/deezer.dart';
|
|
||||||
import 'package:freezer/api/definitions.dart';
|
import 'package:freezer/api/definitions.dart';
|
||||||
import 'package:freezer/ui/details_screens.dart';
|
|
||||||
import 'package:freezer/ui/library.dart';
|
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:path/path.dart' as p;
|
import 'package:path/path.dart' as p;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import 'package:freezer/api/spotify.dart';
|
||||||
import 'package:freezer/settings.dart';
|
import 'package:freezer/settings.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
|
|
||||||
import 'dart:io';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
|
|
@ -32,7 +31,7 @@ class DeezerAPI {
|
||||||
"Accept-Charset": "utf-8,ISO-8859-1;q=0.7,*;q=0.3",
|
"Accept-Charset": "utf-8,ISO-8859-1;q=0.7,*;q=0.3",
|
||||||
"Accept-Language": "${settings.deezerLanguage??"en"}-${settings.deezerCountry??'US'},${settings.deezerLanguage??"en"};q=0.9,en-US;q=0.8,en;q=0.7",
|
"Accept-Language": "${settings.deezerLanguage??"en"}-${settings.deezerCountry??'US'},${settings.deezerLanguage??"en"};q=0.9,en-US;q=0.8,en;q=0.7",
|
||||||
"Connection": "keep-alive",
|
"Connection": "keep-alive",
|
||||||
"Cookie": "arl=${arl}" + ((sid == null) ? '' : '; sid=${sid}')
|
"Cookie": "arl=$arl" + ((sid == null) ? '' : '; sid=$sid')
|
||||||
};
|
};
|
||||||
|
|
||||||
//Call private API
|
//Call private API
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ class Artist {
|
||||||
Map<dynamic, dynamic> json, {
|
Map<dynamic, dynamic> json, {
|
||||||
Map<dynamic, dynamic> albumsJson = const {},
|
Map<dynamic, dynamic> albumsJson = const {},
|
||||||
Map<dynamic, dynamic> topJson = const {},
|
Map<dynamic, dynamic> topJson = const {},
|
||||||
Map<dynamic, dynamic> highlight = null,
|
Map<dynamic, dynamic> highlight,
|
||||||
bool library = false
|
bool library = false
|
||||||
}) {
|
}) {
|
||||||
//Get wether radio is available
|
//Get wether radio is available
|
||||||
|
|
|
||||||
|
|
@ -373,14 +373,14 @@ class _MainScreenState extends State<MainScreen> with SingleTickerProviderStateM
|
||||||
items: <BottomNavigationBarItem>[
|
items: <BottomNavigationBarItem>[
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: Icon(Icons.home),
|
icon: Icon(Icons.home),
|
||||||
title: Text('Home'.i18n)),
|
label: 'Home'.i18n),
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: Icon(Icons.search),
|
icon: Icon(Icons.search),
|
||||||
title: Text('Search'.i18n),
|
label: 'Search'.i18n,
|
||||||
),
|
),
|
||||||
BottomNavigationBarItem(
|
BottomNavigationBarItem(
|
||||||
icon: Icon(Icons.library_music),
|
icon: Icon(Icons.library_music),
|
||||||
title: Text('Library'.i18n))
|
label: 'Library'.i18n)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -213,8 +213,8 @@ class Settings {
|
||||||
case AudioQuality.MP3_128: return 1;
|
case AudioQuality.MP3_128: return 1;
|
||||||
case AudioQuality.MP3_320: return 3;
|
case AudioQuality.MP3_320: return 3;
|
||||||
case AudioQuality.FLAC: return 9;
|
case AudioQuality.FLAC: return 9;
|
||||||
|
default: return 8;
|
||||||
}
|
}
|
||||||
return 8; //default
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if is dark, can't use theme directly, because of system themes, and Theme.of(context).brightness broke
|
//Check if is dark, can't use theme directly, because of system themes, and Theme.of(context).brightness broke
|
||||||
|
|
@ -242,6 +242,7 @@ class Settings {
|
||||||
sliderTheme: _sliderTheme,
|
sliderTheme: _sliderTheme,
|
||||||
toggleableActiveColor: primaryColor,
|
toggleableActiveColor: primaryColor,
|
||||||
bottomAppBarColor: Color(0xfff5f5f5),
|
bottomAppBarColor: Color(0xfff5f5f5),
|
||||||
|
appBarTheme: AppBarTheme(brightness: Brightness.light),
|
||||||
),
|
),
|
||||||
Themes.Dark: ThemeData(
|
Themes.Dark: ThemeData(
|
||||||
textTheme: _textTheme,
|
textTheme: _textTheme,
|
||||||
|
|
@ -251,6 +252,7 @@ class Settings {
|
||||||
accentColor: primaryColor,
|
accentColor: primaryColor,
|
||||||
sliderTheme: _sliderTheme,
|
sliderTheme: _sliderTheme,
|
||||||
toggleableActiveColor: primaryColor,
|
toggleableActiveColor: primaryColor,
|
||||||
|
appBarTheme: AppBarTheme(brightness: Brightness.dark),
|
||||||
),
|
),
|
||||||
Themes.Deezer: ThemeData(
|
Themes.Deezer: ThemeData(
|
||||||
textTheme: _textTheme,
|
textTheme: _textTheme,
|
||||||
|
|
@ -267,6 +269,7 @@ class Settings {
|
||||||
bottomSheetTheme: BottomSheetThemeData(
|
bottomSheetTheme: BottomSheetThemeData(
|
||||||
backgroundColor: deezerBottom
|
backgroundColor: deezerBottom
|
||||||
),
|
),
|
||||||
|
appBarTheme: AppBarTheme(brightness: Brightness.dark),
|
||||||
cardColor: deezerBg
|
cardColor: deezerBg
|
||||||
),
|
),
|
||||||
Themes.Black: ThemeData(
|
Themes.Black: ThemeData(
|
||||||
|
|
@ -283,7 +286,8 @@ class Settings {
|
||||||
toggleableActiveColor: primaryColor,
|
toggleableActiveColor: primaryColor,
|
||||||
bottomSheetTheme: BottomSheetThemeData(
|
bottomSheetTheme: BottomSheetThemeData(
|
||||||
backgroundColor: Colors.black,
|
backgroundColor: Colors.black,
|
||||||
)
|
),
|
||||||
|
appBarTheme: AppBarTheme(brightness: Brightness.dark),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:palette_generator/palette_generator.dart';
|
import 'package:palette_generator/palette_generator.dart';
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
|
|
@ -114,7 +113,7 @@ class _ZoomableImageState extends State<ZoomableImage> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
ctx = context;
|
ctx = context;
|
||||||
return FlatButton(
|
return TextButton(
|
||||||
child: CachedImage(
|
child: CachedImage(
|
||||||
url: widget.url,
|
url: widget.url,
|
||||||
rounded: widget.rounded,
|
rounded: widget.rounded,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
import 'dart:convert';
|
|
||||||
|
|
||||||
import 'package:draggable_scrollbar/draggable_scrollbar.dart';
|
import 'package:draggable_scrollbar/draggable_scrollbar.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:fluttericon/font_awesome5_icons.dart';
|
import 'package:fluttericon/font_awesome5_icons.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
|
|
@ -21,7 +18,7 @@ import 'menu.dart';
|
||||||
|
|
||||||
class AlbumDetails extends StatefulWidget {
|
class AlbumDetails extends StatefulWidget {
|
||||||
|
|
||||||
Album album;
|
final Album album;
|
||||||
AlbumDetails(this.album, {Key key}): super(key: key);
|
AlbumDetails(this.album, {Key key}): super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -165,7 +162,7 @@ class _AlbumDetailsState extends State<AlbumDetails> {
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon((album.library??false)? Icons.favorite : Icons.favorite_border, size: 32),
|
Icon((album.library??false)? Icons.favorite : Icons.favorite_border, size: 32),
|
||||||
|
|
@ -196,7 +193,7 @@ class _AlbumDetailsState extends State<AlbumDetails> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
MakeAlbumOffline(album: album),
|
MakeAlbumOffline(album: album),
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(Icons.file_download, size: 32.0,),
|
Icon(Icons.file_download, size: 32.0,),
|
||||||
|
|
@ -248,7 +245,7 @@ class _AlbumDetailsState extends State<AlbumDetails> {
|
||||||
|
|
||||||
class MakeAlbumOffline extends StatefulWidget {
|
class MakeAlbumOffline extends StatefulWidget {
|
||||||
|
|
||||||
Album album;
|
final Album album;
|
||||||
MakeAlbumOffline({Key key, this.album}): super(key: key);
|
MakeAlbumOffline({Key key, this.album}): super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -266,6 +263,7 @@ class _MakeAlbumOfflineState extends State<MakeAlbumOffline> {
|
||||||
_offline = v;
|
_offline = v;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -399,7 +397,7 @@ class ArtistDetails extends StatelessWidget {
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(Icons.favorite, size: 32),
|
Icon(Icons.favorite, size: 32),
|
||||||
|
|
@ -417,7 +415,7 @@ class ArtistDetails extends StatelessWidget {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
if ((artist.radio??false))
|
if ((artist.radio??false))
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Icon(Icons.radio, size: 32),
|
Icon(Icons.radio, size: 32),
|
||||||
|
|
@ -714,7 +712,7 @@ class _DiscographyScreenState extends State<DiscographyScreen> {
|
||||||
|
|
||||||
class PlaylistDetails extends StatefulWidget {
|
class PlaylistDetails extends StatefulWidget {
|
||||||
|
|
||||||
Playlist playlist;
|
final Playlist playlist;
|
||||||
PlaylistDetails(this.playlist, {Key key}): super(key: key);
|
PlaylistDetails(this.playlist, {Key key}): super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -1060,7 +1058,7 @@ class _PlaylistDetailsState extends State<PlaylistDetails> {
|
||||||
}
|
}
|
||||||
|
|
||||||
class MakePlaylistOffline extends StatefulWidget {
|
class MakePlaylistOffline extends StatefulWidget {
|
||||||
Playlist playlist;
|
final Playlist playlist;
|
||||||
MakePlaylistOffline(this.playlist, {Key key}): super(key: key);
|
MakePlaylistOffline(this.playlist, {Key key}): super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -1077,6 +1075,7 @@ class _MakePlaylistOfflineState extends State<MakePlaylistOffline> {
|
||||||
_offline = v;
|
_offline = v;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -1115,7 +1114,7 @@ class _MakePlaylistOfflineState extends State<MakePlaylistOffline> {
|
||||||
|
|
||||||
class ShowScreen extends StatefulWidget {
|
class ShowScreen extends StatefulWidget {
|
||||||
|
|
||||||
Show show;
|
final Show show;
|
||||||
ShowScreen(this.show, {Key key}): super(key: key);
|
ShowScreen(this.show, {Key key}): super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -239,11 +239,11 @@ class DownloadTile extends StatelessWidget {
|
||||||
title: Text('Delete'.i18n),
|
title: Text('Delete'.i18n),
|
||||||
content: Text('Are you sure you want to delete this download?'.i18n),
|
content: Text('Are you sure you want to delete this download?'.i18n),
|
||||||
actions: [
|
actions: [
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Cancel'.i18n),
|
child: Text('Cancel'.i18n),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Delete'.i18n),
|
child: Text('Delete'.i18n),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await downloadManager.removeDownload(download.id);
|
await downloadManager.removeDownload(download.id);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:freezer/api/deezer.dart';
|
import 'package:freezer/api/deezer.dart';
|
||||||
import 'package:freezer/api/definitions.dart';
|
import 'package:freezer/api/definitions.dart';
|
||||||
import 'package:freezer/api/player.dart';
|
import 'package:freezer/api/player.dart';
|
||||||
import 'package:freezer/main.dart';
|
|
||||||
import 'package:freezer/ui/elements.dart';
|
import 'package:freezer/ui/elements.dart';
|
||||||
import 'package:freezer/ui/error.dart';
|
import 'package:freezer/ui/error.dart';
|
||||||
import 'package:freezer/ui/menu.dart';
|
import 'package:freezer/ui/menu.dart';
|
||||||
|
|
@ -180,7 +179,7 @@ class HomepageSectionWidget extends StatelessWidget {
|
||||||
//Has more items
|
//Has more items
|
||||||
if (j == section.items.length) {
|
if (j == section.items.length) {
|
||||||
if (section.hasMore ?? false) {
|
if (section.hasMore ?? false) {
|
||||||
return FlatButton(
|
return TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
'Show more'.i18n,
|
'Show more'.i18n,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
|
|
@ -217,7 +216,7 @@ class HomepageSectionWidget extends StatelessWidget {
|
||||||
|
|
||||||
class HomePageItemWidget extends StatelessWidget {
|
class HomePageItemWidget extends StatelessWidget {
|
||||||
|
|
||||||
HomePageItem item;
|
final HomePageItem item;
|
||||||
HomePageItemWidget(this.item);
|
HomePageItemWidget(this.item);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:freezer/api/deezer.dart';
|
import 'package:freezer/api/deezer.dart';
|
||||||
import 'package:freezer/api/definitions.dart';
|
import 'package:freezer/api/definitions.dart';
|
||||||
|
|
@ -141,9 +140,8 @@ class _ImporterWidgetState extends State<ImporterWidget> {
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
RaisedButton(
|
ElevatedButton(
|
||||||
child: Text('Convert'.i18n),
|
child: Text('Convert'.i18n),
|
||||||
color: Theme.of(context).primaryColor,
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
spotify.convertPlaylist(widget.playlist);
|
spotify.convertPlaylist(widget.playlist);
|
||||||
Navigator.of(context).pushReplacement(MaterialPageRoute(
|
Navigator.of(context).pushReplacement(MaterialPageRoute(
|
||||||
|
|
@ -151,9 +149,8 @@ class _ImporterWidgetState extends State<ImporterWidget> {
|
||||||
));
|
));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
RaisedButton(
|
ElevatedButton(
|
||||||
child: Text('Download only'.i18n),
|
child: Text('Download only'.i18n),
|
||||||
color: Theme.of(context).primaryColor,
|
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
//Ask for quality
|
//Ask for quality
|
||||||
AudioQuality quality;
|
AudioQuality quality;
|
||||||
|
|
@ -263,7 +260,7 @@ class CurrentlyImportingScreen extends StatelessWidget {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (snapshot.data != null)
|
if (snapshot.data != null)
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Playlist menu'.i18n),
|
child: Text('Playlist menu'.i18n),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Playlist p = await deezerAPI.playlist(snapshot.data);
|
Playlist p = await deezerAPI.playlist(snapshot.data);
|
||||||
|
|
|
||||||
1236
lib/ui/library.dart
1236
lib/ui/library.dart
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,5 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:freezer/main.dart';
|
import 'package:freezer/main.dart';
|
||||||
import 'package:wakelock/wakelock.dart';
|
import 'package:wakelock/wakelock.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
@ -697,14 +696,14 @@ class _SleepTimerDialogState extends State<SleepTimerDialog> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Dismiss'.i18n),
|
child: Text('Dismiss'.i18n),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
if (cache.sleepTimer != null)
|
if (cache.sleepTimer != null)
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Cancel current timer'.i18n),
|
child: Text('Cancel current timer'.i18n),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
cache.sleepTimer.cancel();
|
cache.sleepTimer.cancel();
|
||||||
|
|
@ -714,7 +713,7 @@ class _SleepTimerDialogState extends State<SleepTimerDialog> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Save'.i18n),
|
child: Text('Save'.i18n),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Duration duration = Duration(hours: hours, minutes: minutes);
|
Duration duration = Duration(hours: hours, minutes: minutes);
|
||||||
|
|
@ -891,11 +890,11 @@ class _CreatePlaylistDialogState extends State<CreatePlaylistDialog> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Cancel'.i18n),
|
child: Text('Cancel'.i18n),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text(edit ? 'Update'.i18n : 'Create'.i18n),
|
child: Text(edit ? 'Update'.i18n : 'Create'.i18n),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
if (edit) {
|
if (edit) {
|
||||||
|
|
|
||||||
|
|
@ -63,13 +63,15 @@ class _PlayerScreenState extends State<PlayerScreen> {
|
||||||
if (settings.blurPlayerBackground)
|
if (settings.blurPlayerBackground)
|
||||||
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
||||||
statusBarColor: palette.dominantColor.color.withOpacity(0.25),
|
statusBarColor: palette.dominantColor.color.withOpacity(0.25),
|
||||||
systemNavigationBarColor: Color.alphaBlend(palette.dominantColor.color.withOpacity(0.25), Theme.of(context).scaffoldBackgroundColor)
|
systemNavigationBarColor: Color.alphaBlend(palette.dominantColor.color.withOpacity(0.25), Theme.of(context).scaffoldBackgroundColor),
|
||||||
|
systemNavigationBarIconBrightness: ThemeData.estimateBrightnessForColor(palette.dominantColor.color) == Brightness.light ? Brightness.dark : Brightness.light
|
||||||
));
|
));
|
||||||
|
|
||||||
//Color gradient
|
//Color gradient
|
||||||
if (!settings.blurPlayerBackground) {
|
if (!settings.blurPlayerBackground) {
|
||||||
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
||||||
statusBarColor: palette.dominantColor.color.withOpacity(0.7),
|
statusBarColor: palette.dominantColor.color.withOpacity(0.7),
|
||||||
|
statusBarIconBrightness: ThemeData.estimateBrightnessForColor(palette.dominantColor.color.withOpacity(0.7)) == Brightness.light ? Brightness.dark : Brightness.light
|
||||||
));
|
));
|
||||||
setState(() => _bgGradient = LinearGradient(
|
setState(() => _bgGradient = LinearGradient(
|
||||||
begin: Alignment.topCenter,
|
begin: Alignment.topCenter,
|
||||||
|
|
@ -425,7 +427,7 @@ class _QualityInfoWidgetState extends State<QualityInfoWidget> {
|
||||||
_load();
|
_load();
|
||||||
if (streamSubscription == null)
|
if (streamSubscription == null)
|
||||||
streamSubscription = AudioService.currentMediaItemStream.listen((event) async {
|
streamSubscription = AudioService.currentMediaItemStream.listen((event) async {
|
||||||
await _load();
|
_load();
|
||||||
});
|
});
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
@ -439,7 +441,7 @@ class _QualityInfoWidgetState extends State<QualityInfoWidget> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return FlatButton(
|
return TextButton(
|
||||||
child: Text(value),
|
child: Text(value),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => QualitySettings()));
|
Navigator.of(context).push(MaterialPageRoute(builder: (context) => QualitySettings()));
|
||||||
|
|
@ -641,10 +643,10 @@ class _BigAlbumArtState extends State<BigAlbumArt> {
|
||||||
//Top row containing QueueSource, queue...
|
//Top row containing QueueSource, queue...
|
||||||
class PlayerScreenTopRow extends StatelessWidget {
|
class PlayerScreenTopRow extends StatelessWidget {
|
||||||
|
|
||||||
double textSize;
|
final double textSize;
|
||||||
double iconSize;
|
final double iconSize;
|
||||||
double textWidth;
|
final double textWidth;
|
||||||
bool short;
|
final bool short;
|
||||||
PlayerScreenTopRow({this.textSize, this.iconSize, this.textWidth, this.short});
|
PlayerScreenTopRow({this.textSize, this.iconSize, this.textWidth, this.short});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import 'package:flutter/src/services/keyboard_key.dart';
|
||||||
import 'package:freezer/api/cache.dart';
|
import 'package:freezer/api/cache.dart';
|
||||||
import 'package:freezer/api/download.dart';
|
import 'package:freezer/api/download.dart';
|
||||||
import 'package:freezer/api/player.dart';
|
import 'package:freezer/api/player.dart';
|
||||||
import 'package:freezer/main.dart';
|
|
||||||
import 'package:freezer/ui/details_screens.dart';
|
import 'package:freezer/ui/details_screens.dart';
|
||||||
import 'package:freezer/ui/elements.dart';
|
import 'package:freezer/ui/elements.dart';
|
||||||
import 'package:freezer/ui/home_screen.dart';
|
import 'package:freezer/ui/home_screen.dart';
|
||||||
|
|
@ -59,7 +58,7 @@ class _SearchScreenState extends State<SearchScreen> {
|
||||||
List _suggestions = [];
|
List _suggestions = [];
|
||||||
bool _cancel = false;
|
bool _cancel = false;
|
||||||
bool _showCards = true;
|
bool _showCards = true;
|
||||||
FocusNode _focus = FocusNode();
|
//FocusNode _focus = FocusNode();
|
||||||
|
|
||||||
void _submit(BuildContext context, {String query}) async {
|
void _submit(BuildContext context, {String query}) async {
|
||||||
if (query != null) _query = query;
|
if (query != null) _query = query;
|
||||||
|
|
@ -94,7 +93,7 @@ class _SearchScreenState extends State<SearchScreen> {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Load search suggestions
|
//Load search suggestions
|
||||||
Future<List<String>> _loadSuggestions() async {
|
Future<void> _loadSuggestions() async {
|
||||||
if (_query == null || _query.length < 2 || _query.startsWith('http')) return null;
|
if (_query == null || _query.length < 2 || _query.startsWith('http')) return null;
|
||||||
String q = _query;
|
String q = _query;
|
||||||
await Future.delayed(Duration(milliseconds: 300));
|
await Future.delayed(Duration(milliseconds: 300));
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import 'package:audio_service/audio_service.dart';
|
||||||
import 'package:country_pickers/country.dart';
|
import 'package:country_pickers/country.dart';
|
||||||
import 'package:country_pickers/country_picker_dialog.dart';
|
import 'package:country_pickers/country_picker_dialog.dart';
|
||||||
import 'package:filesize/filesize.dart';
|
import 'package:filesize/filesize.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_displaymode/flutter_displaymode.dart';
|
import 'package:flutter_displaymode/flutter_displaymode.dart';
|
||||||
|
|
@ -23,7 +22,6 @@ import 'package:package_info/package_info.dart';
|
||||||
import 'package:path_provider_ex/path_provider_ex.dart';
|
import 'package:path_provider_ex/path_provider_ex.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:freezer/translations.i18n.dart';
|
import 'package:freezer/translations.i18n.dart';
|
||||||
import 'package:clipboard/clipboard.dart';
|
|
||||||
import 'package:scrobblenaut/scrobblenaut.dart';
|
import 'package:scrobblenaut/scrobblenaut.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
|
|
@ -106,7 +104,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||||
title: Text('Language'.i18n),
|
title: Text('Language'.i18n),
|
||||||
content: Text('Language changed, please restart Freezer to apply!'.i18n),
|
content: Text('Language changed, please restart Freezer to apply!'.i18n),
|
||||||
actions: [
|
actions: [
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('OK'),
|
child: Text('OK'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
|
|
@ -387,7 +385,7 @@ class _FontSelectorState extends State<FontSelector> {
|
||||||
title: Text('Warning'.i18n),
|
title: Text('Warning'.i18n),
|
||||||
content: Text("This app isn't made for supporting many fonts, it can break layouts and overflow. Use at your own risk!".i18n),
|
content: Text("This app isn't made for supporting many fonts, it can break layouts and overflow. Use at your own risk!".i18n),
|
||||||
actions: [
|
actions: [
|
||||||
FlatButton(
|
TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
setState(() => settings.font = font);
|
setState(() => settings.font = font);
|
||||||
await settings.save();
|
await settings.save();
|
||||||
|
|
@ -398,7 +396,7 @@ class _FontSelectorState extends State<FontSelector> {
|
||||||
},
|
},
|
||||||
child: Text('Apply'.i18n),
|
child: Text('Apply'.i18n),
|
||||||
),
|
),
|
||||||
FlatButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
widget.callback();
|
widget.callback();
|
||||||
|
|
@ -739,8 +737,8 @@ class _DeezerSettingsState extends State<DeezerSettings> {
|
||||||
|
|
||||||
class FilenameTemplateDialog extends StatefulWidget {
|
class FilenameTemplateDialog extends StatefulWidget {
|
||||||
|
|
||||||
String initial;
|
final String initial;
|
||||||
Function onSave;
|
final Function onSave;
|
||||||
FilenameTemplateDialog(this.initial, this.onSave, {Key key}): super(key: key);
|
FilenameTemplateDialog(this.initial, this.onSave, {Key key}): super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -782,22 +780,22 @@ class _FilenameTemplateDialogState extends State<FilenameTemplateDialog> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Cancel'.i18n),
|
child: Text('Cancel'.i18n),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Reset'.i18n),
|
child: Text('Reset'.i18n),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
_controller.value = _controller.value.copyWith(text: '%artist% - %title%');
|
_controller.value = _controller.value.copyWith(text: '%artist% - %title%');
|
||||||
_new = '%artist% - %title%';
|
_new = '%artist% - %title%';
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Clear'.i18n),
|
child: Text('Clear'.i18n),
|
||||||
onPressed: () => _controller.clear(),
|
onPressed: () => _controller.clear(),
|
||||||
),
|
),
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Save'.i18n),
|
child: Text('Save'.i18n),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
widget.onSave(_new);
|
widget.onSave(_new);
|
||||||
|
|
@ -907,7 +905,7 @@ class _DownloadsSettingsState extends State<DownloadsSettings> {
|
||||||
title: Text('Warning'.i18n),
|
title: Text('Warning'.i18n),
|
||||||
content: Text('Using too many concurrent downloads on older/weaker devices might cause crashes!'.i18n),
|
content: Text('Using too many concurrent downloads on older/weaker devices might cause crashes!'.i18n),
|
||||||
actions: [
|
actions: [
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Dismiss'.i18n),
|
child: Text('Dismiss'.i18n),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
)
|
)
|
||||||
|
|
@ -1195,7 +1193,7 @@ class _GeneralSettingsState extends State<GeneralSettings> {
|
||||||
subtitle: Text('Copy userToken/ARL Cookie for use in other apps.'.i18n),
|
subtitle: Text('Copy userToken/ARL Cookie for use in other apps.'.i18n),
|
||||||
leading: Icon(Icons.lock),
|
leading: Icon(Icons.lock),
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await FlutterClipboard.copy(settings.arl);
|
Clipboard.setData(ClipboardData(text: settings.arl));
|
||||||
await Fluttertoast.showToast(
|
await Fluttertoast.showToast(
|
||||||
msg: 'Copied'.i18n,
|
msg: 'Copied'.i18n,
|
||||||
);
|
);
|
||||||
|
|
@ -1251,7 +1249,7 @@ class _GeneralSettingsState extends State<GeneralSettings> {
|
||||||
// content: Text('Due to plugin incompatibility, login using browser is unavailable without restart.'.i18n),
|
// content: Text('Due to plugin incompatibility, login using browser is unavailable without restart.'.i18n),
|
||||||
content: Text('Restart of app is required to properly log out!'.i18n),
|
content: Text('Restart of app is required to properly log out!'.i18n),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Cancel'.i18n),
|
child: Text('Cancel'.i18n),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
|
|
@ -1262,7 +1260,7 @@ class _GeneralSettingsState extends State<GeneralSettings> {
|
||||||
// Navigator.of(context).pop();
|
// Navigator.of(context).pop();
|
||||||
// },
|
// },
|
||||||
// ),
|
// ),
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Log out & Exit'.i18n),
|
child: Text('Log out & Exit'.i18n),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
try {AudioService.stop();} catch (e) {}
|
try {AudioService.stop();} catch (e) {}
|
||||||
|
|
@ -1329,11 +1327,11 @@ class _LastFMLoginState extends State<LastFMLogin> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
actions: [
|
actions: [
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Cancel'.i18n),
|
child: Text('Cancel'.i18n),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
),
|
),
|
||||||
FlatButton(
|
TextButton(
|
||||||
child: Text('Login'.i18n),
|
child: Text('Login'.i18n),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
LastFM last;
|
LastFM last;
|
||||||
|
|
@ -1398,7 +1396,6 @@ class _DirectoryPickerState extends State<DirectoryPicker> {
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(Icons.sd_card),
|
icon: Icon(Icons.sd_card),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
String path = '';
|
|
||||||
//Chose storage
|
//Chose storage
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||||
import 'package:freezer/api/cache.dart';
|
import 'package:freezer/api/cache.dart';
|
||||||
|
|
@ -168,12 +167,12 @@ class _UpdaterScreenState extends State<UpdaterScreen> {
|
||||||
//Available download
|
//Available download
|
||||||
if (_versionDownload != null)
|
if (_versionDownload != null)
|
||||||
Column(children: [
|
Column(children: [
|
||||||
RaisedButton(
|
ElevatedButton(
|
||||||
child: Text('Download'.i18n + ' (${_versionDownload.version})'),
|
child: Text('Download'.i18n + ' (${_versionDownload.version})'),
|
||||||
onPressed: _buttonEnabled ? () {
|
onPressed: _buttonEnabled ? () {
|
||||||
setState(() => _buttonEnabled = false);
|
setState(() => _buttonEnabled = false);
|
||||||
_download();
|
_download();
|
||||||
}:null
|
} : null
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.all(8.0),
|
padding: EdgeInsets.all(8.0),
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,6 @@ dependencies:
|
||||||
marquee: ^1.5.2
|
marquee: ^1.5.2
|
||||||
flutter_cache_manager: ^1.4.1
|
flutter_cache_manager: ^1.4.1
|
||||||
cached_network_image: ^2.3.2+1
|
cached_network_image: ^2.3.2+1
|
||||||
clipboard: ^0.1.2+8
|
|
||||||
i18n_extension: ^4.0.0
|
i18n_extension: ^4.0.0
|
||||||
fluttericon: ^1.0.7
|
fluttericon: ^1.0.7
|
||||||
url_launcher: ^5.7.2
|
url_launcher: ^5.7.2
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue