Skip to content

Snappy1

  • Home
  • Android
  • What
  • How
  • Is
  • Can
  • Does
  • Do
  • Why
  • Are
  • Who
  • Toggle search form

[FIXED] android – Please help, after flutter update, (The name ‘MenuItem’ is defined in the libraries) in visual studio

Posted on November 11, 2022 By

Solution 1 :

Try use as prefix

import "package:fuodz/widgets/menu_item.dart" as item;

//code widget

VStack[
  item.MenuItem();
]

or, change class name MenuItem in widgets/menu_item.dart to different name

Solution 2 :

import ‘package:flutter/material.dart’;
import ‘package:Yourprojectname/model/menu_item.dart’ as item;

class MenuItems{
static List<item.MenuItem> itemFirst = [
itemShare,
];
static List<item.MenuItem> itemSecond = [
itemSignOut,
];
static const itemShare = item.MenuItem(
text: ‘Alarm’,
icon: Icons.alarm,
);
static const itemSignOut = item.MenuItem(
text: ‘Sign Out’,
icon: Icons.logout,
);
}

Problem :

When I updated Flutter, I had this problem in more than one project.

the error message:

The name 'MenuItem' is defined in the libraries 'package:flutter/src/widgets/platform_menu_bar.dart' and 'package:fuodz/widgets/menu_item.dart'.

Try using ‘as prefix’ for one of the import directives, or hiding the name from all but one of the imports.

enter image description here

READ  [FIXED] java - AndroidX Test - ActivityScenario API Destroy the activity starightaway
Powered by Inline Related Posts
Android Tags:android, flutter, visual-studio-code

Post navigation

Previous Post: [FIXED] android.media.ImageWriter produces green screen screen on every second posted Image frame
Next Post: [FIXED] android – Notifee native module not found

Related Posts

[FIXED] Android Json Post shows JSONExepection (End of input at character 0 of) Android
[FIXED] android – How to report parameters in Firebase Analytics Events Android
[FIXED] androidx – Android Java Unit Testing using ApplicationProiver Android
[FIXED] android – Notification similar to whatsapp Android
[FIXED] android – Firestore query doesn’t return results sometimes when in a loop Android
[FIXED] Color coding error and truncated file in Android Studio Android

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022

Categories

  • ¿Cómo
  • ¿Cuál
  • ¿Cuándo
  • ¿Cuántas
  • ¿Cuánto
  • ¿Qué
  • Android
  • Are
  • At
  • C'est
  • Can
  • Comment
  • Did
  • Do
  • Does
  • Est-ce
  • Est-il
  • For
  • Has
  • Hat
  • How
  • In
  • Is
  • Ist
  • Kann
  • Où
  • Pourquoi
  • Quand
  • Quel
  • Quelle
  • Quelles
  • Quels
  • Qui
  • Should
  • Sind
  • Sollte
  • Uncategorized
  • Wann
  • Warum
  • Was
  • Welche
  • Welchen
  • Welcher
  • Welches
  • Were
  • What
  • What's
  • When
  • Where
  • Which
  • Who
  • Who's
  • Why
  • Wie
  • Will
  • Wird
  • Wo
  • Woher
  • you can create a selvedge edge: You can make the edges of garter stitch more smooth by slipping the first stitch of every row.2022-02-04
  • you really only need to know two patterns: garter stitch

Recent Posts

  • What is the rising action in Julius Caesar?
  • How do you secure a rope to itself?
  • Does waterproof laminate scratch easily?
  • What makes a building prewar?
  • What can you learn in a month without alcohol?

Recent Comments

No comments to show.

Copyright © 2023 Snappy1.

Powered by PressBook Grid Dark theme