This is an example of MobX:
import 'package:mobx/mobx.dart';
// This is our generated file (we'll see this soon!)
part 'counter.g.dart';
// We expose this to be used throughout our project
class Counter = _Counter with _$Counter;
// Our store class
abstract class _Counter with Store {
@observable
int value = 1;
@action
void increment() {
value++;
}
@action
void decrement() {
value--;
}
}
I don't really understand this code: class Counter = _Counter with _$Counter;.
I know the usage of with, I just don't know why class Counter can be assigned with =, what is the meaning of the assignment operation here? Is this similar to a type alias, or is Counter a subclass of _Counter ? I don't see this usage in Dart's guide.