项目 | 旧 | 新 |
---|
MediaQuery | .of(context,nullOk: true); | .of(context); |
BuildContext | ancestorStateOfType | findAncestorStateOfType |
BuildContext | ancestorRenderObjectOfType | findAncestorRenderObjectOfType |
BuildContext | inheritFromWidgetOfExactType | dependOnInheritedWidgetOfExactType |
Scaffold | resizeToAvoidBottomPadding | resizeToAvoidBottomInset |
SliverOverlapAbsorber | child | sliver |
- 问题:
The name 'Router' is defined in the libraries 'package:fluro/src/router.dart and 'package:flutter/src/widgets/router.dart'. Try using 'as prefix' for one of the import directives, or hiding the name from all but one of the imports.
由于自定义路由与系统路由同名冲突造成的。
解决方案一:
import 'package:flutter/material.dart';
替换为import 'package:flutter/material.dart' hide Router;
解决方案二:
import 'package:fluro/src/router.dart';
替换为import 'package:fluro/src/router.dart' as Fluro;
然后在使用Router
的地方替换为Fluro.Router
。例如Router.push
替换为Fluro.Router.push
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)