diff --git a/lib/screens/main_features_screens/foodies/foodies_main_screen.dart b/lib/screens/main_features_screens/foodies/foodies_main_screen.dart index a59427b..3cef384 100644 --- a/lib/screens/main_features_screens/foodies/foodies_main_screen.dart +++ b/lib/screens/main_features_screens/foodies/foodies_main_screen.dart @@ -127,75 +127,85 @@ class _FoodiesScreenState extends State { return CarouselSlider.builder( itemCount: 3, itemBuilder: (context, index, realIndex) { - return ClipRRect( + return InkWell( borderRadius: BorderRadius.circular(12), - child: Container( - color: greyColor, - child: Stack( - fit: StackFit.expand, - children: [ - ClipRRect( - child: CachedNetworkImage( - imageUrl: item?.thumbnail[index] ?? _placeHolder, - imageBuilder: (context, imageProvider) => Container( - decoration: BoxDecoration( - image: DecorationImage( - image: imageProvider, - fit: BoxFit.cover, + onTap: () async { + final url = + Uri.parse(itemCarousel.carousel![0].link[index].toString()); + if (await canLaunchUrl(url)) { + await launchUrl(url); + } + }, + child: ClipRRect( + borderRadius: BorderRadius.circular(12), + child: Container( + color: greyColor, + child: Stack( + fit: StackFit.expand, + children: [ + ClipRRect( + child: CachedNetworkImage( + imageUrl: item?.thumbnail[index] ?? _placeHolder, + imageBuilder: (context, imageProvider) => Container( + decoration: BoxDecoration( + image: DecorationImage( + image: imageProvider, + fit: BoxFit.cover, + ), ), ), - ), - placeholder: (context, url) => const Center( - child: CircularProgressIndicator(), - ), - errorWidget: (context, url, error) => const Center( - child: Icon(Icons.error), + placeholder: (context, url) => const Center( + child: CircularProgressIndicator(), + ), + errorWidget: (context, url, error) => const Center( + child: Icon(Icons.error), + ), ), ), - ), - Container( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - Colors.black, - greyColor.withOpacity(0.1), - ], - )), - ), - Align( - alignment: Alignment.bottomCenter, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "${item?.title[index].substring(0, 45)}..", - style: regularStyle.copyWith(color: whiteColor), - ), - GestureDetector( - onTap: () async { - final url = Uri.parse(itemCarousel - .carousel![0].link[index] - .toString()); - if (await canLaunchUrl(url)) { - await launchUrl(url); - } - }, - child: Text( - "Baca Selengkapnya", - style: regularStyle.copyWith( - color: greyTextColor, fontSize: 13), - ), - ), + Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Colors.black, + greyColor.withOpacity(0.1), ], + )), + ), + Align( + alignment: Alignment.bottomCenter, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "${item?.title[index].substring(0, 45)}..", + style: regularStyle.copyWith(color: whiteColor), + ), + InkWell( + onTap: () async { + final url = Uri.parse(itemCarousel + .carousel![0].link[index] + .toString()); + if (await canLaunchUrl(url)) { + await launchUrl(url); + } + }, + child: Text( + "Baca Selengkapnya", + style: regularStyle.copyWith( + color: greyTextColor, fontSize: 13), + ), + ), + ], + ), ), ), - ), - ], + ], + ), ), ), );