Skip to main content

angel3_model 10.0.0 copy "angel3_model: ^10.0.0" to clipboard
angel3_model: ^10.0.0 copied to clipboard

Angel3 basic data model class, no longer with the added weight of the whole framework.

Angel3 Data Model #

Pub Version (including pre-releases) Null Safety Discord License

The basic data models for ORM used in Angel3 framework.

import 'package:angel3_model/angel3_model.dart';

Installation #

In your pubspec.yaml:

dependencies:
  angel3_model: ^10.0.0

The available data models are:

  • Model class
    • A basic data model
  • AuditableModel class
    • A basic data model with audit log feature

Usage #

import 'package:angel3_model/angel3_model.dart';

class Todo extends Model {
  String? text;

  bool isComplete;

  Todo({
    required String super.id,
    this.text,
    this.isComplete = false,
    super.createdAt,
    super.updatedAt,
  });
}

void main() {
  var todo = Todo(id: '34');
  print(todo.idAsInt == 34); // true
}

Migrating from 9.x to 10.0.0 #

The breaking changes of each release are listed in the CHANGELOG. Those of 10.0.0 that may need changes in an app:

  • none is an instance of None (const None()), so none is None is true. Compare types with None, as T == none is now false:

    // 9.x
    if (T == none) { ... }
    
    // 10.0.0
    if (T == None) { ... }
    
  • None is a final class with a const constructor, and every None equals none, which can no longer be in a constant set or be a constant map key.

0
likes
160
points
1.55k
downloads

Documentation

API reference

Publisher

verified publisherdukefirehawk.com

Weekly Downloads

Angel3 basic data model class, no longer with the added weight of the whole framework.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

BSD-3-Clause (license)

More

Packages that depend on angel3_model