upgrade 3.3: buggy

This commit is contained in:
poka 2022-09-12 02:09:17 +02:00
parent 6ca3367808
commit cb556da4de
4 changed files with 83 additions and 85 deletions

View File

@ -83,7 +83,7 @@ class HomeProvider with ChangeNotifier {
if (track.id == null) { if (track.id == null) {
final secondMatch = track.artiste == '' ? track.album : track.artiste; final secondMatch = track.artiste == '' ? track.album : track.artiste;
final resultUrl = await yt.search final resultUrl = await yt.search
.search(track.title + ' ' + secondMatch!, filter: TypeFilters.video); .search('${track.title} ${secondMatch!}', filter: TypeFilters.video);
track.id = resultUrl.first.id.value; track.id = resultUrl.first.id.value;
} }
const invidiousUrl = [ const invidiousUrl = [
@ -102,7 +102,7 @@ class HomeProvider with ChangeNotifier {
print(source.url); print(source.url);
await player.play(source); await player.play(source);
} catch (e) { } catch (e) {
print('Play error: ' + e.toString()); print('Play error: $e');
} }
Future.delayed(const Duration(milliseconds: 50)); Future.delayed(const Duration(milliseconds: 50));
@ -168,27 +168,27 @@ class HomeProvider with ChangeNotifier {
List<DropdownMenuItem<String>> get radioList { List<DropdownMenuItem<String>> get radioList {
List<DropdownMenuItem<String>> menuItems = [ List<DropdownMenuItem<String>> menuItems = [
const DropdownMenuItem(child: Text("FIP"), value: "fip"), const DropdownMenuItem(value: "fip", child: Text("FIP")),
const DropdownMenuItem(child: Text("Electro"), value: "fip_electro"), const DropdownMenuItem(value: "fip_electro", child: Text("Electro")),
const DropdownMenuItem(child: Text("Groove"), value: "fip_groove"), const DropdownMenuItem(value: "fip_groove", child: Text("Groove")),
const DropdownMenuItem(child: Text("Rock"), value: "fip_rock"), const DropdownMenuItem(value: "fip_rock", child: Text("Rock")),
const DropdownMenuItem(child: Text("Jazz"), value: "fip_jazz"), const DropdownMenuItem(value: "fip_jazz", child: Text("Jazz")),
const DropdownMenuItem(child: Text("Pop"), value: "fip_pop"), const DropdownMenuItem(value: "fip_pop", child: Text("Pop")),
const DropdownMenuItem(child: Text("Reggae"), value: "fip_reggae"), const DropdownMenuItem(value: "fip_reggae", child: Text("Reggae")),
const DropdownMenuItem(child: Text("World"), value: "fip_world"), const DropdownMenuItem(value: "fip_world", child: Text("World")),
const DropdownMenuItem( const DropdownMenuItem(
child: Text("Nouveautés"), value: "fip_nouveautes"), value: "fip_nouveautes", child: Text("Nouveautés")),
]; ];
return menuItems; return menuItems;
} }
List<DropdownMenuItem<String>> get pageList { List<DropdownMenuItem<String>> get pageList {
List<DropdownMenuItem<String>> menuItems = [ List<DropdownMenuItem<String>> menuItems = [
const DropdownMenuItem(child: Text("25"), value: "3"), const DropdownMenuItem(value: "3", child: Text("25")),
const DropdownMenuItem(child: Text("50"), value: "6"), const DropdownMenuItem(value: "6", child: Text("50")),
const DropdownMenuItem(child: Text("100"), value: "12"), const DropdownMenuItem(value: "12", child: Text("100")),
const DropdownMenuItem(child: Text("200"), value: "25"), const DropdownMenuItem(value: "25", child: Text("200")),
const DropdownMenuItem(child: Text("500"), value: "62"), const DropdownMenuItem(value: "62", child: Text("500")),
]; ];
return menuItems; return menuItems;
} }

View File

@ -127,7 +127,7 @@ class _HomeScreenState extends State<HomeScreen> {
child: Column(children: [ child: Column(children: [
const SizedBox(height: 20), const SizedBox(height: 20),
Text( Text(
'Error: ' + snapshot.error.toString(), 'Error: ${snapshot.error}',
style: TextStyle(color: Colors.grey[500]), style: TextStyle(color: Colors.grey[500]),
), ),
]), ]),
@ -263,18 +263,18 @@ class _HomeScreenState extends State<HomeScreen> {
// playerProvider.reload(); // playerProvider.reload();
}, },
style: ElevatedButton.styleFrom(
foregroundColor: Colors.grey[900],
backgroundColor: Colors.grey[300],
shape: const CircleBorder(),
padding: const EdgeInsets.all(12),
),
child: Icon( child: Icon(
hp.player.state.name == 'playing' hp.player.state.name == 'playing'
? Icons.pause ? Icons.pause
: Icons.play_arrow, : Icons.play_arrow,
color: Colors.grey[900], color: Colors.grey[900],
size: 30), size: 30),
style: ElevatedButton.styleFrom(
shape: const CircleBorder(),
padding: const EdgeInsets.all(12),
primary: Colors.grey[300],
onPrimary: Colors.grey[900],
),
), ),
Column(children: [ Column(children: [
IconButton( IconButton(
@ -387,7 +387,7 @@ Widget trackLine(Track track) {
return SizedBox( return SizedBox(
height: 30, height: 30,
child: Row( child: Row(
children: [Text(track.title + ' - ' + track.artiste)], children: [Text('${track.title} - ${track.artiste}')],
), ),
); );
} }
@ -479,10 +479,11 @@ TableRow _buildTableRow(Track track, BuildContext context) {
final secondMatch = final secondMatch =
track.artiste == '' ? track.album : track.artiste; track.artiste == '' ? track.album : track.artiste;
final resultUrl = await yt.search final resultUrl = await yt.search
.search(track.title + ' ' + secondMatch!); .search('${track.title} ${secondMatch!}');
track.id = resultUrl.first.id.value; track.id = resultUrl.first.id.value;
} }
if (track.id != null) { if (track.id != null) {
// ignore: use_build_context_synchronously
hp.downloadMusic(context, track); hp.downloadMusic(context, track);
} }
isDownloading = -1; isDownloading = -1;

View File

@ -7,70 +7,70 @@ packages:
name: archive name: archive
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.3.0" version: "3.3.1"
args: args:
dependency: transitive dependency: transitive
description: description:
name: args name: args
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.3.0" version: "2.3.1"
async: async:
dependency: transitive dependency: transitive
description: description:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.8.2" version: "2.9.0"
audioplayers: audioplayers:
dependency: "direct main" dependency: "direct main"
description: description:
name: audioplayers name: audioplayers
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0-rc.4" version: "1.0.1"
audioplayers_android: audioplayers_android:
dependency: transitive dependency: transitive
description: description:
name: audioplayers_android name: audioplayers_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0-rc.2" version: "1.0.1"
audioplayers_darwin: audioplayers_darwin:
dependency: transitive dependency: transitive
description: description:
name: audioplayers_darwin name: audioplayers_darwin
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0-rc.4" version: "1.0.1"
audioplayers_linux: audioplayers_linux:
dependency: transitive dependency: transitive
description: description:
name: audioplayers_linux name: audioplayers_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0-rc.3" version: "1.0.0"
audioplayers_platform_interface: audioplayers_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: audioplayers_platform_interface name: audioplayers_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0-rc.2" version: "1.0.0"
audioplayers_web: audioplayers_web:
dependency: transitive dependency: transitive
description: description:
name: audioplayers_web name: audioplayers_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0-rc.3" version: "1.0.0"
audioplayers_windows: audioplayers_windows:
dependency: transitive dependency: transitive
description: description:
name: audioplayers_windows name: audioplayers_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0-rc.3" version: "1.0.0"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
@ -84,21 +84,14 @@ packages:
name: characters name: characters
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
clock: clock:
dependency: transitive dependency: transitive
description: description:
name: clock name: clock
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.1"
collection: collection:
dependency: transitive dependency: transitive
description: description:
@ -112,42 +105,42 @@ packages:
name: crypto name: crypto
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.1" version: "3.0.2"
csslib: csslib:
dependency: transitive dependency: transitive
description: description:
name: csslib name: csslib
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.17.1" version: "0.17.2"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
name: cupertino_icons name: cupertino_icons
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.4" version: "1.0.5"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.3.1"
ffi: ffi:
dependency: transitive dependency: transitive
description: description:
name: ffi name: ffi
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.2" version: "2.0.1"
file: file:
dependency: transitive dependency: transitive
description: description:
name: file name: file
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.1.2" version: "6.1.4"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -159,7 +152,7 @@ packages:
name: flutter_lints name: flutter_lints
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.4" version: "2.0.1"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -176,7 +169,7 @@ packages:
name: freezed_annotation name: freezed_annotation
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "2.1.0"
html: html:
dependency: transitive dependency: transitive
description: description:
@ -190,28 +183,28 @@ packages:
name: http name: http
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.13.4" version: "0.13.5"
http_parser: http_parser:
dependency: transitive dependency: transitive
description: description:
name: http_parser name: http_parser
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.0" version: "4.0.1"
icons_launcher: icons_launcher:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: icons_launcher name: icons_launcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.3" version: "2.0.5"
image: image:
dependency: transitive dependency: transitive
description: description:
name: image name: image
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.3" version: "3.2.0"
js: js:
dependency: transitive dependency: transitive
description: description:
@ -225,35 +218,35 @@ packages:
name: json_annotation name: json_annotation
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.5.0" version: "4.6.0"
lints: lints:
dependency: transitive dependency: transitive
description: description:
name: lints name: lints
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "2.0.0"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.11" version: "0.12.12"
material_color_utilities: material_color_utilities:
dependency: transitive dependency: transitive
description: description:
name: material_color_utilities name: material_color_utilities
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.4" version: "0.1.5"
meta: meta:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.7.0" version: "1.8.0"
miniplayer: miniplayer:
dependency: "direct main" dependency: "direct main"
description: description:
@ -276,63 +269,63 @@ packages:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.1" version: "1.8.2"
path_provider: path_provider:
dependency: "direct main" dependency: "direct main"
description: description:
name: path_provider name: path_provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.9" version: "2.0.11"
path_provider_android: path_provider_android:
dependency: transitive dependency: transitive
description: description:
name: path_provider_android name: path_provider_android
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.13" version: "2.0.20"
path_provider_ios: path_provider_ios:
dependency: transitive dependency: transitive
description: description:
name: path_provider_ios name: path_provider_ios
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.8" version: "2.0.11"
path_provider_linux: path_provider_linux:
dependency: transitive dependency: transitive
description: description:
name: path_provider_linux name: path_provider_linux
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.5" version: "2.1.7"
path_provider_macos: path_provider_macos:
dependency: transitive dependency: transitive
description: description:
name: path_provider_macos name: path_provider_macos
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.5" version: "2.0.6"
path_provider_platform_interface: path_provider_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: path_provider_platform_interface name: path_provider_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.3" version: "2.0.4"
path_provider_windows: path_provider_windows:
dependency: transitive dependency: transitive
description: description:
name: path_provider_windows name: path_provider_windows
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.5" version: "2.1.3"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
name: petitparser name: petitparser
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.4.0" version: "5.0.0"
platform: platform:
dependency: transitive dependency: transitive
description: description:
@ -360,7 +353,7 @@ packages:
name: provider name: provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "6.0.2" version: "6.0.3"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -372,7 +365,7 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.2" version: "1.9.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -393,28 +386,28 @@ packages:
name: string_scanner name: string_scanner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.1"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
name: term_glyph name: term_glyph
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.1"
test_api: test_api:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.9" version: "0.4.12"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0" version: "1.3.1"
universal_io: universal_io:
dependency: "direct main" dependency: "direct main"
description: description:
@ -442,35 +435,35 @@ packages:
name: win32 name: win32
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.5.2" version: "3.0.0"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:
name: xdg_directories name: xdg_directories
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.0+1" version: "0.2.0+2"
xml: xml:
dependency: transitive dependency: transitive
description: description:
name: xml name: xml
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.3.1" version: "6.1.0"
yaml: yaml:
dependency: transitive dependency: transitive
description: description:
name: yaml name: yaml
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.0" version: "3.1.1"
youtube_explode_dart: youtube_explode_dart:
dependency: "direct main" dependency: "direct main"
description: description:
name: youtube_explode_dart name: youtube_explode_dart
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.11.0" version: "1.12.0"
sdks: sdks:
dart: ">=2.17.0-0 <3.0.0" dart: ">=2.17.1 <3.0.0"
flutter: ">=2.8.1" flutter: ">=3.0.0"

View File

@ -27,12 +27,16 @@ dependencies:
universal_io: ^2.0.4 universal_io: ^2.0.4
# ffmpeg_cli: ^0.1.0 # ffmpeg_cli: ^0.1.0
audioplayers: ^1.0.0-rc.4 audioplayers: ^1.0.0-rc.4
# git:
# url: https://github.com/bluefireteam/audioplayers/tree/main/packages/audioplayers_linux
# ref: main
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
flutter_lints: ^1.0.0 flutter_lints: ^2.0.1
icons_launcher: ^1.1.3 icons_launcher: ^2.0.5
flutter_icons: flutter_icons:
android: true android: true