You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
628 B
20 lines
628 B
2 weeks ago
|
import 'package:get/get.dart';
|
||
|
import 'package:dio/dio.dart';
|
||
|
import 'package:problem_check_system/modules/problem/controllers/problem_controller.dart';
|
||
|
import 'package:problem_check_system/data/providers/local_database.dart';
|
||
|
|
||
|
class ProblemBinding implements Bindings {
|
||
|
@override
|
||
|
void dependencies() {
|
||
|
// 2. 注入 ProblemController
|
||
|
// 控制器通过构造函数接收它所需要的依赖
|
||
|
// Get.find() 会查找并返回已注入的实例
|
||
|
Get.lazyPut<ProblemController>(
|
||
|
() => ProblemController(
|
||
|
localDatabase: Get.find<LocalDatabase>(),
|
||
|
dio: Get.find<Dio>(),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|