Last active
April 4, 2023 22:05
-
-
Save kauemurakami/ceec34786ccb2af7f48a276716e24441 to your computer and use it in GitHub Desktop.
Details Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:get/get.dart'; | |
import 'package:getx_pattern/app/data/model/model.dart'; | |
import 'package:getx_pattern/app/data/repository/posts_repository.dart'; | |
import 'package:meta/meta.dart'; | |
class DetailsController extends GetxController { | |
final MyRepository repository; | |
DetailsController({@required this.repository}) : assert(repository != null); | |
final _post = MyModel().obs; | |
get post => this._post.value; | |
set post(value) => this._post.value = value; | |
//pratique | |
editar(post){ | |
print('editar'); | |
} | |
//pratique | |
delete(id){ | |
print('deletar'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment