Flutter_flutter2.0_填坑

  • 替换
项目
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

猜你喜欢

转载自blog.csdn.net/FlyingKuiKui/article/details/116521132