velvet_annotation 0.0.1-dev.2 copy "velvet_annotation: ^0.0.1-dev.2" to clipboard
velvet_annotation: ^0.0.1-dev.2 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
0
points
242
downloads

Publisher

verified publisherstratumfoundry.com

Weekly Downloads

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

Homepage
Repository (GitHub)
View/report issues

Topics

#annotations #code-generation

License

unknown (license)

More

Packages that depend on velvet_annotation