mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-05-17 13:05:53 +08:00

Co-authored-by: A HEAD FULL OF DREAMS <workdeveloper@gmail.com> Co-authored-by: Nishant Srivastava <nisrulz@users.noreply.github.com>
18 lines
314 B
Dart
18 lines
314 B
Dart
import 'package:mobx/mobx.dart';
|
|
|
|
// Include generated file
|
|
part 'counter.g.dart';
|
|
|
|
// This is the class used by rest of your codebase
|
|
class Counter = _Counter with _$Counter;
|
|
|
|
// The store-class
|
|
abstract class _Counter with Store {
|
|
@observable
|
|
int value = 0;
|
|
|
|
@action
|
|
void increment() {
|
|
value++;
|
|
}
|
|
} |