corextra library

Classes

AppLogger
AppLogger provides structured logging for app events, Dio requests, responses, and errors.
AppLoggerInterceptor
A Dio interceptor that logs requests, responses, and errors in a pretty, bordered format — one consolidated block per event.
CorextraDevTools
Central, in-memory DevTools store for the current app run.
CorextraDevToolsInterceptor
A purely-observational Dio interceptor that feeds the DevTools Network tab. It never mutates the request/response/error — always calls handler.next(...) unchanged.
CorextraDevToolsOverlay
Wraps an app (or a subtree of one) with a floating DevTools bubble that opens an in-app inspector panel (Network / Logs / Performance / Info tabs).
DevToolsBubble
A small, draggable floating button used to open the DevTools panel. Must be used as a (possibly indirect) child of a Stack (see DraggableFloatingWidget).
DevToolsEmptyState
A centered icon + message shown when a DevTools tab has no data yet.
DevToolsFloatingWindow
A small, draggable, resizable floating window showing the same DevTools tab content (Network / Logs / Performance / Info) as the full panel — not a stripped-down summary — just confined to a smaller window that floats over the app instead of covering the whole screen. Lets a developer watch live activity while still freely interacting with (and testing) the rest of the app underneath, closer to inspecting a page in a browser than a full-screen-only panel would allow.
DevToolsPanel
The DevTools inspector panel: Network / Logs / Performance / Info tabs, plus a header with theme, minimize, "Clear all", and close controls.
DevToolsScrollToTop
A small floating "scroll to top" button overlaid on a scrollable built by builder.
DevToolsTabs
Network / Logs / Info are day-to-day checks and stay on the strip; Performance is occasional, so it lives behind the trailing "more" button instead.
DioErrorHandler
Utility helper for Dio-related features like error handling, logging, and potential future enhancements.
DraggableFloatingWidget
Positions its content via an internally-managed, user-draggable offset — defaulting near the bottom-right corner of the screen (or wherever defaultOffset says). Shared by DevToolsBubble and DevToolsFloatingWindow so both drag (and edge-peek) identically.
FadeSlideTransition
A widget that combines fade and slide animations for smooth transitions.
FormValidators
Form validators with optional translation.
FrameSample
One frame's build + raster timing, used to derive FPS/jank in the DevTools Performance tab.
FrameSampleStore
Bounded, FIFO ring buffer of captured FrameSamples.
InfoTab
App + device details, plus current capture-buffer counts, sourced from package_info_plus/device_info_plus and CorextraDevTools.instance.
LogEntry
A single log line captured for the DevTools Logs tab.
LogEntryStore
Bounded, FIFO ring buffer of captured LogEntrys.
LogsTab
Reverse-chronological, color-coded list of captured log entries from CorextraDevTools.instance.logs — filterable by message text and by level.
NetworkEvent
A single captured HTTP request/response (or error) exchange.
NetworkEventStore
Bounded, FIFO ring buffer of captured NetworkEvents.
NetworkTab
Lists captured HTTP exchanges from CorextraDevTools.instance.network.
PerformanceTab
Live FPS/jank monitor built from CorextraDevTools.instance.performance — modeled on Flutter DevTools' own Performance view (a scrolling frame timeline split into UI/build time vs Raster/GPU time, with a 60 FPS budget line and jank highlighted), scaled down to what's derivable without a VM Service connection: per-frame build/raster durations from SchedulerBinding, nothing from the engine's own trace events.
ResponsiveBreakpoints
Provides helpers to check screen size categories for responsive layouts.

Enums

DeviceType
Coarse device category, derived from the ResponsiveBreakpoints.lg / ResponsiveBreakpoints.xl breakpoints.
LogColor
Logging Color
LogLevel
Logging levels
SlideDirection
Directions for the slide animation in FadeSlideTransition.

Extensions

DoubleExtensions on double
Extensions on double for convenience.
IntExtensions on int
Extensions on int for convenience.
ListExtensions on List<T>?
Extensions on nullable List for safe emptiness checks.
LogColorData on LogColor
LogLevelData on LogLevel
NonNullableStringExtensions on String
Extensions on non-nullable String for common parsing and formatting.
NullableDateTimeExtensions on DateTime?
Extension on nullable DateTime to format it into a string.
NullableStringExtensions on String?
Extensions on nullable String to check emptiness safely.
ResponsiveConstraintsExtensions on BoxConstraints
Extensions on BoxConstraints for Tailwind-style responsive checks.
ResponsiveContextExtensions on BuildContext
Extensions on BuildContext for Tailwind-style responsive checks.
SafeSetStateExtension on State<StatefulWidget>
Extension to safely call setState only if the widget is mounted.

Functions

boundedPrettyFormatBody(Object? data, {int budget = 2000, int maxListItems = 50, int maxStringLength = 2000}) String
Like prettyFormatBody, but bounds total work via _boundForLogging for an eager caller with no later display step to defer cost to.
debugLog(String message, {LogLevel level = LogLevel.info}) → void
Logs messages to console in debug mode with optional level.
isListEmpty<T>(List<T>? value) bool
Checks if a nullable list is null or empty. Use List? extension isNullOrEmpty for cleaner code.
isStringEmpty(String? value) bool
Checks if a nullable string is null or empty. Use String? extension isNullOrEmpty for cleaner code.
prettyFormatBody(Object? data) String
Pretty-prints data as indented JSON for display in the DevTools panel — the common case for an API request/response body. Falls back to a short, readable summary for the two shapes JSON can't represent meaningfully: raw bytes (Uint8List, e.g. a ResponseType.bytes download) and Dio's multipart FormData request bodies. Anything else that isn't valid JSON (plain text, HTML, XML, ...) is shown as-is via Object.toString.
truncateBody(Object? data, int maxLength) Object?
Bounds data before capture, without pretty-printing a Map/List just to measure it — that cost must stay lazy, paid only on open.

Typedefs

Translator = String Function(String)
A function that translates a string.
Validator = String? Function(String?)
A Form field validator: takes the field value, returns an error message or null.

Exceptions / Errors

CorextraCustomException
Generic or custom application errors
CorextraException
Base class for all custom exceptions in the package.
CorextraGeneralException
Exception for unknown/general errors
CorextraNetworkException
Exception for network-related errors
CorextraNewVersionException
Exception for forced app updates
CorextraServerException
Exception for server-related errors