extensions_plus 2.0.0
extensions_plus: ^2.0.0 copied to clipboard
This package provides a powerful collection of extensions for Dart's core types, enabling cleaner and more expressive code.
2.0.0 #
-
Breaking Changes:
ListExtensionnow only providesshuffled().groupBy,distinctBy,chunk,partition,findFirstandgetAtcome fromIterableExtensionand keep working on lists, butpartitionnow returns a(matched, rest)record instead ofList<List<T>>, andchunk/distinctByreturn lazyIterables (call.toList()if you need a list).- Removed
num.clamp. It was always shadowed by Dart's ownnum.clamp, so no call site can be affected. - Removed
maxLines,overflowandtextAlignmethods from theTextextension.Textalready has properties with those names, so these could never be called. UsewithTextProperties(maxLines: ..., overflow: ..., textAlign: ...). The chainable forms onStringare unchanged.
-
New Extensions:
int:5.seconds,300.ms,2.minutes,1.hours,7.days.Duration:format()(mm:ssorh:mm:ss) andtoHumanReadable()(2h 15m).String?,Iterable?,Map?:isNullOrEmpty,isNotNullOrEmpty,orEmpty;String?also getsisNullOrBlank.
-
Additions to existing extensions:
DateTime:startOfWeek,startOfMonth,endOfMonth,addMonths(clamps the day),isWeekend,copyWith.String:isBlank,isUrl,isPhone,toInt(defaultValue:),mask(),toColor().BuildContext:isDarkMode,isRtl,locale.Widget:onLongPress,hero,tooltip,semantics.Color:withOpacityValueusing the non-deprecatedwithValuesAPI.Iterable:orderBy(named to avoid clashing withpackage:collection'ssortedBy),takeLast,intersperse.Map:getOrDefault,filterKeys,mapKeys,toPrettyJson.
-
Bug Fixes:
toOrdinalreturned112nd; it now checks the last two digits so 111 to 113 giveth.- README documented
elementAtOrNullandfirstWhereOrNull; the real names aregetAtandfindFirst.
-
Tests and CI:
- Added 54 unit and widget tests covering every extension group.
- Added a GitHub Actions workflow running format, analyze, test and
pub publish --dry-run.
-
SDK Updates:
- Dart SDK constraint
^3.13.0and Flutter constraint>=3.47.0for Flutter 3.47.7. - Example app:
flutter_lints^6.0.0,cupertino_icons^2.0.0.
- Dart SDK constraint
-
AI assistant support:
- Added
skills/extensions-plus/SKILL.md, an agent cheat sheet usable as a Claude Code skill, Cursor rule orAGENTS.mdreference. - Added
llms.txtand a README section on wiring the package into AI coding tools.
- Added
1.6.0 #
-
SDK Updates:
- Updated flutter constraint to
>=3.35.0for flutter 3.35.0 compatibility.
- Updated flutter constraint to
-
Bug Fixes:
- Replaced deprecated
AppBarThemewithAppBarThemeDatainBuildContextTheme. - Replaced deprecated
BottomAppBarThemewithBottomAppBarThemeDatainBuildContextTheme. - Replaced deprecated
InputDecorationThemewithInputDecorationThemeDatainGenericBuildContextExtension.
- Replaced deprecated
1.5.0 #
-
Breaking Changes:
- Navigation Extensions: Renamed navigation methods to avoid conflicts with popular packages like
go_router.push()→pushPlus()pop()→goBack()popUntil()→goBackUntil()canPop→canGoBackpopUntilFirst()→goBackToFirst()popWithData()→goBackWithData()popTimes()→goBackTimes()
- List Extensions: Renamed list methods to avoid conflicts with the
collectionpackage.firstWhereOrNull()→findFirst()elementAtOrNull()→getAt()
- Iterable Extensions: Renamed iterable methods to avoid conflicts with the
collectionpackage.firstWhereOrNull()→findFirst()elementAtOrNull()→getAt()
- Navigation Extensions: Renamed navigation methods to avoid conflicts with popular packages like
-
Migration Guide:
- Update all
context.push()calls tocontext.pushPlus() - Update all
context.pop()calls tocontext.goBack() - Update all
list.firstWhereOrNull()calls tolist.findFirst() - Update all
list.elementAtOrNull()calls tolist.getAt() - Update all
iterable.firstWhereOrNull()calls toiterable.findFirst() - Update all
iterable.elementAtOrNull()calls toiterable.getAt() - Update other navigation methods accordingly
- Update all
-
Documentation:
- Updated README with new method names and examples
- Added migration guide for users upgrading from v1.4.x
- Updated all code examples throughout documentation
-
Reason for Changes:
- Resolves all conflicts with popular packages (
go_router,collection) - Allows developers to use multiple packages together without import conflicts
- Maintains all existing functionality with new, conflict-free naming
- Package now works seamlessly alongside the most popular Flutter routing and utility packages
- Resolves all conflicts with popular packages (
1.4.3 #
-
SDK Updates:
- Updated SDK constraint to
^3.8.0for Dart 3.8.1 compatibility. - Updated
flutter_lintsto^6.0.0.
- Updated SDK constraint to
-
Bug Fixes:
- Fixed
responsiveConstrainsinWidgetExtensionby explicitly typingalignment. - Corrected
indicatorColorgetter inBuildContextThemeto usetabBarTheme.indicatorColor. - Replaced deprecated
CardThemewithCardThemeDatainBuildContextTheme.
- Fixed
-
Code Improvements:
- Updated unused parameter syntax from
__to_for Dart 3.8.1 compatibility. - Removed unused variables in
OverlayUtilitiesBuildContextandWidgetExtension.
- Updated unused parameter syntax from
1.4.2 #
- Text Extensions:
- Renamed
align→textAlignfor better clarity. - Renamed
decoration→textDecorationto avoid conflict with widget extension.
- Renamed
1.4.1 #
-
Removed:
dialogBackgroundColorextension method fromBuildContext.
-
Reason for Removal:
- The property
Theme.of(context).dialogBackgroundColorhas been deprecated in Flutter. 3.29.0 || Dart 3.7.0
- The property
1.4.0 #
-
Text Extensions:
- Renamed
align→textAlignfor better clarity. - Renamed
decoration→textDecorationto avoid conflict with widget extension.
- Renamed
-
Screen Breakpoints:
- Removed
isSmallTabletandisSmallDesktopto simplify screen size logic. - Updated
responsivePaddingmethod to match new breakpoints.
- Removed
-
Dart Version Upgrade:
- Upgraded minimum Dart SDK version to
3.7.0for improved performance and stability.
- Upgraded minimum Dart SDK version to
1.3.0 #
-
Features
- Added comprehensive UI demo for TextStyle extension
- Enhanced documentation with practical examples
- Expanded text style manipulation methods
-
Changes
- Refactored text style extension methods
- Improved text style chaining for better readability
- Updated text style demo with more examples
1.2.0 #
-
Added
- Comprehensive text styling extensions with Material Design support:
- Theme-based text styles (headline, title, body, label variants)
- Chainable styling methods for Text widgets
- Advanced text customization (withStyle, withTextProperties)
- New date formatting capabilities:
- String extension method
format()with locale support - Qualified imports for intl package to prevent conflicts
- String extension method
- Comprehensive text styling extensions with Material Design support:
-
Changed
- Simplified responsive layout system:
- Consolidated desktop breakpoints for cleaner responsive design
- Updated isDesktop to cover broader range (>768px)
- Maintained isTablet (600-768px) and isLargeDesktop (>1440px) checks
- Enhanced text styling architecture:
- Improved null safety in text style extensions
- Better type handling for theme-based styles
- Organized text properties into logical groups
- Simplified responsive layout system:
-
Removed
- isSmallDesktop breakpoint (768-1024px range)
- Legacy desktop-specific string extensions
1.1.0 #
-
Added
- Complete Material Design theme property support in
BuildContextThemeincluding:- General Configuration (platform, visual density, adaptations, extensions, input decoration, page transitions, scrollbar theme, tap target size, splash factory)
- Color System (canvas, dialog, disabled, divider, focus, highlight, hint, hover, indicator, shadow, splash, unselected widget colors)
- Component Themes (app bar, navigation, buttons, forms, menus, selection, progress indicators, search, tooltips)
- Complete Material Design theme property support in
-
Changed
- Restructured extension files to use the main library file for parts
- Removed deprecated theme properties
- Organized theme properties into logical groupings
- Refactor: Removed
?from non-nullable theme variables for better type safety and consistency.
-
Breaking Changes
- Extension files now use
part ofwith the main library file - Removed support for deprecated theme properties
- Extension files now use
1.0.0 #
- Features
- Introduced a comprehensive set of Dart extensions to simplify development:
- Widget Extension: Utilities for UI-related tasks.
- String Extension: Enhanced string manipulation methods.
- num, List, and Map Extensions: Added powerful utility functions for numbers, lists, and maps.
- DateTime Extension: Simplified operations for date and time handling.
- Color Extension: Convenient utilities for color manipulation.
- BuildContext Extension: Streamlined access to Flutter context.
- Route Extension: Simplified navigation in Flutter apps.
- Added a complete example project to demonstrate the use of all extensions.
- Introduced a comprehensive set of Dart extensions to simplify development: