extensions_core 0.0.6
extensions_core: ^0.0.6 copied to clipboard
A dependency-light collection of Dart and Flutter extension methods for strings, numbers, dates, collections, colors, widgets, navigation, and more.
0.0.6 #
Added #
lib/extensions_core.dart— primary library entry point (importingpackage:extensions_core/extensions_core.dartnow works; the existingextensions.dartbarrel is unchanged and still exported).
Changed #
- Web and WASM support.
dart:iousage moved behind conditional imports:PlatformInfoOS detection no longer importsdart:iodirectly — newplatform_flags.dartwith io/web implementations (kIsWeb+Platformon native, all-false-but-web on browsers).Fileextensions moved tofile_io.dart, exported only wheredart:ioexists — they remain unavailable on the web (documented in the README).
- pubspec now declares
repositoryandissue_tracker, andtopics(dart,flutter,extensions,utilities). - Verified with pana: 160/160 points, 6/6 platforms supported, WASM-ready.
0.0.5 #
Added #
example/example.dart— runnable demo showing common extensions (adds the pub.dev "package has an example" points).
Changed #
- Rewrote the
pubspec.yamldescription (previous one was too short, costing pub points). - Added dartdoc comments across the whole public API: every library, extension, class, and member is now documented (262 → 100% coverage).
- Expanded
example/example.dartto demonstrate extensions from every file in the package. - The package now compiles on the web (and is WASM-ready).
dart:iousages moved behind conditional imports:platform.dartOS detection usesplatform_flags.dart(stub/web implementations), andFileextensions moved tofile_io.dart, exported only wheredart:ioexists. Addedlib/extensions_core.dartas the primary entry point (theextensions.dartbarrel still works).
Removed #
- Unusable
TextStyleextension members that collided with instance fields ofTextStyleand could never be called:color(),letterSpacing(),wordSpacing(),backgroundColor(),fontFamily(),decorationThickness(), and the no-opalign(). UsecopyWith(color: …)etc. instead.
Tests #
- No API changes; all 36 existing tests pass,
flutter analyzeanddart formatclean, local pana score 160/160.
0.0.4 #
Added #
- New extension files:
object.dart:let,also,run,isNull,isNotNullduration.dart:inWeeks,format()edge_insets.dart:EdgeInsets.copyWith()form_validators.dart:requiredField,emailValidator,phoneValidator,minLengthValidator,maxLengthValidator
String: case conversion (toCamelCase,toPascalCase,toSnakeCase,toKebabCase), safe parsing (toIntSafe,toDoubleSafe,toBool), slicing (before,after,between,replaceLast,countOccurrences),isNullOrEmpty(nullable),slugify,collapseWhitespace,initials,masked,isStrongPassword,containsSpecialCharacter,isAlphanumeric,isJson,onlyDigits,withoutDigitsNumber/int:isPositive,isZero,isDivisibleBy,percentageOf,formatBytes,isEven,isOdd,ordinal,toBinary,toOctal,toHexDateTime:isTomorrow,isSameDay/Month/Year,isBetween,isWeekend,isWeekday,isLeapYear,quarter,startOf/endOf(day, week, month, year),tomorrow,yesterday,copyWith,ageInYearsIterable:distinctBy,countWhere,containsAll,containsAny,zip,unzip,flatten,insertBetween;sum,min,max,averageonIterable<num>List:rotateMap:invert,getOrPut,merge,pick,omit,filterKeys,filterValues,keysOfColor:colorFromHex(),darken,lighten,inverse,complementary,hue,saturation,brightness,withBrightness,isTransparent,toMaterialColorBuildContext:mediaQuery,safePadding,locale,textDirection,orientation,isPortrait,isLandscape,devicePixelRatio,textScaler,hideKeyboardWidget:margin,background,border,tooltip,onLongPress,onDoubleTap,inkWell,visible,safeArea,blur,rotated,scaled,constrained,aspectRatio,width,heightNavigation:canPop,maybePop,popWithResult,popToFirst,currentRouteName,pushWithSlide,showSheet,showAppDialogFile:isImage,isVideo,isAudio,sizeInMB,readAsStringSafe
Changed #
- Public types
PlatformInfo/TargetPlatformInforeplace the private_Platform/_TargetPlatform(accessible from app code). - Minimum Flutter raised to
>=3.27.0for the modern wide-gamutColorAPI. - Removed unused dev dependencies (
path_provider,mocktail).
Fixed #
Color.toHex()returned incorrect values on Flutter ≥3.27 (alpha/red/green/bluenow return 0–255, breaking the old math); now uses thea/r/g/baccessors.File.sizeFormatted()crashed on empty files (log(0)→-inf); now returns0 B.
Tests #
- Added
test/extensions_test.dartcovering all new extensions (36 tests).
0.0.3 #
What's Changed #
Dependencies #
- Updated
intlpackage to ^0.20.2 - Updated
flutter_lintsto ^6.0.0 - Updated minimum Dart SDK to ^3.6.0
New Features #
- Added new widget extensions:
padding()- Wrap widget with paddingcenter- Center widgetexpanded- Expand widgetflexible()- Make widget flexibleonTap()- Add tap gesture detectoralign()- Align widgetsize()- Wrap with SizedBoxopacity()- Add opacitycircular()- Clip with circular border radiuselevated()- Add card elevation
- Added navigation extensions:
- Simplified navigation helpers
- Easy page transitions
- Route management utilities
Improvements #
- Enhanced code documentation
- Improved type safety
- Better error handling