Skip to content

Commit

Permalink
style: minor styling changes on carousel and cover carousels
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanYuuki committed Nov 29, 2024
1 parent 89588b2 commit a1093e1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 31 deletions.
4 changes: 2 additions & 2 deletions lib/components/desktop/cover_carousel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class _DesktopCoverCarouselState extends State<DesktopCoverCarousel> {
}
},
child: Container(
height: 400,
height: 300,
margin: const EdgeInsets.symmetric(horizontal: 10),
child: Hero(
tag: tag,
Expand Down Expand Up @@ -161,7 +161,7 @@ class _DesktopCoverCarouselState extends State<DesktopCoverCarousel> {
);
},
options: CarouselOptions(
height: 500,
height: 400,
viewportFraction: 1,
initialPage: 0,
enableInfiniteScroll: true,
Expand Down
40 changes: 13 additions & 27 deletions lib/components/desktop/novel/cover_carousel.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:math';
import 'package:aurora/pages/Android/Anime/details_page.dart';
import 'package:aurora/pages/Android/Manga/details_page.dart';
import 'package:aurora/pages/Android/Novel/details_page.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';
Expand All @@ -10,13 +9,11 @@ import 'package:smooth_page_indicator/smooth_page_indicator.dart';
class DesktopCoverCarousel extends StatefulWidget {
final List<dynamic>? animeData;
final String? title;
final bool isManga;

const DesktopCoverCarousel({
super.key,
this.animeData,
this.title,
this.isManga = false,
});

@override
Expand Down Expand Up @@ -54,28 +51,17 @@ class _DesktopCoverCarouselState extends State<DesktopCoverCarousel> {
children: [
GestureDetector(
onTap: () {
if (widget.isManga) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MangaDetailsPage(
id: anime['id'],
posterUrl: posterUrl,
tag: tag,
)));
} else {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => DetailsPage(
id: anime['id'],
posterUrl: posterUrl,
tag: tag,
)));
}
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => NovelDetailsPage(
id: anime['id'],
posterUrl: posterUrl,
tag: tag,
)));
},
child: Container(
height: 400,
height: 300,
margin: const EdgeInsets.symmetric(horizontal: 10),
child: Hero(
tag: tag,
Expand Down Expand Up @@ -114,8 +100,8 @@ class _DesktopCoverCarouselState extends State<DesktopCoverCarousel> {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Text(
(anime?['description']?.replaceAll(
RegExp(r'<[^>]*>|&[^;]+;'), ''))
(anime?['description']
?.replaceAll(RegExp(r'<[^>]*>|&[^;]+;'), ''))
?.toString()
.trim() ??
'',
Expand All @@ -134,7 +120,7 @@ class _DesktopCoverCarouselState extends State<DesktopCoverCarousel> {
);
},
options: CarouselOptions(
height: 500,
height: 400,
viewportFraction: 1,
initialPage: 0,
enableInfiniteScroll: true,
Expand Down
19 changes: 17 additions & 2 deletions lib/components/desktop/novel/horizontal_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ class HorizontalList extends StatelessWidget {
color: Theme.of(context).colorScheme.primary,
),
),
const Text(
' Novels',
style: TextStyle(
fontSize: 16,
fontFamily: 'Poppins',
fontWeight: FontWeight.bold,
),
),
const Expanded(child: SizedBox.shrink()),
IconButton(
onPressed: () => slideCarousel(true),
Expand Down Expand Up @@ -177,10 +185,17 @@ class HorizontalList extends StatelessWidget {
topLeft: Radius.circular(18),
bottomRight: Radius.circular(16))),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Icon(Iconsax.star5),
Icon(
Iconsax.star5,
size: 13,
color:
Theme.of(context).colorScheme.primary,
),
const SizedBox(
width: 8,
width: 4,
),
Text(
extraData,
Expand Down

0 comments on commit a1093e1

Please sign in to comment.