diff --git a/lib/screens/main/main_screen.dart b/lib/screens/main/main_screen.dart index cceff9c..492b579 100644 --- a/lib/screens/main/main_screen.dart +++ b/lib/screens/main/main_screen.dart @@ -51,6 +51,7 @@ class _MainScreenState extends State { @override Widget build(BuildContext context) { + double screenHeight = MediaQuery.of(context).size.height; return Scaffold( appBar: AppBar( centerTitle: false, @@ -86,8 +87,8 @@ class _MainScreenState extends State { backgroundColor: altWhite, body: CustomScrollView( slivers: [ - const SliverToBoxAdapter( - child: Carousel(), + SliverToBoxAdapter( + child: Carousel(screenHeight: screenHeight), ), SliverToBoxAdapter( child: Padding( diff --git a/lib/widgets/carousel.dart b/lib/widgets/carousel.dart index 1f9f68e..60c21fc 100644 --- a/lib/widgets/carousel.dart +++ b/lib/widgets/carousel.dart @@ -5,7 +5,8 @@ import 'package:saphy/utils/colors.dart'; import 'package:saphy/utils/textstyles.dart'; class Carousel extends StatelessWidget { - const Carousel({super.key}); + double screenHeight; + Carousel({super.key, required this.screenHeight}); @override Widget build(BuildContext context) { @@ -30,7 +31,7 @@ class Carousel extends StatelessWidget { child: CarouselSlider.builder( itemCount: itemList.length, options: CarouselOptions( - height: 575, + height: screenHeight * 0.6, viewportFraction: 1, enlargeCenterPage: false, autoPlay: true,