我正在尝试构建一个flutter项目,根据下面的错误日志,我反复遇到此错误。
我应该如何解决?
> Compiler message:
> ../../../Documents/flutter/packages/flutter/lib/src/cupertino/page_scaffold.dart:116:31:
> Error: The getter 'navigationBar' isn't defined for the class
> '_CupertinoPageScaffoldState'.
> - '_CupertinoPageScaffoldState' is from 'package:flutter/src/cupertino/page_scaffold.dart'
> ('../../../Documents/flutter/packages/flutter/lib/src/cupertino/page_scaffold.dart').
> Try correcting the name to the name of an existing getter, or defining
> a getter or field named 'navigationBar'.
> final fullObstruction = navigationBar.shouldFullyObstruct(context) == null ||
> navigationBar.shouldFullyObstruct(context);
> ^^^^^^^^^^^^^
答案 0 :(得分:1)
在您的路线中导入以下库。
import 'package:flutter/cupertino.dart';