diff --git a/lib/pages/detail.dart b/lib/pages/detail.dart index 44268ec..bd041b8 100644 --- a/lib/pages/detail.dart +++ b/lib/pages/detail.dart @@ -163,6 +163,12 @@ class _DetailPageState extends State { } } + double _getAspectRatio() { + double width = MediaQuery.sizeOf(context).width; + double height = MediaQuery.sizeOf(context).height; + return max(width, height) / min(width, height); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -191,7 +197,7 @@ class _DetailPageState extends State { child: Image.network( item!.images[realIdx].url, width: min( - 800, + 550, MediaQuery.sizeOf(context) .width)), ); @@ -199,7 +205,10 @@ class _DetailPageState extends State { carouselController: _carouselController, options: CarouselOptions( enlargeCenterPage: true, - aspectRatio: 1, + height: min( + MediaQuery.sizeOf(context).height - + 100, + 400), enableInfiniteScroll: false, onPageChanged: (index, reason) { setState(() { @@ -239,7 +248,7 @@ class _DetailPageState extends State { ]) : Image.network(item!.images[0].url, width: min( - 800, MediaQuery.sizeOf(context).width)), + 550, MediaQuery.sizeOf(context).width)), item!.description != '' ? Padding( padding: const EdgeInsetsDirectional.all(30),