flutter_screen_responsive 1.0.0
flutter_screen_responsive: ^1.0.0 copied to clipboard
Responsive layout toolkit for Flutter with InheritedWidget-based breakpoints, CSS-like local overrides, and ScreenUtil scaling.
1.0.0 #
Breaking: Complete architecture rewrite — InheritedWidget-based ResponsiveScope.
New features #
ResponsiveScope(InheritedWidget): Carries device type and screen size down the widget tree.- Local breakpoint overrides:
ResponsiveScope.overrideBreakpoints()lets you override breakpoints, scaling, and design sizes for any subtree — like CSS@mediaoverrides. context.responsiveaccessor: Access the nearest scope from any widget viaBuildContext.- Lazy
value<T>()resolver: Only the matched device type's builder gets called. - New file structure: All new code in
lib/src/v2/, old code moved tolib/src/v1/.
Deprecated #
- All v1 APIs marked
@Deprecated:ResponsiveUtils,Responsivewidget,RPadding,RSizedBox, oldSizeExtension, oldResponsiveInit. - Legacy import available:
import 'package:flutter_screen_responsive/flutter_screen_responsive_legacy.dart';
Migration #
ResponsiveUtils.isMobile→context.responsive.isMobileResponsiveUtils.value<T>(mobile: x)→context.responsive.value(mobile: () => x)Responsive(mobile: (c) => widget)→context.responsive.value(mobile: () => widget)
0.0.6 #
- Add
DeviceType.tabletSmalland align enum order:mobileSmall < mobile < tabletSmall < tablet < desktop < desktopLarge. - Responsive: add builders
mobileSmall,tabletSmall,desktopLargeand implement full switch-based fallbacks. - ResponsiveUtils:
- add
isTabletSmallgetter - simplify
.value<T>()to a switch with the same fallbacks asResponsive
- add
- README: update device types, examples, and add
.value<T>()usage.
0.0.5 #
- Resolved pub points issues (analysis clean, tightened docs/metadata).
0.0.3 #
- Added additional default
DeviceTypes:mobileSmall,laptop,desktopLarge. - Optimized breakpoint selection in
ResponsiveUtils:- ordered breakpoint list with cached last index
- O(1) fast path and neighbor hop, small-N scan, O(log n) fallback
- added
breakpointForWidth(width)to get the exact active breakpoint
- Resolved extension conflicts with
flutter_screenutilby aliasing tosuand hiding its extension symbols. - Documentation: improved docs in
src/extension.dart,src/init.dart, andsrc/device_type.dart. - New adaptive widgets added:
RPadding,RSizedBox.
0.0.2 #
- Updated README.md documentation