New Example - Stateless MObX Counter App (#104)

Co-authored-by: A HEAD FULL OF DREAMS <workdeveloper@gmail.com>
Co-authored-by: Nishant Srivastava <nisrulz@users.noreply.github.com>
This commit is contained in:
Sagar Shah
2022-10-23 00:02:00 +05:30
committed by GitHub
parent 4407e4362b
commit b024cb183d
71 changed files with 1595 additions and 0 deletions

View File

@ -0,0 +1,18 @@
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++;
}
}