1
0
mirror of https://github.com/nisrulz/flutter-examples.git synced 2025-11-08 12:39:17 +00:00
Files
flutter-examples/statless_counter_app/lib/counter.dart
Sagar Shah b024cb183d 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>
2022-10-22 20:32:00 +02:00

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++;
}
}