遇到了与”Error: ‘MenuController’ is imported”相关的问题。

huangapple go评论64阅读模式
英文:

Been having issue with "Error: 'MenuController' is imported"

问题

我在尝试编译我的Flutter应用程序时一直遇到这个问题:

lib/view/screens/dashboard/dashboard_screen.dart:7:1: Error: 'MenuController' is imported from both 'package:flutter/src/material/menu_anchor.dart' and 'package:vale_ace_boy/controller/menu_controller.dart'. import 'package/vale_ace_boy/controller/menu_controller.dart';

请问如何解决这个问题? 😓

我已经尝试过 flutter cleanflutter pub get,但似乎都不起作用。

英文:

I keep having this issue while I try to compile my flutter application

lib/view/screens/dashboard/dashboard_screen.dart:7:1: Error: 'MenuController' is imported from both 'package:flutter/src/material/menu_anchor.dart' and 'package:vale_ace_boy/controller/menu_controller.dart'.
import 'package:vale_ace_boy/controller/menu_controller.dart';

How can I get this solved please 🙏

I've tried flutter clean and flutter pub get but nothing seems to be working

答案1

得分: 1

你可能创建了一个名为MenuController的类/小部件,在Flutter中已存在,因此存在两者之间的歧义。

将您的MenuController重命名为其他名称,例如CustomMenuController

英文:

You probably created a class/widget called MenuController, which already exists in Flutter, so there is ambiguity between the two of them.

Rename your MenuController as something else, for example CustomMenuController.

huangapple
  • 本文由 发表于 2023年2月8日 18:27:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/75384411.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定