velvet_annotation 0.0.1-dev.9 copy "velvet_annotation: ^0.0.1-dev.9" to clipboard
velvet_annotation: ^0.0.1-dev.9 copied to clipboard

A package exposing annotations for velvel_generator. It is part of the Velvet framework.

example/README.md

Velvel Annotation - Example #

## VelvetBootstrap

The @velvetBootstrap annotation is used to generate the bootstrap.dart file. The bootstrap.dart file should be used in the main.dart file to bootstrap the application.

You should create a file for each service or code to run on bootstrap.

Example of usage:

import 'package:dede_annotations/dede_annotations.dart';
import 'package:flutter/services.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';

part 'device_orientation_bootstrap.g.dart';

@bootstrap
@Riverpod(keepAlive: true, dependencies: [])
Future<void> deviceOrientationBootstrap(
  DeviceOrientationBootstrapRef ref,
) async {
  await SystemChrome.setPreferredOrientations([
    DeviceOrientation.portraitUp,
  ]);
}

in main.dart file:

import 'package:medical_lab/bootstrap.dede.dart';
import 'package:velvet_framework/velvet_framework.dart';

void main() {
  Kernel()
    ..bootMany(bootstrapFunctions)
    ..run();
}
0
likes
150
points
252
downloads

Publisher

verified publisherstratumfoundry.com

Weekly Downloads

A package exposing annotations for velvel_generator. It is part of the Velvet framework.

Repository (GitHub)
View/report issues
Contributing

Topics

#annotations #code-generation

Documentation

API reference

License

MIT (license)

Dependencies

flutter, freezed_annotation, json_annotation, meta, riverpod, riverpod_annotation

More

Packages that depend on velvet_annotation