brick_sqlite_generators 3.2.2 copy "brick_sqlite_generators: ^3.2.2" to clipboard
brick_sqlite_generators: ^3.2.2 copied to clipboard

Code generation library for the SQLite providers, models, and adapters in Brick

brick_sqlite_generators workflow

Brick Sqlite Build #

Code generator that provides (de)serializing functions for Brick adapters using SqliteProvider. This package does not produce code. It can be imported into other Brick build domains.

This package should not be imported into an end application as it does not generate code.

Usage #

Apply the SqliteSerdes in your own AnnotationSuperGenerator:

import 'package:brick_rest_generators/rest_serdes.dart';

class MyDomainGenerator extends AnnotationSuperGenerator<ConnectOfflineFirst> {
  final String superAdapterName;
  final String repositoryName;

  const OfflineFirstGenerator({
    this.superAdapterName = 'OfflineFirst',
    this.repositoryName = 'OfflineFirst',
  });

  /// Given an [element] and an [annotation], scaffold generators
  List<SerdesGenerator> buildGenerators(Element element, ConstantReader annotation) {
    final sqlite = SqliteSerdes(element, annotation, repositoryName: repositoryName);
    final otherProvider = OtherProviderSerdes(element, annotation, repositoryName: repositoryName);
    final generators = <SerdesGenerator>[];
    generators.addAll(sqlite.generators);
    generators.addAll(otherProvider.generators);
    return generators;
  }
}
0
likes
130
points
1.54k
downloads

Publisher

unverified uploader

Weekly Downloads

Code generation library for the SQLite providers, models, and adapters in Brick

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, brick_build, brick_sqlite, build, dart_style, meta, source_gen

More

Packages that depend on brick_sqlite_generators