context_extensions_codespark 1.1.0
context_extensions_codespark: ^1.1.0 copied to clipboard
Powerful and lightweight BuildContext extensions for Flutter. Simplify navigation, responsive layouts, theme access, dialogs, snackbars, and more.
1.1.0 #
Documentation & Presentation #
- Rewrote README with before/after code comparisons for every extension category.
- Added screenshots gallery covering all 8 extension categories (Screen, Device, Theme, Typography, Snackbars, Dialogs, Orientation, Overview).
- Added badges: pub version, pub points, pub likes, license, Flutter platform, BuildContext utilities.
- Added author credit with links to website and GitHub profile.
- Added
screenshots:section topubspec.yamlfor pub.dev package page display. - Added doc comments with source references (M3 spec, Flutter API docs, Android density guide, iOS HIG).
Focus & Keyboard #
- Extended
ContextFocusExtensionswithnextFocus(),previousFocus(),requestFocus(node). - Added
focusScopeNode,isScopeFocused,hasAnyFocus,primaryFocusNodegetters.
Typography #
- Extended
ContextTypographyExtensionswithfontScale,scaled(style),adaptiveStyle(mobile:, desktop:). - All style getters return a safe
TextStyle()fallback — never null, never throws.
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. ContextBreakpointsconstants now covers all 5 M3 size classes with proper start/end bounds.- Added
isHighDensityDisplay,hasNotch,hasHomeIndicatordisplay hints (all via MediaQuery — no platform API needed). - Added
isFuchsia,isNativeMobile,isNativeDesktop,isTouchDevice,isPointerDeviceplatform helpers.
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.
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
textScaler,orientation,platformBrightness,devicePixelRatioMediaQuery properties. - Added full 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
backgroundproperty onColorScheme.
0.0.1 #
- Initial release.
- MediaQuery extensions.
- Device helpers.
- Theme extensions.
- Typography shortcuts.
- Snackbar helpers.
- Focus helpers.
- Lifecycle utilities.
- Orientation helpers.