swift_composer 0.7.0 copy "swift_composer: ^0.7.0" to clipboard
swift_composer: ^0.7.0 copied to clipboard

Extensible Object Manager with no boilerplate code using source_gen

example/main.dart

import 'package:swift_composer/swift_composer.dart';
import 'module_fruits.dart' as module_fruit;
import 'module_banana.dart' as module_banana;
import 'module_price.dart' as module_price;
import 'module_discount.dart' as module_discount;

part 'main.c.dart';

void main() {

  List<module_fruit.Fruit> fruits = [];

  fruits.addAll([
    $om.module_fruit_AllAvailableFruits.createFruit('module_fruit.Fruit', "Fruit 1"),
    $om.module_fruit_AllAvailableFruits.createFruit('module_fruit.Fruit', "Fruit 2")
      ..width = 50
      ..height = 10,
    $om.module_fruit_AllAvailableFruits.createFruit('module_banana.Banana', "Banana 1"),
    $om.module_fruit_AllAvailableFruits.createFruit('module_banana.Banana', "Banana 2")
      ..weight = 100
  ]);

  fruits.forEach((fruit){
    print(fruit.toJson());
  });
}
0
likes
0
pub points
0%
popularity

Publisher

verified publisherswift.shop

Extensible Object Manager with no boilerplate code using source_gen

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

analyzer, build, build_config, path, source_gen, yaml

More

Packages that depend on swift_composer