当前位置: 首页 > news >正文

flutter解决多个类名重名问题

Try using ‘as prefix’ for one of the import directives, or hiding the name from all but one of the imports.
Flutter遇到这种错误,意思是你自己的import的库的类名跟一另一个导入的库,或者系统的类名名字相同.解决方法,把自己的一个类名用as 加一个前缀,使用的时候 用前缀.类名,例如下面用法:

import 'xxx/search_controller.dart'  as Search1;

使用的时候用前缀.类名

Search1.SearchController

如果是多个类名重复,就可以起多个前缀,例如

import '.xxx'  as Search2;
import '.xxx'  as Search3;

调用的时候用前缀区分不同的类名

Search1.SearchController
Search2.SearchController
Search3.SearchController
http://www.lryc.cn/news/163942.html

相关文章:

  • 微信小程序 按钮颜色
  • 【云原生】kubectl常用命令大全
  • git pull
  • C++学习之运算符与表达式
  • vue使用谷歌地图实现地点查询
  • 前端该了解的网络知识
  • python3在虚拟环境实用vscode调试错误输出ModuleNotFoundError: No module named ‘django‘解决方法
  • 如何获得一个Oracle 23c免费开发者版
  • 机器学习策略二——优化深度学习系统
  • Pytorch Advanced(三) Neural Style Transfer
  • 英飞凌TC3xx--深度手撕HSM安全启动(三)--TC3xx HSM系统架构
  • 黑马JVM总结(五)
  • C语言入门Day_18 判断和循坏的小结
  • mac 好用的工具推荐
  • 星际争霸之小霸王之小蜜蜂(十二)--猫有九条命
  • 【软件分析/静态分析】chapter8 课程11/12 指针分析—上下文敏感(Pointer Analysis - Context Sensitivity)
  • 时间复杂度与空间复杂度详解
  • 目录操作函数
  • PlantUML入门教程:画时序图
  • C#范围运算符
  • 云数据库知识学习——云数据库产品、云数据库系统架构
  • C++中引用详解!
  • VUE3+TS项目无法找到模块“../version/version.js”的声明文件
  • 数据结构-堆的实现及应用(堆排序和TOP-K问题)
  • Spring 条件注解没生效?咋回事
  • 96. 不同的二叉搜索树
  • Android Jetpack 中Hilt的使用
  • 批量采集的时间管理与优化
  • uniApp监听左右滑动事件
  • 十八、MySQL添加外键?