如何修复DART模棱两可的导入程序包错误消息

发布于 2025-02-12 06:37:19 字数 290 浏览 2 评论 0原文

名称dateutils在库中定义软件包:calendarro/date_utils.dart and code> and 软件包:flutter/src/src/strc/diters/date.dart(通过软件包:Flutter/Material.dart)。 尝试使用作为“导入指令”之一的前缀,或将名称隐藏在importssss.dartambigous_import之外的所有名称中

The name DateUtils is defined in the libraries package:calendarro/date_utils.dart and package:flutter/src/material/date.dart (via package:flutter/material.dart).
Try using as prefix for one of the import directives, or hiding the name from all but one of the imports.dartambiguous_import

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瑕疵 2025-02-19 06:37:27

您可以像这样导入包装

import 'package:calendarro/date_utils.dart' as dateutil;

//and use this as 

dateutil.DateUtils

you can import packages like this

import 'package:calendarro/date_utils.dart' as dateutil;

//and use this as 

dateutil.DateUtils
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文