我刚刚开始尝试安装此软件包flutter_typeahead 1.8.7。
即使在运行flutter pub get
之后,尝试在我的代码中使用它时,也会出现以下错误。请让我知道在哪里可以开始诊断。
Compiler message:
Error: Could not resolve the package 'flutter_typeahead' in 'package:flutter_typeahead/flutter_typeahead.dart'.
lib/screens/home_screen.dart:10:8: Error: Not found: 'package:flutter_typeahead/flutter_typeahead.dart'
import 'package:flutter_typeahead/flutter_typeahead.dart';
^
lib/screens/home_screen.dart:171:22: Error: The method 'TypeAheadField' isn't defined for the class '_HomeScreenState'.
- '_HomeScreenState' is from 'package:Arriv/screens/home_screen.dart' ('lib/screens/home_screen.dart').
Try correcting the name to the name of an existing method, or defining a method named 'TypeAheadField'.
child: TypeAheadField(
^^^^^^^^^^^^^^
答案 0 :(得分:0)
我刚刚停止了正在运行的应用程序,然后在模拟器上重新运行它。错误消失了。 我对热装非常上瘾,以至于我什至无法想到这个选项。 :P