【问题标题】:the name appstate isn't a type so it can't be used as a type argument名称 appstate 不是类型,因此不能用作类型参数
【发布时间】:2021-07-14 13:27:30
【问题描述】:

我收到错误,名称 appstate 不是类型,因此它不能在我的颤振代码中用作类型参数

代码: https://github.com/1-creator/auth

错误:

Widget mutationComponent(context) {

final appState = Provider.of<AppState>(context);

...

我尝试了什么

-创建类'AppState'

-flutter clean

-缓存失效

【问题讨论】:

  • AppState extends c 中的c 是什么?
  • 更正这是一个拼写错误

标签: flutter dart


【解决方案1】:

似乎我没有从 lib 包状态导入 app_state.dart

  import 'package:know/state/app_state.dart';

刚刚添加了导入,问题就解决了

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-23
    • 1970-01-01
    • 2016-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多