我试图通过遵循这个由FilledStacks上传的视频来实现堆叠架构。我在使用可注入的发布包https://pub.dev/packages/injectable时遇到了一个问题
我的locator.dart类代码如下
import 'package:get_it/get_it.dart';
import 'package:injectable/injectable.dart';
final locator = GetIt.instance;
@injectableInit
void setupLocator() => $initGetIt(locator);在$initGetIt(locator)上,我得到了这个错误
The function '$initGetIt' isn't defined.
Try importing the library that defines '$initGetIt', correcting the name to the name of an existing function, or defining a function named 尽管我正在按照包文档中显示的方式实现包
发布于 2020-08-31 09:40:56
injectable_generator:
flutter packages pub run build_runner build
添加pubspec.yaml $initGetIt
https://stackoverflow.com/questions/63370674
复制相似问题