From 3b5f4d8939bc1188022dc975e189fb040a7b2f9f Mon Sep 17 00:00:00 2001 From: Ryan _ <108048963+RyanYuuki@users.noreply.github.com> Date: Sun, 8 Sep 2024 14:45:47 +0530 Subject: [PATCH] - Introduced Source Support (Beta) --- lib/components/MangaExclusive/carousel.dart | 1 - lib/components/SettingsModal.dart | 1 - lib/components/episode_list.dart | 6 +++--- .../homepage/homepage_carousel.dart | 19 +++++++++++-------- lib/main.dart | 8 +++++--- lib/pages/Manga/details_page.dart | 1 - 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/components/MangaExclusive/carousel.dart b/lib/components/MangaExclusive/carousel.dart index d6cdfb98..aec1faef 100644 --- a/lib/components/MangaExclusive/carousel.dart +++ b/lib/components/MangaExclusive/carousel.dart @@ -1,6 +1,5 @@ // ignore_for_file: prefer_const_constructors -import 'dart:developer'; import 'package:aurora/components/IconWithLabel.dart'; import 'package:cached_network_image/cached_network_image.dart'; diff --git a/lib/components/SettingsModal.dart b/lib/components/SettingsModal.dart index 16f0730d..0d736f2a 100644 --- a/lib/components/SettingsModal.dart +++ b/lib/components/SettingsModal.dart @@ -1,7 +1,6 @@ import 'dart:io'; import 'package:aurora/main.dart'; -import 'package:aurora/pages/onboarding_screens/login_page.dart'; import 'package:aurora/pages/user/profile.dart'; import 'package:aurora/pages/user/settings.dart'; import 'package:flutter/material.dart'; diff --git a/lib/components/episode_list.dart b/lib/components/episode_list.dart index cb2910b3..31e328f1 100644 --- a/lib/components/episode_list.dart +++ b/lib/components/episode_list.dart @@ -54,9 +54,9 @@ class _EpisodeGridState extends State { itemCount: filteredEpisodes.length, itemBuilder: (context, index) { final episode = filteredEpisodes[index]; - final episodeNumber = episode['number']; - final episodeTitle = episode['title'] ?? 'No Title'; - final isFiller = episode['isFiller'] ?? false; + final episodeNumber = episode?['number']; + final episodeTitle = episode?['title'] ?? 'No Title'; + final isFiller = episode?['isFiller'] ?? false; final isSelected = widget.currentEpisode == episodeNumber; return GestureDetector( diff --git a/lib/components/homepage/homepage_carousel.dart b/lib/components/homepage/homepage_carousel.dart index c0693794..e08504ac 100644 --- a/lib/components/homepage/homepage_carousel.dart +++ b/lib/components/homepage/homepage_carousel.dart @@ -1,4 +1,5 @@ import 'package:aurora/components/IconWithLabel.dart'; +import 'package:aurora/pages/Anime/details_page.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:iconsax/iconsax.dart'; @@ -82,14 +83,15 @@ class HomepageCarousel extends StatelessWidget { padding: const EdgeInsets.only(right: 8.0), child: GestureDetector( onTap: () { - Navigator.pushNamed( + Navigator.push( context, - '/details', - arguments: { - 'id': itemData['animeId'], - 'posterUrl': proxyUrl + posterUrl, - 'tag': tagg - }, + MaterialPageRoute( + builder: (context) => DetailsPage( + id: itemData['animeId'], + posterUrl: proxyUrl + posterUrl, + tag: tagg, + ), + ), ); }, child: Column( @@ -102,7 +104,8 @@ class HomepageCarousel extends StatelessWidget { borderRadius: BorderRadius.circular(12), child: CachedNetworkImage( imageUrl: proxyUrl + posterUrl, - placeholder: (context, url) => Shimmer.fromColors( + placeholder: (context, url) => + Shimmer.fromColors( baseColor: Colors.grey[900]!, highlightColor: Colors.grey[700]!, child: Container( diff --git a/lib/main.dart b/lib/main.dart index 76d55829..52ed4a1a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,3 @@ -import 'dart:developer'; import 'package:aurora/database/database.dart'; import 'package:aurora/pages/onboarding_screens/login_page.dart'; @@ -131,8 +130,11 @@ class _MainAppState extends State { final id = args?['id'] ?? ''; final tag = args?['tag'] ?? ''; return MaterialPageRoute( - builder: (context) => - DetailsPage(id: id, posterUrl: posterUrl, tag: tag), + builder: (context) => DetailsPage( + id: id, + posterUrl: posterUrl, + tag: tag, + ), ); case '/watch': final id = args?['id'] ?? ''; diff --git a/lib/pages/Manga/details_page.dart b/lib/pages/Manga/details_page.dart index bc9710b5..b1c42a2c 100644 --- a/lib/pages/Manga/details_page.dart +++ b/lib/pages/Manga/details_page.dart @@ -1,6 +1,5 @@ // ignore_for_file: prefer_const_constructors, deprecated_member_use, non_constant_identifier_names, must_be_immutable, avoid_print import 'dart:convert'; -import 'dart:developer'; import 'dart:ui'; import 'package:aurora/components/IconWithLabel.dart'; import 'package:aurora/components/MangaExclusive/chapters.dart';