viper_gen 0.0.4 copy "viper_gen: ^0.0.4" to clipboard
viper_gen: ^0.0.4 copied to clipboard

A generator for viper package.

VIPER Gen #

A generator for viper package

How to use #

Mark a presenter with @presenter

import 'package:viper/viper.dart';
import 'package:viper/annotation.dart';

part 'presenter.g.dart';

@presenter
class MyPresenterImpl extends MyPresenter
    // Add states & bound functions
    with _$MyPresenterImpl
    implements MyViewDelegate, MyInteractorDelegate {
  
  // Requires to create a new instance  
  MyPresenterImpl._();
  
  // Bind states with bound functions
  factory MyHomePresenterImpl() => _$BoundMyPresenterImpl(); 

  // Manually declare a state, will skip it from generating
  final incrementButtonDidTap = BehaviorSubject<void>();
  
  // incrementButtonDidTap state will be bound to this function
  void $counterDidIncrement() {}
}
1
likes
100
pub points
0%
popularity

Publisher

unverified uploader

A generator for viper package.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

analyzer, build, flutter, source_gen, viper

More

Packages that depend on viper_gen