velix 0.91.2 copy "velix: ^0.91.2" to clipboard
velix: ^0.91.2 copied to clipboard

flutter foundation library. This core library contains basic functionality, mainly the meta-data organization and its related code generator used by the different addons.

License Dart Docs Flutter CI

velix

Introduction #

Velix is Dart/Flutter library implementing some of the core parts required in every Flutter application:

  • type meta data
  • specification and validation of type constraints
  • general purpose mapping framework
  • json mapper
  • model-based two-way form data-binding
  • i18n
  • dependency injection container
  • command pattern for ui actions

Check out some articles on Medium:

The core - which is the capturing of type meta-data - is part of this package. The other packages are:

Overview #

Validation #

As in some popular Typescript libraries like yup, it is possible to declare type constraints with a simple fluent language

var type = IntType().greaterThan(0).lessThan(100);

type.validate(-1); // meeeh....will throw

Type Meta-Data #

In combination with a custom code generator, classes decorated with specific annotations - here @Dataclass- emit the meta data:

@Dataclass()
class Money {
  // instance data

  @Attribute(type: "length 7")
  final String currency;
  @Attribute(type: ">= 0")
  final int value;

  const Money({required this.currency, required this.value});
}

The information will be used by a number of mechanisms, such as

  • dependency injection container
  • the mapping framework
  • form data-binding.

Installation #

All packages are published to pub.dev.

Documentation #

Detailed information can be found in the corresponding Wiki.

3
likes
120
points
1.09k
downloads

Publisher

unverified uploader

Weekly Downloads

flutter foundation library. This core library contains basic functionality, mainly the meta-data organization and its related code generator used by the different addons.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, async, build, flutter, glob, path, source_gen, stack_trace

More

Packages that depend on velix