diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index 64a6f14d..3747de3f 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -330,7 +330,7 @@ class _HomePageState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => AnimeList(), + builder: (context) => const AnimeList(), ), ); Provider.of(context, listen: false) @@ -346,7 +346,7 @@ class _HomePageState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => AnilistMangaList(), + builder: (context) => const AnilistMangaList(), ), ); Provider.of(context, listen: false) @@ -370,7 +370,7 @@ class _HomePageState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => AnimeList(), + builder: (context) => const AnimeList(), ), ); Provider.of(context, listen: false) @@ -387,7 +387,7 @@ class _HomePageState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => AnilistMangaList(), + builder: (context) => const AnilistMangaList(), ), ); Provider.of(context, listen: false) diff --git a/lib/utils/apiHooks/anilist/anime/search_page.dart b/lib/utils/apiHooks/anilist/anime/search_page.dart index 97ac06f7..76a0a086 100644 --- a/lib/utils/apiHooks/anilist/anime/search_page.dart +++ b/lib/utils/apiHooks/anilist/anime/search_page.dart @@ -29,7 +29,7 @@ Future>> fetchAnimeBySearch({ query (\$search: String, \$sort: [MediaSort], \$season: MediaSeason, \$status: MediaStatus, \$format: MediaFormat, \$genre_in: [String]) { Page (page: 1) { media ( - ${query != null && query.isNotEmpty ? 'search: \$search,' : ''} + ${query.isNotEmpty ? 'search: \$search,' : ''} type: ANIME, sort: \$sort, season: \$season, diff --git a/lib/utils/sources/anime/extractors/vidstream.dart b/lib/utils/sources/anime/extractors/vidstream.dart index 33673ef1..7ab930ab 100644 --- a/lib/utils/sources/anime/extractors/vidstream.dart +++ b/lib/utils/sources/anime/extractors/vidstream.dart @@ -25,7 +25,7 @@ class Vidstream { final res = (await get( Uri.parse( - "${epLink.scheme}://${epLink.host}/encrypt-ajax.php?${params}"), + "${epLink.scheme}://${epLink.host}/encrypt-ajax.php?$params"), headers: { 'X-Requested-With': 'XMLHttpRequest', })); @@ -40,8 +40,9 @@ class Vidstream { dynamic qualityList = []; - if (parsed['source'] == null && parsed['source_bk'] == null) + if (parsed['source'] == null && parsed['source_bk'] == null) { throw Exception("No stream found"); + } for (final src in parsed['source']) { qualityList.add({ @@ -78,7 +79,7 @@ class Vidstream { .querySelector('script[data-name="episode"]') ?.attributes['data-value'] ?? ''; - if (val.length == 0) return null; + if (val.isEmpty) return null; final Encrypter encrypter = Encrypter(AES(keys['key'] as Key, mode: AESMode.cbc, padding: null)); final decrypted = @@ -90,7 +91,7 @@ class Vidstream { final res = await fetch(epLink); final doc = html.parse(res); final String link = doc.querySelector("iframe")?.attributes['src'] ?? ''; - if (link.length == 0) return null; + if (link.isEmpty) return null; return link; } diff --git a/lib/utils/sources/manga/base/source_base.dart b/lib/utils/sources/manga/base/source_base.dart index 0722c1f6..aef7870b 100644 --- a/lib/utils/sources/manga/base/source_base.dart +++ b/lib/utils/sources/manga/base/source_base.dart @@ -7,5 +7,4 @@ abstract class SourceBase { Future fetchMangaSearchResults(String query); Future fetchChapterImages( {required String mangaId, required String chapterId}); - Future mapToAnilist(String query); } \ No newline at end of file