context_extensions_codespark 1.0.0
context_extensions_codespark: ^1.0.0 copied to clipboard
Powerful and lightweight BuildContext extensions for Flutter. Simplify navigation, responsive layouts, theme access, dialogs, snackbars, and more.
1.0.0 #
Focus & Keyboard #
- Extended
ContextFocusExtensionswithnextFocus(),previousFocus(),requestFocus(node). - Added
focusScopeNode,isScopeFocused,hasAnyFocus,primaryFocusNodegetters.
Typography #
- Extended
ContextTypographyExtensionswithfontScale,scaled(style),adaptiveStyle(mobile:, desktop:). - Added section dividers for display, headline, title, body, label groups.
Lifecycle #
- Extended
ContextLifecycleExtensionswithonPostFrames(count, callback)for multi-frame delays. - Added
isContextMountedgetter (wrapsBuildContext.mounted). - Added
ifMounted(callback)— safe async-gap guard. - Added
onPostFrameIfMounted(callback)— post-frame + mount safety combined.
Device & Breakpoints #
- Moved all window-size-class getters (
isMobile,isTablet,isExpanded,isDesktop,isExtraLarge) intoContextBreakpointExtensionsincontext_breakpoints.dart, co-located withContextBreakpointsconstants. ContextBreakpointsnow covers all 5 M3 size classes: compact, medium, expanded, large, extra-large, with proper start/end bounds.- Added
isHighDensityDisplay,hasNotch,hasHomeIndicatordisplay hints (all via MediaQuery — no platform API). - Added
isFuchsia,isNativeMobile,isNativeDesktop,isTouchDevice,isPointerDeviceplatform helpers. context_breakpoints.dartis now a standalone, self-contained file exported from the barrel.
Theme #
- Added
@Deprecatedannotations tosurfaceVariantColorandonBackgroundColorwith replacement guidance.
Code Quality #
- Removed redundant
import 'package:flutter/widgets.dart'frommedia_query_extensions.dart. - All files pass
dart analyzewith zero issues.
Documentation #
- Fully rewrote README with before/after code comparisons for every extension.
- Added doc comments with source references (M3 spec, Flutter API docs, Android density guide, iOS HIG) to breakpoint and device extension files.
1.0.0 #
- Added dialog extensions:
showAlertDialog,showConfirmDialog,showLoadingDialog,showCustomDialog,hideDialog. - Snackbar methods now accept
duration,action,backgroundColor,textColor, andbehaviorparameters. - Added platform detection helpers:
isAndroid,isIOS,isWeb,isMacOS,isWindows,isLinux— all web-safe viakIsWebguard. - Added more MediaQuery properties:
textScaler,orientation,platformBrightness,devicePixelDensity. - Added more ColorScheme color helpers:
onPrimaryColor,onSecondaryColor,onSurfaceColor,onErrorColor,tertiaryColor,onTertiaryColor,surfaceTintColor,scrimColor,shadowColor,inverseSurfaceColor. - Deprecated
backgroundColor(usesurfaceColor) andonBackgroundColor(useonSurfaceColor) per Flutter 3.18. - Deprecated
surfaceVariantColor(usesurfaceTintColor) per Flutter 3.18. - Removed unnecessary
librarydirective from barrel file. - Updated README with real-world examples for all extensions.
0.0.1+patch-deprecated #
- Fixed deprecated background property on ColorScheme.
0.0.1 #
- Initial release.
- MediaQuery extensions.
- Device helpers.
- Theme extensions.
- Typography shortcuts.
- Snackbar helpers.
- Focus helpers.
- Lifecycle utilities.
- Orientation helpers.