Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nathanaelsantos/flutter-mobx-counter
https://github.com/nathanaelsantos/flutter-mobx-counter
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/nathanaelsantos/flutter-mobx-counter
- Owner: NathanaelSantos
- Created: 2022-06-07T06:01:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-07T06:20:27.000Z (over 2 years ago)
- Last Synced: 2024-11-23T10:14:34.099Z (about 1 month ago)
- Language: C++
- Size: 336 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **Flutter MobX - Gestão de Estado de forma simples**
## Dependências
Adicione as seguintes dependências ao seu arquivo pubspec.yaml.
```
dependencies:
mobx: ^2.0.7+2'
flutter_mobx: ^2.0.6+1'
```
**mobx** é o responsável por trazer a base de códigos (Observables, Actions, Reactions)
**flutter_mobx** faz a integração do MobX sobre o Flutter. O flutter_mobx fornece um conjunto de widgets **Observer** que escutam Observables e com isso, recontrói automaticamente as alterações.
Com flutter_mobx:
![](/files/observer.gif)
A seguir, adicionar as seguintes dependências de desenvolvimento:
```
dev_dependencies:
build_runner: ^2.1.11
mobx_codegen: ^2.0.7
```
**mobx_codegen** Adiciona suporte para anotar seu código MobX com ``@observable``, ``@computed``, ``@action``,![](/files/mobx_codegen.png)