appcraft_utils_flutter

pub package License: MIT

Lightweight Dart utilities and Flutter-friendly extensions for forms, validations, mappers, models, exceptions, notifiers and localization. Pure-Dart package — no dependencies on dart:ui or Flutter widgets.

Installation

dependencies:
  appcraft_utils_flutter: ^0.1.0
dart pub get

Modules

  • exceptions — typed exceptions for common validation errors (MinLengthException, MaxLengthException, etc.).
  • extensionsEnum extensions: byNameOrNull for null-safe lookup, comparison operators (<, <=, >, >=) for ordered enums.
  • inputs — form field models (ACInput, ACEmail, ACText) and a set of validators (ACRequiredValidation, ACMinLengthValidation, ACMaxLengthValidation, ACEmailValidation, ACRegExpValidation).
  • localization — abstract contract for localized messages with ACLocalizationRu / ACLocalizationEn implementations.
  • mappersACEntityMapper<Input, Output> for safe DTO → domain transformations (map, mapList, mapNotNull).
  • modelsACIdMixin, ACTitleMixin mixins and a WrappedValue<T> wrapper for explicit "no value" emission.
  • notifier — lightweight ACNotifier<T> with subscriptions for specific or any value, with optional retain-last semantics.

Example

See example/lib/main.dart — a runnable Dart CLI that demonstrates ACEmail validation, ACText validation and null-safe enum lookup via byNameOrNull.

cd example
dart pub get
dart run lib/main.dart

License

MIT — see LICENSE.