Skip to content

Commit

Permalink
refactor: changing filestructure
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanYuuki committed Nov 25, 2024
1 parent 768a3aa commit f61507c
Show file tree
Hide file tree
Showing 33 changed files with 1,226 additions and 6,334 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

import 'dart:developer';
import 'package:aurora/auth/auth_provider.dart';
import 'package:aurora/components/anilistExclusive/wrong_tile_manga.dart';
import 'package:aurora/components/common/IconWithLabel.dart';
import 'package:aurora/components/common/reusable_carousel.dart';
import 'package:aurora/components/anime/details/character_cards.dart';
import 'package:aurora/components/manga/chapter_ranges.dart';
import 'package:aurora/components/manga/chapters.dart';
import 'package:aurora/components/android/anilistExclusive/wrong_tile_manga.dart';
import 'package:aurora/components/android/common/IconWithLabel.dart';
import 'package:aurora/components/android/common/expandable_page_view.dart';
import 'package:aurora/components/android/common/reusable_carousel.dart';
import 'package:aurora/components/android/anime/details/character_cards.dart';
import 'package:aurora/components/android/manga/chapter_ranges.dart';
import 'package:aurora/components/android/manga/chapters.dart';
import 'package:aurora/components/desktop/anime/character_cards.dart';
import 'package:aurora/components/desktop/horizontal_list.dart';
import 'package:aurora/components/platform_builder.dart';
import 'package:aurora/hiveData/appData/database.dart';
import 'package:aurora/pages/Mobile/Manga/read_page.dart';
import 'package:aurora/pages/Android/Manga/read_page.dart';
import 'package:aurora/utils/apiHooks/anilist/anime/details_page.dart';
import 'package:aurora/utils/sources/manga/handlers/manga_sources_handler.dart';
import 'package:aurora/utils/sources/unified_handler.dart';
Expand Down Expand Up @@ -199,14 +203,17 @@ class _MangaDetailsPageState extends State<MangaDetailsPage>
data != null)
Positioned(
bottom: 0,
child: LayoutBuilder(
builder: (context, constraints) {
return SizedBox(
height: 158,
width: MediaQuery.of(context).size.width,
child: bottomBar(context),
);
},
child: PlatformBuilder(
androidBuilder: SizedBox(
height: 158,
width: MediaQuery.of(context).size.width,
child: bottomBar(context, false),
),
desktopBuilder: SizedBox(
height: 108,
width: MediaQuery.of(context).size.width,
child: bottomBar(context, true),
),
),
)
]),
Expand Down Expand Up @@ -239,7 +246,7 @@ class _MangaDetailsPageState extends State<MangaDetailsPage>
}
}

