ticketcher 2.0.0
ticketcher: ^2.0.0 copied to clipboard
A Flutter package for creating beautiful ticket-style cards with customizable borders, dividers, and patterns. Perfect for event tickets, boarding passes, and coupons.
2.0.0 #
Breaking changes #
- Removed
AnimatedTicketcher,AnimatedTicketcherController,TicketAnimation, andAnimationType. The animation layer was a thin wrapper over Flutter's built-inFadeTransition/SlideTransition/ScaleTransition/Transformand added more surface area than value. Wrap aTicketcher/VTicketcher/HTicketcherin those transitions directly if you need entry/exit effects.
Bug fixes #
- Fixed dividers and notches drawing at the top of the ticket (y=0) instead of between sections — reproducible whenever a parent re-render or animation raced the first paint. Root cause:
VTicketcherPainter/HTicketcherPainter/VTicketcherClipper/HTicketcherClipperstored the per-section size list by reference to the State's mutable list. The State measures each section in aWidgetsBinding.instance.addPostFrameCallbackand mutates that list in place, so the new painter and the OLD painter both pointed at the same (already-mutated) list.shouldRepaint(oldDelegate)then compared two equal lists and returned false, leaving the very first paint — the one made before measurement, with all-zero heights — cached forever inside the newRepaintBoundaryfrom 1.3.0. Painter / clipper constructors now snapshot the list withList<double>.unmodifiable(...).
1.3.0 #
Behavior changes #
Section.==andhashCodenow include thechildwidget. Previously twoSections with different children but identical decoration compared as equal, which caused the painter'sshouldRepaintto incorrectly skip repaints when children changed (visual stale-paint bug). If you previously relied on the old behavior, see migration notes.TicketWatermark.==andhashCodesimilarly now include thewidgetfield for widget watermarks.
Bug fixes #
VTicketcherPainter.shouldRepaint/HTicketcherPainter.shouldRepaintnow comparesectionHeights/sectionWidthslists by value (with a 0.5 px epsilon), not by reference. Previously every widget rebuild allocated a new list instance andoldDelegate.list != newDelegate.listwas alwaystrue, so the ticket repainted on every parent rebuild even when nothing visual had changed.- Added
==andhashCodeimplementations forBaseDividerStyleand all 8 divider style subclasses (SolidDividerStyle,DashedDividerStyle,CirclesDividerStyle,WaveDividerStyle,SmoothWaveDividerStyle,DottedDividerStyle,DoubleLineDividerStyle,TearLineDividerStyle) and theTicketDividerwrapper. Previously these fell back to reference equality, causingTicketcherDecoration.==to always return false for semantically equal decorations and forcing unnecessary repaints. - Added
==andhashCodetoTicketWatermark. ImageResolver.dispose()andclear()now detach pending stream listeners before clearing the internal map. Previously listeners attached during in-flight image loads remained on theirImageStreamafter the resolver was disposed, leaking and riskingsetState-after-disposewarnings._VTicketcherState/_HTicketcherStatenow route the "decoration image was removed" path through amounted-guardedsetStateinstead of mutating_decorationBackgroundImagedirectly. Prevents a missed rebuild when an image is later cleared without changing the section count.
Performance #
- Both painters now cache their
Paintobjects (_borderPaint,_backgroundPaint,_dividerLinePaint,_dividerFillPaint,_shadowPaint,_sectionFillPaint,_imageOverlayPaint,_scissorsBladePaint,_scissorsFillPaint, plus a_stackPainton the V painter) asfinalinstance fields and mutate them in place per draw site. Previously everypaint()call allocated 10+ short-livedPaintobjects (Skia snapshots state at draw time, so reuse is safe). - Both painters now cache the watermark
TextPainterkeyed by(text, style, opacity)so.layout()only runs when the watermark actually changes, not everypaint()call. BlurWrappernow short-circuits whenblurEffect.sigma == 0, returning the child directly. Previously it always wrapped inBackdropFilter/ImageFiltered, which forces an offscreen layer (saveLayer) even at zero blur.VTicketcher/HTicketchernow wrap theirCustomPaintin aRepaintBoundary. Combined with the correctedshouldRepaintlogic, ancestor rebuilds (theme changes, animation tickers, parentsetState) no longer dirty the ticket layer.
Other #
- Annotated all model value-types with
@immutable. - Tightened
pubspec.yamlFlutter constraint from>=1.17.0to>=3.10.0to match the actual Dart^3.7.0SDK requirement. - Tightened
analysis_options.yamlwithstrict-casts,strict-inference, andstrict-raw-types. lib/ticketcher.dartnow exportsticket_clipper.dart(VTicketcherClipper,HTicketcherClipper) which were previously public-by-name but unreachable through the package barrel.- Extracted shared painter equality helpers (
listsEqualWithEpsilon,mapsEqual,sectionsEqual) intolib/src/painters/_equality.dartso V and H painters use one source of truth. - Added unit + widget test scaffolding (
test/helpers/,test/models/,test/painters/,test/widgets/) with 49 tests covering equality,shouldRepaint,RepaintBoundarybehaviour,BlurWrapperfast-path, andImageResolverlistener lifecycle. - Declared
screenshots:inpubspec.yamlso the pub.dev landing page surfaces representative ticket designs (concert, flight, gradient, multi-section, holographic).
1.2.0 #
- Updated README documentation with comprehensive Section Gradients guide
- Added Section Gradients to Table of Contents and Features list
- Added code examples for Linear, Radial, and Sweep gradients
- Documented background precedence order for section styling
- General documentation improvements
1.1.0 #
- NEW FEATURE: Added section gradient background support
- Added
gradientproperty toSectionmodel supporting LinearGradient, RadialGradient, and SweepGradient - Each section can now have its own gradient background independent of other sections
- Updated background precedence:
backgroundImage>gradient>color> decoration background - Works seamlessly with both horizontal and vertical tickets
- Full backward compatibility maintained - existing code using
colororbackgroundImagecontinues to work
- Added
- Added comprehensive section gradient showcase example demonstrating:
- Linear gradients in horizontal and vertical tickets
- Radial gradients with various configurations
- Sweep gradients with multiple color stops
- Mixed gradient types in multi-section tickets
- Gradient precedence examples
- Updated documentation with gradient examples and precedence order
- Enhanced
Sectionmodel with gradient support in constructor, copyWith, equality, and hashCode
0.6.0 #
- NEW FEATURE: Added image background support for tickets and sections
- Added
backgroundImage,backgroundImageFit,backgroundImageOpacity, andbackgroundImageAlignmentproperties to bothTicketcherDecorationandSection - Support for any
ImageProvider(NetworkImage, AssetImage, MemoryImage, FileImage) - Global ticket background images via
TicketcherDecoration.backgroundImage - Per-section background images via
Section.backgroundImage - Configurable image fit modes (cover, contain, fill, fitWidth, fitHeight, scaleDown, none)
- Adjustable image opacity from 0.0 to 1.0
- Custom image alignment options
- Smart background precedence: section image > section color > decoration image > gradient > background color
- Efficient image preloading and caching with
ImageResolverhelper class - Images properly clip to ticket shape including border patterns and rounded corners
- Works with both horizontal and vertical tickets
- Added
- Added comprehensive image backgrounds showcase example demonstrating:
- Global ticket backgrounds with different fit modes
- Per-section backgrounds with varying opacity
- Mixing images with solid colors and gradients
- BoxFit mode comparisons
- Opacity control examples
- Created
ImageResolverhelper class for efficient image loading and caching - Full backward compatibility maintained
- Updated documentation with extensive image backgrounds examples and usage guides
0.5.0 #
- NEW FEATURE: Enhanced blur and glassmorphism effects with comprehensive documentation
- Added comprehensive blur effects showcase example with 3 different blur styles
- Enhanced README.md with organized screenshot gallery by feature categories
- Added detailed blur effects documentation with examples and usage guides
- Improved documentation structure and organization
- Created feature mapping and comprehensive examples
- Full backward compatibility maintained
- Updated documentation with blur effect examples and usage
0.4.0 #
- NEW FEATURE: Added blur and glassmorphism effects
- Added
BlurEffectclass with three blur styles: backdrop, frosted, and gaussian - Added
blurEffectproperty toTicketcherDecoration - Backdrop blur: blurs content behind the ticket
- Frosted glass: backdrop blur with customizable tinted overlay
- Gaussian blur: applies blur to the ticket content itself
- Configurable sigma (intensity), tint color, and opacity
- Created
BlurWrapperwidget for efficient blur rendering - Works with both horizontal and vertical tickets
- Added
- Added comprehensive blur effects showcase example with 3 different blur styles
- Full backward compatibility maintained
- Updated documentation with blur effect examples and usage
0.0.8 #
- NEW FEATURE: Added comprehensive watermark support
- Added
TicketWatermarkclass with text and widget watermark support - Added
watermarkproperty toTicketcherDecoration - Support for various watermark alignments (center, corners, edges)
- Configurable opacity, rotation, and positioning with custom offsets
- Repeated watermark patterns across the entire ticket (text watermarks only)
- Custom text styling for text-based watermarks
- Widget watermarks: Use any Flutter widget as a watermark (icons, containers, custom layouts) - single instance only
- Works with both horizontal and vertical tickets
- Added
- Added comprehensive watermark showcase example with 4 different watermark types
- Full backward compatibility maintained
- Updated documentation with watermark examples and usage
0.0.7 #
- NEW FEATURE: Added gradient border support
- Added
borderGradientproperty toTicketcherDecoration - Added
borderWidthproperty for controlling gradient border thickness - Support for all Flutter gradient types (LinearGradient, RadialGradient, SweepGradient)
- Gradient borders take precedence over solid borders when both are specified
- Full backward compatibility maintained
- Added
- Added comprehensive example showcase for gradient borders
- Added extensive test coverage for gradient border functionality
- Updated documentation with gradient border examples and usage
0.0.6 #
- Added stacked effect feature for vertical tickets
- Updated README with new gallery layout
- Fixed image display issues
- Improved documentation
0.0.5 #
- Initial release
0.0.1 #
- TODO: Describe initial release.
