turnable_page 1.1.0
turnable_page: ^1.1.0 copied to clipboard
Realistic page-flipping widget for Flutter with smooth animations, interactive content, and smart gesture detection.
Changelog #
All notable changes to this project will be documented in this file.
1.1.0 - 2026-09-14 #
โจ New Features & Unified API #
- Unified PageViewMode: Unified single-page vs two-page spread controls into a single parameter
pageViewMode(single,double,auto):PageViewMode.single: Always single page (portrait) across all devices and screen sizes.PageViewMode.double: Always two-page spread (landscape).PageViewMode.auto: Automatically responsiveโdisplays a single page on mobile (<600px) and two-page spread on wide screens (>=600px).- Maintained 100% backward compatibility for deprecated
usePortrait.
- Dynamic Spread Synchronization: Fixed orientation transition in auto mode when resizing between mobile and desktop. Automatically re-assigns spreads with zero blank pages.
๐จ Realistic Page Curl Physics #
- Authentic Paper Backside: In single-page mode forward flip, the curling flap renders as a realistic 3D paper backside with natural fold gradients, keeping active page content visible on the page body during drag.
- Directional Drag Locking: Boundary flip prevention to reject invalid drag gestures on the first and last spreads.
๐ Bug Fixes & Stability #
- Auto Mode Transition: Fixed issue where switching from single to double page mode left the left page blank/white with Page 1 on the right.
- Widget & Engine Synchronization: Added
didUpdateWidgettoTurnablePageViewto ensure runtime setting and constraint changes propagate cleanly to the render tree. - Safe Render Access: Added
renderNullableandhasRendergetters toPageFlipfor safe null-aware access.
1.0.2 - 2026-09-13 #
โจ New Features #
- Configurable Center Shadow: Added
showCenterShadowto FlipSettings to toggle the spine crease shadow between pages on or off. - Independent Shadow Colors: Added individual color settings in FlipSettings for every shadow:
centerShadowColor: Spine/crease shadow between two-page spreads.outerShadowColor: Shadow cast on the page beneath the turning page.innerShadowColor: Shadow cast on the back/inside of the curled page.perimeterShadowColor: Elevation shadow along the curling page perimeter.perimeterBorderColor: Subtle hairline border line along the curling edge.
- Pinch-to-Zoom Support: Added
enableZoom,minScale, andmaxScalesettings toTurnablePageandFlipSettings, withInteractiveViewerintegration, automatic page-flip gesture suppression while zoomed in, double-tap zoom toggle, and programmaticcontroller.resetZoom(). - Pages-Only Minimal Mode: Added
PaperBoundaryDecoration.noneto disable all outer paper decorations and padding for modern minimal readers. - PaperBoundaryDecoration Customization: Added native
copyWith(...)method,PaperBoundaryDecoration.custom(...)factory constructor for intuitive high-level customization, and implemented value equality (operator ==/hashCode).
๐ Bug Fixes & Architecture Stability #
- Gesture Harmony & Vertical Scroll Conflict: Resolved issue where vertical scrolling inside
SingleChildScrollVieworListViewwas hijacked by raw pointer handlers curling page corners. Implemented directional gesture locking with priority for vertical scrolling over page flipping. - Dynamic Image Flip Performance (Issue #9): Isolated active pages in
RepaintBoundarylayers so the 60fps flip animation transforms cached GPUPictureLayers with zero dropped frames or repaint stalls on network/dynamic images. - Virtual Windowing for 150+ Pages (Issue #6): Transitioned from eager full-book widget instantiation to a sliding window (
current - 2 .. current + 3), keeping memory consumption flat for large books of any page count. - Compositing Layer Lifetime (Issue #5): Replaced raw
canvas.save()/restore()with FlutterPaintingContextlayer transforms (pushTransform,pushClipPath) and compositing checks, fixing native peer collectednullptrcrashes when renderingRepaintBoundaryorCachedNetworkImage. - Layout Constraints (Issue #4): Fixed blank rendering and layout issues when embedding
StackandSingleChildScrollViewinside pages.
๐ API & Developer Experience #
- Canonical Async Navigation (Issue #6): Unified
PageFlipControllernavigation methods (nextPage(),previousPage(),animateToPage(),jumpToPage()) to returnFuture<bool>directly without code duplication. - Type-Safe Events: Converted event handling from raw string identifiers to the
PageFlipEventenum.
1.0.1 - 2025-09-30 #
โจ New Features #
- FlipSettings Controls: Added
hideLeftShadowto individually disable the left page shadow in single-page mode. - Vertical Flip Mode: Introduced
onlyVerticalPageFlipto support vertical-only page flipping by clamping gestures to the bottom edge.
๐ Bug Fixes #
- Page Navigation: Fixed
nextPage/previousPagenot working after the first page by resetting navigation state with a fresh key and animation timing. - Animation Lifecycle: Ensured flip animations restart correctly by initializing
startedAtwhenever a new flip begins.
๐ Enhancements #
- Example App UX: Revamped the example to load pages asynchronously, show a loading indicator, and expose floating navigation buttons once data arrives.
๐งน Chores #
- Tooling: Added
.fvmrcto pin the Flutter version used for development.
1.0.0 - 2025-08-17 #
๐ MAJOR ARCHITECTURE OVERHAUL #
BREAKING CHANGES:
- Complete migration from CustomPainter to Flutter RenderBox system
- Replaced image-based page rendering with live widget rendering
- Implemented direct child widget interaction without conversion overhead
โจ New Features #
- Smart Gesture Detection: Automatic differentiation between drag (page flip) and tap (widget interaction)
- TurnablePdf Widget: Builtโin PDF page flip viewer (asset / network / file) with single & double page modes, shimmer loading, custom loading/error builders, spine effect, and interactive page rendering
- Interactive Widgets: Buttons and other widgets within pages now work natively without any conversion
- Enhanced Physics: Added inertia, easing, and realistic page bending animations
- Improved Performance: Eliminated expensive widget-to-image conversion pipeline
- Better Hit Testing: Intelligent detection of interactive widgets vs page flip areas
๐๏ธ Technical Improvements #
- RenderTurnableBook: Custom RenderBox with proper Flutter integration
- Frame Scheduling: Integrated with SchedulerBinding for smooth animations
- Gesture System: Complete rewrite of pointer event handling
- Memory Optimization: Direct widget rendering with cached clipping paths
- Error Handling: Fixed "Build scheduled during frame" issues
๐จ Enhanced Visual Effects #
- Native Shadow System: Using Flutter's painting system for realistic shadows
- Clipping Optimization: Cached path generation for complex page shapes
- Animation Quality: Improved frame-based animation with configurable physics
๐ Developer Experience #
- Cleaner API: Simplified configuration with automatic behavior
- Better Documentation: Comprehensive Arabic examples and guides
- Edge Case Handling: Improved stability and error recovery
- Configuration Options: Extensive customization for gesture detection and animation
๐๏ธ Removed #
- Custom canvas interaction handlers
- Image conversion utilities
- Complex painter systems
- Manual widget tree management
0.0.1+1 - 2025-08-09 #
- Docs: Update README to use GitHub-hosted GIFs that render on pub.dev
- Chore: Add
.pubignoreto exclude largevideos/from published package - Docs: Minor copy updates
0.0.1 - 2025-08-09 #
- Initial release of Turnable Page package.
- Core page-