Skip to content

Instantly share code, notes, and snippets.

@kauemurakami
Last active April 4, 2023 22:05
Show Gist options
  • Save kauemurakami/ceec34786ccb2af7f48a276716e24441 to your computer and use it in GitHub Desktop.
Save kauemurakami/ceec34786ccb2af7f48a276716e24441 to your computer and use it in GitHub Desktop.
Details Controller
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