We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tapToSelect
tapToSelect is not working in some cases, I can't figure out what it could be, here's a simple reproducible example:
import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter_custom_carousel/flutter_custom_carousel.dart'; class Carousel extends StatelessWidget { const Carousel({ required this.children, super.key, }); final List<Widget> children; @override Widget build(BuildContext context) { double heightToTranslation(double scrollRatio) => scrollRatio * 60; double scrollToScale(double scrollRatio) { const min = 0.8; const max = 1.0; return (min + (scrollRatio + 1) * (max - min)).clamp(min, max); } return LayoutBuilder( builder: (context, constraints) { return CustomCarousel( onSelectedItemChanged: (item) => print('item: $item'), itemCountBefore: 2, itemCountAfter: 0, loop: true, effectsBuilder: (int index, double scrollRatio, Widget child) { final translation = heightToTranslation(scrollRatio); final scale = scrollToScale(scrollRatio); print('$index $scale $translation $scrollRatio'); return Transform( transform: Matrix4.translationValues(0, translation, 0)..scale(scale, scale, 1), alignment: Alignment.topCenter, child: child, ); }, children: children, ); }, ); } } class DemoCarouselPage extends StatelessWidget { const DemoCarouselPage({super.key}); @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.all(24), child: Center( child: SizedBox( height: 250, child: Carousel( children: [ for (int i = 0; i < 15; i++) Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(20), border: Border.all( color: Colors.black, width: 1, ), ), child: Center( child: Text( 'Card $i', style: TextStyle(color: Colors.black), ), ), ) ], ), ), ), ); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
tapToSelect
is not working in some cases, I can't figure out what it could be, here's a simple reproducible example:The text was updated successfully, but these errors were encountered: