Skip to content

Instantly share code, notes, and snippets.

@JOSHIMOH
Created November 19, 2019 07:31
Show Gist options
  • Select an option

  • Save JOSHIMOH/df93ad0afefd974fa09a47d5f78e9a3b to your computer and use it in GitHub Desktop.

Select an option

Save JOSHIMOH/df93ad0afefd974fa09a47d5f78e9a3b to your computer and use it in GitHub Desktop.
computed observable
import 'package:mobx/mobx.dart';
part 'contact.g.dart';
class Contact = ContactBase with _$Contact;
abstract class ContactBase with Store {
@observable
String firstName;
@observable
String lastName;
@computed
String get fullName => '$firstName, $lastName';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment