structures 1.4.0

SDKdartflutter
Platformandroidioswindowslinuxmacosweb

Commonly used standalone data structures, types and extensions that simplify application logic development.

Structures

Pub package publisher

Structures is a lightweight pure Dart package for business level reactive programming.

It facilitates high-level model abstraction, data flow management, validation, and error handling, streamlining the creation of applications with a distinct separation between logic and UI/services.

Reactivity

Structures offers the following key features:

  1. Event-Driven Capabilities: Structures enables efficient processing of events, whether they're triggered by user interactions, system occurrences, or other external inputs.

  2. Observability: It allows for easy observation of state or data changes, enabling swift and seamless reactions to these changes.

  3. Asynchronous Programming Support: Structures accommodates asynchronous tasks that can run independently or in parallel, providing robust mechanisms to manage the completion of these tasks.

  4. Data Binding: In the context of UI development, Structures facilitates automatic synchronization between the model (underlying data) and the view (user interface), ensuring real-time consistency.

Please note that these features are framed in the context of the term "reactivity", which is central to the design and functionality of Structures.

The following classes are simple yet powerful and can be used to build responsive and efficient applications.

NameDescriptionStatus
LiveA listenable (observable) interface class that you use to create objects that you can observe for changes.✅✅✅
Value A listenable value interface class that you use to create objects that you can observe for value updates.✅✅✅
NotifierA Live implementation that enables you use to create objects that you can observe for for changes.✅✅✅
LiveValueImplementation of Value interface✅✅✅
LiveIterableValueImplementation of Value extension interface for Iterable✅✅✅
BoolValueImplementation of Value interface for bool✅✅✅
LiveMapValueImplementation of Value extension interface for Map<K, V>✅✅✅

Validation

The package provides a set of validation types and structures that can help validate data in any application.

NameDescriptionStatus
Failure A representation of a failed Validation✅✅☑️
FailureTypeAn object containing trace of the failure and other necessary source metadata✅✅☑️

Collections

The package provides a set of collection types and structures that can help manage data in any application.

NameDescriptionStatus
ChoiceThis is fixed-length single choice Choice List✅✅✅
PairA pair of two objects✅✅☑️
AListAn extension of a List✅✅✅
AStringListExtensionExtension methods for the [List] class.✅✅
IndexedIterableExtensionHigh order Extension methods for the [Iterable] class.✅✅

Models

The package provides a set of data types and structures that can help manage data in any application.

NameDescriptionStatus
ModelFactoryAdapter for simple serialization and converting of model objects to other forms.✅✅✅
FieldA a model of a domain field entry object.✅✅✅
NamedAn interface that defines an object that can be named.✅✅✅
EitherA union type that represents two possible types.✅✅✅
ModelA base class for all model objects.✅✅✅

UI State/Logic Structures

Data structures that drive the data need and logic of UI. Help you handle common UI state like forms, selection etc.

NameDescriptionStatus
ThemeModelA model that holds the current theme of the application.✅✅✅
FieldA a model of a domain field entry object.✅✅✅

Extensions

Extension methods for the dart core classes. There many common tasks that you need to perform on the core classes in the dart core library. This package provides a set of extension methods that can help you perform these tasks.

NameDescriptionStatus
StringCaseExtensionExtension methods for the [String] class.✅✅