From 577a8c5b576532fc09470bbbaaece83e4f82b244 Mon Sep 17 00:00:00 2001 From: Phan An Date: Sat, 20 Apr 2024 19:16:08 +0200 Subject: [PATCH] fix: data type for playlist ID --- ios/Podfile.lock | 10 ---------- lib/models/playlist.dart | 6 +++--- lib/providers/song_provider.dart | 2 +- lib/ui/screens/login.dart | 1 - lib/ui/screens/now_playing.dart | 1 - lib/ui/screens/playlist_details.dart | 2 +- lib/ui/widgets/artist_card.dart | 1 - lib/ui/widgets/song_card.dart | 1 - test/ui/widgets/playlist_row_test.dart | 2 -- 9 files changed, 5 insertions(+), 21 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 0077372..b9cf3c1 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -12,15 +12,11 @@ PODS: - FMDB/standard (2.7.5) - just_audio (0.0.1): - Flutter - - MTBBarcodeScanner (5.0.11) - native_qr (0.0.1): - Flutter - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS - - qr_code_scanner (0.2.0): - - Flutter - - MTBBarcodeScanner - ReachabilitySwift (5.0.0) - sqflite (0.0.2): - Flutter @@ -34,13 +30,11 @@ DEPENDENCIES: - just_audio (from `.symlinks/plugins/just_audio/ios`) - native_qr (from `.symlinks/plugins/native_qr/ios`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - - qr_code_scanner (from `.symlinks/plugins/qr_code_scanner/ios`) - sqflite (from `.symlinks/plugins/sqflite/ios`) SPEC REPOS: trunk: - FMDB - - MTBBarcodeScanner - ReachabilitySwift EXTERNAL SOURCES: @@ -58,8 +52,6 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/native_qr/ios" path_provider_foundation: :path: ".symlinks/plugins/path_provider_foundation/darwin" - qr_code_scanner: - :path: ".symlinks/plugins/qr_code_scanner/ios" sqflite: :path: ".symlinks/plugins/sqflite/ios" @@ -70,10 +62,8 @@ SPEC CHECKSUMS: Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa - MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb native_qr: 2a3151f33e6c69d4320fc5c5f24848200c1aa4fa path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9 - qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 diff --git a/lib/models/playlist.dart b/lib/models/playlist.dart index 6909031..08b2801 100644 --- a/lib/models/playlist.dart +++ b/lib/models/playlist.dart @@ -2,7 +2,7 @@ import 'package:app/models/models.dart'; import 'package:faker/faker.dart'; class Playlist { - dynamic id; // This might be a UUID string in the near future + var id; // This might be a UUID string in the near future String name; bool isSmart; List songs = []; @@ -21,11 +21,11 @@ class Playlist { ); } - factory Playlist.fake({dynamic id, String? name, bool? isSmart}) { + factory Playlist.fake({var id, String? name, bool? isSmart}) { Faker faker = Faker(); return Playlist( - id: id ?? faker.randomGenerator.integer(100, min: 1), + id: id ?? faker.guid.guid(), name: name ?? faker.food.cuisine(), isSmart: isSmart ?? false, ); diff --git a/lib/providers/song_provider.dart b/lib/providers/song_provider.dart index 977523f..26f61ed 100644 --- a/lib/providers/song_provider.dart +++ b/lib/providers/song_provider.dart @@ -91,7 +91,7 @@ class SongProvider with ChangeNotifier, StreamSubscriber { } Future> fetchForPlaylist( - int playlistId, { + var playlistId, { bool forceRefresh = false, }) async { if (forceRefresh) AppState.delete(['playlist.songs', playlistId]); diff --git a/lib/ui/screens/login.dart b/lib/ui/screens/login.dart index bcd4580..596fcd5 100644 --- a/lib/ui/screens/login.dart +++ b/lib/ui/screens/login.dart @@ -9,7 +9,6 @@ import 'package:app/utils/preferences.dart' as preferences; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_spinkit/flutter_spinkit.dart'; -import 'package:native_qr/native_qr.dart'; import 'package:provider/provider.dart'; class LoginScreen extends StatefulWidget { diff --git a/lib/ui/screens/now_playing.dart b/lib/ui/screens/now_playing.dart index 2a0e2be..43e2a27 100644 --- a/lib/ui/screens/now_playing.dart +++ b/lib/ui/screens/now_playing.dart @@ -1,6 +1,5 @@ import 'dart:ui'; -import 'package:app/enums.dart'; import 'package:app/main.dart'; import 'package:app/mixins/stream_subscriber.dart'; import 'package:app/models/models.dart'; diff --git a/lib/ui/screens/playlist_details.dart b/lib/ui/screens/playlist_details.dart index 8c3099a..56ee2e1 100644 --- a/lib/ui/screens/playlist_details.dart +++ b/lib/ui/screens/playlist_details.dart @@ -30,7 +30,7 @@ class _PlaylistDetailsScreen extends State { } Future> buildRequest( - int playlistId, { + var playlistId, { bool forceRefresh = false, }) { return context diff --git a/lib/ui/widgets/artist_card.dart b/lib/ui/widgets/artist_card.dart index e8f20c1..0bb73e8 100644 --- a/lib/ui/widgets/artist_card.dart +++ b/lib/ui/widgets/artist_card.dart @@ -1,4 +1,3 @@ -import 'package:app/enums.dart'; import 'package:app/models/models.dart'; import 'package:app/router.dart'; import 'package:app/ui/widgets/widgets.dart'; diff --git a/lib/ui/widgets/song_card.dart b/lib/ui/widgets/song_card.dart index 930afbe..2e76a08 100644 --- a/lib/ui/widgets/song_card.dart +++ b/lib/ui/widgets/song_card.dart @@ -1,4 +1,3 @@ -import 'package:app/enums.dart'; import 'package:app/main.dart'; import 'package:app/models/models.dart'; import 'package:app/router.dart'; diff --git a/test/ui/widgets/playlist_row_test.dart b/test/ui/widgets/playlist_row_test.dart index dacfcba..ac0de35 100644 --- a/test/ui/widgets/playlist_row_test.dart +++ b/test/ui/widgets/playlist_row_test.dart @@ -7,9 +7,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; -import 'package:rxdart/rxdart.dart'; import '../../extensions/widget_tester_extension.dart'; import 'playlist_row_test.mocks.dart';