CrystalNavigationBar bottomBar(BuildContext context) {
CrystalNavigationBar bottomBar(BuildContext context, bool isDesktop) {
final tabBarRoundness =
Hive.box('app-data').get('tabBarRoundness', defaultValue: 30.0);
double tabBarSizeVertical =
Expand All @@ -249,8 +256,12 @@ class _MangaDetailsPageState extends State<MangaDetailsPage>
currentIndex: selectedIndex,
unselectedItemColor: Colors.white,
selectedItemColor: Theme.of(context).colorScheme.primary,
marginR: EdgeInsets.symmetric(
horizontal: 100, vertical: getProperSize(tabBarSizeVertical)),
marginR: !isDesktop
? EdgeInsets.symmetric(
horizontal: 100, vertical: getProperSize(tabBarSizeVertical))
: EdgeInsets.symmetric(
horizontal: MediaQuery.of(context).size.width * 0.45,
vertical: getProperSize(tabBarSizeVertical)),
paddingR: EdgeInsets.symmetric(horizontal: 10),
backgroundColor: Colors.black.withOpacity(0.3),
onTap: (index) {
Expand All @@ -266,7 +277,7 @@ class _MangaDetailsPageState extends State<MangaDetailsPage>
? Iconsax.info_circle5
: Iconsax.info_circle),
CrystalNavigationBarItem(
icon: selectedIndex == 1 ? Iconsax.book : Iconsax.book)
icon: selectedIndex == 1 ? IconlyBold.play : IconlyLight.play),
],
);
}
Expand Down Expand Up @@ -324,14 +335,14 @@ class _MangaDetailsPageState extends State<MangaDetailsPage>
child: Center(child: CircularProgressIndicator()),
)
else
SizedBox(
height: selectedIndex == 0 ? 1400 : 900,
child: PageView(
padEnds: false,
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: [saikouDetails(context), chapterSection()],
),
ExpandablePageView(
controller: pageController,
itemCount: 2,
itemBuilder: (context, index) {
return selectedIndex == 0
? saikouDetails(context)
: chapterSection();
},
),
],
),
Expand Down Expand Up @@ -1211,26 +1222,42 @@ class _MangaDetailsPageState extends State<MangaDetailsPage>
),
),
const SizedBox(height: 15),
// Text('Characters',
// style: TextStyle(fontFamily: 'Poppins-Bold')),
CharacterCards(carouselData: charactersdata, isManga: true),
// ReusableCarousel(
// title: 'Popular',
// carouselData: data?['popularAnimes'],
// tag: 'details-page1',
// ),
// ReusableCarousel(
// title: 'Related',
// carouselData: data?['relations'],
// tag: 'details-page2',
// detailsPage: true,
// ),
ReusableCarousel(
detailsPage: true,
title: 'Recommended',
carouselData: data?['recommendations'],
tag: 'details-page3',
),
Text('Characters', style: TextStyle(fontFamily: 'Poppins-Bold')),
PlatformBuilder(
androidBuilder: CharacterCards(
isManga: true,
carouselData: charactersdata,
),
desktopBuilder: HorizontalCharacterCards(
isManga: true,
carouselData: charactersdata,
)),
PlatformBuilder(
androidBuilder: ReusableCarousel(
title: 'Related',
carouselData: data?['relations'],
detailsPage: true,
secondary: false,
),
desktopBuilder: HorizontalList(
title: 'Related',
carouselData: data?['relations'],
detailsPage: true,
secondary: false,
)),
PlatformBuilder(
androidBuilder: ReusableCarousel(
title: 'Recommended',
carouselData: data?['recommendations'],
detailsPage: true,
isManga: true,
),
desktopBuilder: HorizontalList(
title: 'Recommended',
carouselData: data?['recommendations'],
detailsPage: true,
isManga: true,
)),
const SizedBox(height: 100),
],
);
Expand Down Expand Up @@ -1533,6 +1560,24 @@ class _MangaDetailsPageState extends State<MangaDetailsPage>
],
),
),
Positioned(
top: 30,
right: 20,
child: Material(
borderOnForeground: false,
color: Colors.transparent,
child: IconButton(
style: ElevatedButton.styleFrom(
backgroundColor:
Theme.of(context).colorScheme.surfaceContainer,
),
onPressed: () {
Navigator.pop(context);
},
icon: Icon(Icons.close),
),
),
),
],
),
);
Expand All @@ -1545,17 +1590,14 @@ class _MangaDetailsPageState extends State<MangaDetailsPage>
padding: const EdgeInsets.only(top: 30.0),
child: Center(child: CircularProgressIndicator()),
)
: SizedBox(
height: selectedIndex == 0 ? 1450 : 900,
child: PageView(
padEnds: false,
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: [
originalInfoPage(CustomScheme, context),
chapterSection()
],
),
: ExpandablePageView(
controller: pageController,
itemCount: 2,
itemBuilder: (context, index) {
return selectedIndex == 0
? originalInfoPage(CustomScheme, context)
: chapterSection();
},
);
}

Expand Down Expand Up @@ -1729,20 +1771,41 @@ class _MangaDetailsPageState extends State<MangaDetailsPage>
],
),
),
CharacterCards(
isManga: true,
carouselData: charactersdata,
),
// ReusableCarousel(
// title: 'Related',
// carouselData: data?['relations'],
// detailsPage: true,
// ),
ReusableCarousel(
title: 'Recommended',
carouselData: data?['recommendations'],
detailsPage: true,
),
PlatformBuilder(
androidBuilder: CharacterCards(
isManga: true,
carouselData: charactersdata,
),
desktopBuilder: HorizontalCharacterCards(
isManga: true,
carouselData: charactersdata,
)),
PlatformBuilder(
androidBuilder: ReusableCarousel(
title: 'Related',
carouselData: data?['relations'],
detailsPage: true,
secondary: false,
),
desktopBuilder: HorizontalList(
title: 'Related',
carouselData: data?['relations'],
detailsPage: true,
secondary: false,
)),
PlatformBuilder(
androidBuilder: ReusableCarousel(
title: 'Recommended',
carouselData: data?['recommendations'],
detailsPage: true,
isManga: true,
),
desktopBuilder: HorizontalList(
title: 'Recommended',
carouselData: data?['recommendations'],
detailsPage: true,
isManga: true,
)),
],
);
}
Expand Down
Loading

0 comments on commit f61507c

Please sign in to comment.