Skip to content

Instantly share code, notes, and snippets.

@kauemurakami
Created July 16, 2020 18:55
Show Gist options
  • Save kauemurakami/06d1aca39cad574355e3d44d3a81875c to your computer and use it in GitHub Desktop.
Save kauemurakami/06d1aca39cad574355e3d44d3a81875c to your computer and use it in GitHub Desktop.
Home dependencies
import 'package:getx_pattern/app/controller/home/home_controller.dart';
import 'package:getx_pattern/app/data/provider/api.dart';
import 'package:getx_pattern/app/data/repository/posts_repository.dart';
import 'package:http/http.dart' as http;
import 'package:get/get.dart';
class HomeBinding implements Bindings {
@override
void dependencies() {
Get.lazyPut<HomeController>(() {
return HomeController(
repository:
MyRepository(apiClient: MyApiClient(httpClient: http.Client())));
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment