diff --git a/lib/main.dart b/lib/main.dart index 377e7f4..b00d73b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -23,7 +23,7 @@ class FipyApp extends StatelessWidget { child: MaterialApp( title: 'Fipy', theme: ThemeData( - primarySwatch: Colors.blue, backgroundColor: Colors.grey[900]), + colorScheme: ColorScheme.fromSwatch(primarySwatch: Colors.blue).copyWith(background: Colors.grey[900])), home: const HomeScreen(title: 'Fipy'), ), ); diff --git a/lib/providers/home.dart b/lib/providers/home.dart index 0a1789a..869695f 100644 --- a/lib/providers/home.dart +++ b/lib/providers/home.dart @@ -83,7 +83,7 @@ class HomeProvider with ChangeNotifier { if (track.id == null) { final secondMatch = track.artiste == '' ? track.album : track.artiste; 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; } const invidiousUrl = [ @@ -102,7 +102,7 @@ class HomeProvider with ChangeNotifier { print(source.url); await player.play(source); } catch (e) { - print('Play error: ' + e.toString()); + print('Play error: $e'); } Future.delayed(const Duration(milliseconds: 50)); @@ -168,27 +168,28 @@ class HomeProvider with ChangeNotifier { List> get radioList { List> menuItems = [ - const DropdownMenuItem(child: Text("FIP"), value: "fip"), - const DropdownMenuItem(child: Text("Electro"), value: "fip_electro"), - const DropdownMenuItem(child: Text("Groove"), value: "fip_groove"), - const DropdownMenuItem(child: Text("Rock"), value: "fip_rock"), - const DropdownMenuItem(child: Text("Jazz"), value: "fip_jazz"), - const DropdownMenuItem(child: Text("Pop"), value: "fip_pop"), - const DropdownMenuItem(child: Text("Reggae"), value: "fip_reggae"), - const DropdownMenuItem(child: Text("World"), value: "fip_world"), + const DropdownMenuItem(value: "fip", child: Text("FIP")), + const DropdownMenuItem(value: "fip_electro", child: Text("Electro")), + const DropdownMenuItem(value: "fip_groove", child: Text("Groove")), + const DropdownMenuItem(value: "fip_rock", child: Text("Rock")), + const DropdownMenuItem(value: "fip_jazz", child: Text("Jazz")), + const DropdownMenuItem(value: "fip_pop", child: Text("Pop")), + const DropdownMenuItem(value: "fip_reggae", child: Text("Reggae")), + const DropdownMenuItem(value: "fip_world", child: Text("World")), const DropdownMenuItem( - child: Text("Nouveautés"), value: "fip_nouveautes"), + value: "fip_nouveautes", + child: Text("Nouveautés")), ]; return menuItems; } List> get pageList { List> menuItems = [ - const DropdownMenuItem(child: Text("25"), value: "3"), - const DropdownMenuItem(child: Text("50"), value: "6"), - const DropdownMenuItem(child: Text("100"), value: "12"), - const DropdownMenuItem(child: Text("200"), value: "25"), - const DropdownMenuItem(child: Text("500"), value: "62"), + const DropdownMenuItem(value: "3", child: Text("25")), + const DropdownMenuItem(value: "6", child: Text("50")), + const DropdownMenuItem(value: "12", child: Text("100")), + const DropdownMenuItem(value: "25", child: Text("200")), + const DropdownMenuItem(value: "62", child: Text("500")), ]; return menuItems; } diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 1d67501..0e1ddd4 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -127,7 +127,7 @@ class _HomeScreenState extends State { child: Column(children: [ const SizedBox(height: 20), Text( - 'Error: ' + snapshot.error.toString(), + 'Error: ${snapshot.error}', style: TextStyle(color: Colors.grey[500]), ), ]), @@ -263,18 +263,18 @@ class _HomeScreenState extends State { // playerProvider.reload(); }, + style: ElevatedButton.styleFrom( + foregroundColor: Colors.grey[900], + backgroundColor: Colors.grey[300], + shape: const CircleBorder(), + padding: const EdgeInsets.all(12), + ), child: Icon( hp.player.state.name == 'playing' ? Icons.pause : Icons.play_arrow, color: Colors.grey[900], size: 30), - style: ElevatedButton.styleFrom( - shape: const CircleBorder(), - padding: const EdgeInsets.all(12), - primary: Colors.grey[300], - onPrimary: Colors.grey[900], - ), ), Column(children: [ IconButton( @@ -387,7 +387,7 @@ Widget trackLine(Track track) { return SizedBox( height: 30, child: Row( - children: [Text(track.title + ' - ' + track.artiste)], + children: [Text('${track.title} - ${track.artiste}')], ), ); } @@ -479,7 +479,7 @@ TableRow _buildTableRow(Track track, BuildContext context) { final secondMatch = track.artiste == '' ? track.album : track.artiste; final resultUrl = await yt.search - .search(track.title + ' ' + secondMatch!); + .search('${track.title} ${secondMatch!}'); track.id = resultUrl.first.id.value; } if (track.id != null) { diff --git a/pubspec.lock b/pubspec.lock index d980a83..096f090 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,147 +5,168 @@ packages: dependency: transitive description: name: archive - url: "https://pub.dartlang.org" + sha256: eb33140ede1b4039f4ad631f7bf3cfa58e24514e8bf87184bc32f17541af87fc + url: "https://pub.dev" source: hosted version: "3.3.0" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + sha256: "4cab82a83ffef80b262ddedf47a0a8e56ee6fbf7fe21e6e768b02792034dd440" + url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "2.4.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.10.0" audioplayers: dependency: "direct main" description: name: audioplayers - url: "https://pub.dartlang.org" + sha256: "6063c05f987596ba7a3dad9bb9a5d8adfa5e7c07b9bae5301b27c11d0b3a239f" + url: "https://pub.dev" source: hosted - version: "1.0.0-rc.4" + version: "4.0.1" audioplayers_android: dependency: transitive description: name: audioplayers_android - url: "https://pub.dartlang.org" + sha256: fb6bca878ad175d8f6ddc0e0a2d4226d81fa7c10747c12db420e96c7a096b2cc + url: "https://pub.dev" source: hosted - version: "1.0.0-rc.2" + version: "3.0.1" audioplayers_darwin: dependency: transitive description: name: audioplayers_darwin - url: "https://pub.dartlang.org" + sha256: c4a56c49347b2e85ac4e1efea218948ca0fba87f04d2a3d3de07ce2410037038 + url: "https://pub.dev" source: hosted - version: "1.0.0-rc.4" + version: "4.0.1" audioplayers_linux: dependency: transitive description: name: audioplayers_linux - url: "https://pub.dartlang.org" + sha256: "897e24f190232a3fbb88134b062aa83a9240f55789b5e8d17c114283284ef56b" + url: "https://pub.dev" source: hosted - version: "1.0.0-rc.3" + version: "2.0.1" audioplayers_platform_interface: dependency: transitive description: name: audioplayers_platform_interface - url: "https://pub.dartlang.org" + sha256: "3a90a46198d375fc7d47bc1d3070c8fd8863b6469b7d87ca80f953efb090f976" + url: "https://pub.dev" source: hosted - version: "1.0.0-rc.2" + version: "5.0.0" audioplayers_web: dependency: transitive description: name: audioplayers_web - url: "https://pub.dartlang.org" + sha256: "4f5dcbfec0bf98ea09e243d5f5b64ea43a4e6710a2f292724bed16cdba3c691e" + url: "https://pub.dev" source: hosted - version: "1.0.0-rc.3" + version: "3.0.1" audioplayers_windows: dependency: transitive description: name: audioplayers_windows - url: "https://pub.dartlang.org" + sha256: "010f575653c01ccbe9756050b18df83d89426740e04b684f6438aa26c775a965" + url: "https://pub.dev" source: hosted - version: "1.0.0-rc.3" + version: "2.0.1" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" source: hosted version: "1.3.1" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.0" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: cf75650c66c0316274e21d7c43d3dea246273af5955bd94e8184837cd577575c + url: "https://pub.dev" source: hosted version: "3.0.1" csslib: dependency: transitive description: name: csslib - url: "https://pub.dartlang.org" + sha256: d1cd6d6e4b39a4ad295204722b8608f19981677b223f3e942c0b5a33dcf57ec0 + url: "https://pub.dev" source: hosted version: "0.17.1" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: "1989d917fbe8e6b39806207df5a3fdd3d816cbd090fac2ce26fb45e9a71476e5" + url: "https://pub.dev" source: hosted version: "1.0.4" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: "35d0f481d939de0d640b3db9a7aa36a52cd22054a798a73b4f50bdad5ce12678" + url: "https://pub.dev" source: hosted version: "1.1.2" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + sha256: b69516f2c26a5bcac4eee2e32512e1a5205ab312b3536c1c1227b2b942b5f9ad + url: "https://pub.dev" source: hosted version: "6.1.2" flutter: @@ -157,9 +178,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - url: "https://pub.dartlang.org" + sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c + url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_test: dependency: "direct dev" description: flutter @@ -174,86 +196,98 @@ packages: dependency: transitive description: name: freezed_annotation - url: "https://pub.dartlang.org" + sha256: "625eb228fd9f00f952b7cd245be34791434fad48375f74e46f97dea4b4e11678" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "2.1.0" html: dependency: transitive description: name: html - url: "https://pub.dartlang.org" + sha256: bfef906cbd4e78ef49ae511d9074aebd1d2251482ef601a280973e8b58b51bbf + url: "https://pub.dev" source: hosted version: "0.15.0" http: dependency: "direct main" description: name: http - url: "https://pub.dartlang.org" + sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" + url: "https://pub.dev" source: hosted - version: "0.13.4" + version: "0.13.5" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: e362d639ba3bc07d5a71faebb98cde68c05bfbcfbbb444b60b6f60bb67719185 + url: "https://pub.dev" source: hosted version: "4.0.0" icons_launcher: dependency: "direct dev" description: name: icons_launcher - url: "https://pub.dartlang.org" + sha256: f8ccfb80b56856b6eac586980bdd9c14f5ec24fb87127514055445ceb9424f4c + url: "https://pub.dev" source: hosted - version: "1.1.3" + version: "2.1.0" image: dependency: transitive description: name: image - url: "https://pub.dartlang.org" + sha256: "483a389d6ccb292b570c31b3a193779b1b0178e7eb571986d9a49904b6861227" + url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "4.0.15" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.6.5" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: "53cddd9d4a2d253d977dbbd21642f20f580a6a65fcc05d9d69b9f0ecc264cad9" + url: "https://pub.dev" source: hosted version: "4.5.0" lints: dependency: transitive description: name: lints - url: "https://pub.dartlang.org" + sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "2.0.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.13" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.4" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.8.0" miniplayer: dependency: "direct main" description: @@ -267,98 +301,104 @@ packages: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" source: hosted version: "1.0.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.8.2" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.dartlang.org" + sha256: c7edf82217d4b2952b2129a61d3ad60f1075b9299e629e149a8d2e39c2e6aad4 + url: "https://pub.dev" source: hosted - version: "2.0.9" + version: "2.0.14" path_provider_android: dependency: transitive description: name: path_provider_android - url: "https://pub.dartlang.org" + sha256: "32bbab16092df3bedab89ed9f2c1cfaedf25d96a5036f62f16d5e372890d068c" + url: "https://pub.dev" source: hosted version: "2.0.13" - path_provider_ios: + path_provider_foundation: dependency: transitive description: - name: path_provider_ios - url: "https://pub.dartlang.org" + name: path_provider_foundation + sha256: ad4c4d011830462633f03eb34445a45345673dfd4faf1ab0b4735fbd93b19183 + url: "https://pub.dev" source: hosted - version: "2.0.8" + version: "2.2.2" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.dartlang.org" + sha256: "1e109f4df28bd95eab71e323008b53d19c4d633bc1ab05b577518773474e9621" + url: "https://pub.dev" source: hosted version: "2.1.5" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.dartlang.org" + sha256: "3dc0d51b07f85fec3746d9f4e8d31c73bb173cafa2e763f03f8df2e8d1878882" + url: "https://pub.dev" source: hosted version: "2.0.3" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.dartlang.org" + sha256: "366ad4e3541ea707f859e7148d4d5aba67d589d7936cee04a05c464a277eeb27" + url: "https://pub.dev" source: hosted version: "2.0.5" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.dartlang.org" + sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" + url: "https://pub.dev" source: hosted - version: "4.4.0" + version: "5.1.0" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" source: hosted version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "075f927ebbab4262ace8d0b283929ac5410c0ac4e7fc123c76429564facfb757" + url: "https://pub.dev" source: hosted version: "2.1.2" process: dependency: transitive description: name: process - url: "https://pub.dartlang.org" + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + url: "https://pub.dev" source: hosted version: "4.2.4" provider: dependency: "direct main" description: name: provider - url: "https://pub.dartlang.org" + sha256: "7896193cf752c40ba7f7732a95264319a787871e5d628225357f5c909182bc06" + url: "https://pub.dev" source: hosted version: "6.0.2" sky_engine: @@ -370,107 +410,130 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: "33b31b6beb98100bf9add464a36a8dd03eb10c7a8cf15aeec535e9b054aaf04b" + url: "https://pub.dev" + source: hosted + version: "3.0.1" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + url: "https://pub.dev" source: hosted - version: "0.4.9" + version: "0.4.16" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + url: "https://pub.dev" source: hosted version: "1.3.0" universal_io: dependency: "direct main" description: name: universal_io - url: "https://pub.dartlang.org" + sha256: "79f78ddad839ee3aae3ec7c01eb4575faf0d5c860f8e5223bc9f9c17f7f03cef" + url: "https://pub.dev" source: hosted version: "2.0.4" uuid: dependency: transitive description: name: uuid - url: "https://pub.dartlang.org" + sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + url: "https://pub.dev" source: hosted - version: "3.0.6" + version: "3.0.7" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + sha256: "4658d864d83cdaedcbf3e65ad93b71880a3e8c9ee1ff15d855f88fb2da66cb8a" + url: "https://pub.dev" source: hosted version: "2.5.2" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.dartlang.org" + sha256: "060b6e1c891d956f72b5ac9463466c37cce3fa962a921532fc001e86fe93438e" + url: "https://pub.dev" source: hosted version: "0.2.0+1" xml: dependency: transitive description: name: xml - url: "https://pub.dartlang.org" + sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5" + url: "https://pub.dev" source: hosted - version: "5.3.1" + version: "6.2.2" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + sha256: "23812a9b125b48d4007117254bca50abb6c712352927eece9e155207b1db2370" + url: "https://pub.dev" source: hosted - version: "3.1.0" + version: "3.1.1" youtube_explode_dart: dependency: "direct main" description: name: youtube_explode_dart - url: "https://pub.dartlang.org" + sha256: "07889a6229a63e78f8d45a3b852897c2e0fa42e96c4daa38d411be211575bc38" + url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.12.4" sdks: - dart: ">=2.17.0-0 <3.0.0" - flutter: ">=2.8.1" + dart: ">=2.18.0 <3.0.0" + flutter: ">=3.3.0" diff --git a/pubspec.yaml b/pubspec.yaml index 0e54783..2b8f092 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -26,13 +26,13 @@ dependencies: path_provider: ^2.0.9 universal_io: ^2.0.4 # ffmpeg_cli: ^0.1.0 - audioplayers: ^1.0.0-rc.4 + audioplayers: ^4.0.1 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 - icons_launcher: ^1.1.3 + flutter_lints: ^2.0.1 + icons_launcher: ^2.1.0 flutter_icons: android: true