oh_my_flutter 0.16.0 copy "oh_my_flutter: ^0.16.0" to clipboard
oh_my_flutter: ^0.16.0 copied to clipboard

Empower Flutter with utilities that make development 10x faster.

oh_my_flutter #

CI License: MIT pub package

Small, strongly typed utilities for common Flutter application tasks.

Installation #

Add the latest compatible release from pub.dev:

flutter pub add oh_my_flutter

Or add it directly to your pubspec.yaml:

dependencies:
  oh_my_flutter: ^0.13.0

Import the public library wherever you need it:

import 'package:oh_my_flutter/oh_my_flutter.dart';

Documentation #

  • Read the repository consumer guides for setup, usage, configuration, and constraints.
  • Read the generated API reference for exhaustive contracts and defaults.
  • Run the complete public-API example.

Quick start #

Extensions make common transformations concise while preserving Flutter and Dart types:

import 'package:flutter/material.dart';
import 'package:oh_my_flutter/oh_my_flutter.dart';

final accent = const Color(0xFFFF4A4B);
final lighterAccent = accent.lighten(0.12);
final hex = lighterAccent.toHex();
final oklch = lighterAccent.toOklch();

Extensions #

DateTime relative time #

DateTime.timeAgo maps elapsed time to application-owned callbacks, so callers control localization and the result type.

Color transformations #

ColorExtension lightens, darkens, converts Flutter colors to hexadecimal, and starts OKLCH conversion.

OKLCH colors #

Oklch provides perceptually uniform lightness, chroma, and hue values with conversion to and from Flutter colors.

Velocity classification #

VelocityExtension classifies directional swipe velocity while leaving distance, progress, and interaction policy to the application.

Widgets #

ControlledVisibility #

ControlledVisibility lets parent-owned state show or hide a child with optional directional transitions and optional unmounting.

InteractiveSwipeDismiss #

InteractiveSwipeDismiss translates any live widget with a scroll-aware, directional dismissal gesture, callback-owned removal, and presentation-neutral drag-handle regions.

Morph #

Morph animates matching widgets between layouts and routes, selecting a specialized transition for supported content and a generic transition for other widgets. MorphDescendant configures how a selected descendant subtree participates in its nearest ancestor Morph, currently including live, snapshotted, or hidden transition behavior. Discrete content switches and moving destinations remain configurable without replacing the automatic transition. MorphSibling coordinates tagged widgets outside a Morph subtree, letting them animate from that Morph's visual progress and optionally remain in their natural paint order instead of painting above the matching flight.

Motion #

Motion applies reusable one-shot or looping effects, including shakes, to any widget with configurable startup and controller-driven playback.

TextMotion #

TextMotion applies the same motion effects to each visible grapheme in short display text with configurable startup and controller-driven playback.

Marquee #

Marquee repeatedly moves an ordered strip through a clipped viewport, with gapless or single-strip cycle layouts.

PauseAnimations #

PauseAnimations temporarily mutes ticker callbacks for a widget subtree.

MaybeSafeArea #

MaybeSafeArea keeps a child's layout bounds out of enabled unsafe view edges as it moves or scrolls, without changing its layout footprint.

Sequence #

Sequence presents one child at a time with controller-owned navigation and optional directional transitions.

RouteSettled #

RouteSettled shows route chrome or controls only while the enclosing route is settled and no navigator gesture is active.

Skeleton #

Skeleton preserves a widget subtree's layout while replacing the first painted descendant on each branch with neutral loading bones, with optional descendant overrides and fade or shimmer effects.

Networking #

Offline Dio errors #

OfflineErrorDioInterceptor turns conservatively classified offline Dio failures into a typed error that callers can detect without repeating connectivity probes.

Utilities #

Device #

Device groups device feature objects behind one reusable entry point for applications that need several capabilities.

Display

DeviceDisplay provides information about and interaction with the device display. Its initial capability reads exact corner radii when Flutter exposes them and can optionally provide an approximate phone fallback.

Location

DeviceLocation manages foreground location permission and retrieves fresh coordinates or a device-formatted current address on Android or iOS.

Debouncer #

Debouncer<T> delays repeated value-producing callbacks until calls stop, while sharing the latest callback's result across the pending burst.

Telephony #

Telephony sanitizes an international phone number and asks the platform to start a call.

WhatsApp #

Whatsapp opens a chat with an optional message through the native application or web fallback.

Scope #

oh_my_flutter provides portable utility APIs. It intentionally does not own application state, routing, localization, design components, or application-specific domain logic.