rxget_generator 1.0.1 copy "rxget_generator: ^1.0.1" to clipboard
rxget_generator: ^1.0.1 copied to clipboard

Code generator for rxget GetxState classes. Eliminates boilerplate for reactive state management.

example/lib/main.dart

import 'package:rxget_annotation/rxget_annotation.dart';

part 'main.g.dart';

// Mock definitions of GetxState and Rx to allow this example to compile
// as a pure Dart package without requiring the Flutter SDK.
abstract class GetxState {
  void onClose() {}
}

class Rx<T> {
  Rx(this.value);
  T value;
  void close() {}
}

@getxState
class CounterState {
  CounterState({
    this.count = 0,
    @update this.title = 'Counter',
  });

  int count;

  @update
  String title;
}

void main() {
  final state = _CounterState(count: 10, title: 'My Counter');
  print('Title: ${state.title}, Count: ${state.count}');
  state.count = 11;
  print('Updated Count: ${state.count}');
  state.onClose();
}
1
likes
160
points
63
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Code generator for rxget GetxState classes. Eliminates boilerplate for reactive state management.

Repository (GitHub)
View/report issues

Topics

#state-management #rxget #code-generation #build-runner

License

MIT (license)

Dependencies

analyzer, build, rxget_annotation, source_gen

More

Packages that depend on rxget_generator