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

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

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.

Related

Call JavaScript function from dart

Is anyone know how to call JS function from dart ?
I followed steps which linked below.
Firstly, appear this error.
"Error: Not found: 'dart:js' import 'dart:js';"
I followed previous answer which comment this line from js.dart and fixed it.
[export 'dart:js' show allowInterop, allowInteropCaptureThis;].
But now I got another error below.
No top-level method 'callJsFunc' declared. Receiver: top-level Tried calling: callJsFunc()
Is anyone know how to fix this error ?
text
I tried other Flutter SDK version (latest one and 3.0.5) but got same error.
flutter uses dart not javascript.
so... actually you require a separate javascript engine if you want to use javascript with flutter and that can be done with dart ffi unless you are building a web app with flutter.
However, there is a library called flutter_js and you can use it if you need to run javascript.
On the other hand, if you are interested in using embeddable Javascript engine with your flutter project by yourself.
you should check this link out where it shows how to use ffi for attaching an embeddable Javascript engine called Duktape

MissingPluginException(No implementation found for method vision#startImageLabelDetector on channel google_mlkit_image_labeler)

final List image = await imageLabeler.processImage(inputImage); // <---Error Exception
I am using an android.
I have seen a person with the same exact issue, but they were running on the web, and it is not implemented to run on the web. I am using an android, so there should be no problems.
Is there a way to fix this issue?
import 'package:google_ml_kit/google_ml_kit.dart';
import 'package:google_mlkit_image_labeling/google_mlkit_image_labeling.dart';
import 'package:google_mlkit_commons/google_mlkit_commons.dart';
final List image = await imageLabeler.processImage(inputImage);
the example shown above was taken from a youtube video, word for word, so there should be zero problems.
https://www.youtube.com/watch?v=giVk7yGUkas&t=244s&ab_channel=LearnwithJahangirJadi
EDIT
i tried closing editor/ doing a flutter clean/ and closing my app, I encountered another proble
Exception has occurred.
FirebaseException ([cloud_firestore/unavailable] The service is currently unavailable. This is a most likely a transient condition and may be corrected by retrying with a backoff.)
adding these to the pubspec.yaml files causes this error
google_ml_kit:
google_mlkit_image_labeling:
google_mlkit_commons:
removing them fixes the error.
what am I doing wrong?
Sometimes this happens to me, try to run these steps:
flutter clean
flutter pub get
close your code editor, your app/emulator, and try again.

I keep receiving an error that says Flutter Error Unable to Load Asset

I'm new to flutter. While adding an image and trying to run I got an error that said "Flutter Error Unable to load asset". An image of the problem can be seen below. If anyone can help that would be really appreciated! IMAGE: [https://i.stack.imgur.com/7ZzvM.png]
Please check your pubspec.yaml file for proper indentation. Also, once declared in pubspec, you're supposed to get dependencies in source code. Have you done both?
Also, check this thread - fluttererror-unableToLoadAsset
Please check your folder name.
You have written asssets instead of assets that is why the error is occuring.

Device calendar plugin for Flutter

We are using the device_calendar plugin and we are trying to reproduce the example app in ours. Im running into one error that I dont understand. The error is on the "enum DayOfWeekGroup". It is undefined even though I am including the package import. I tried adding it manually from the example code but it exists outside of the example project so its causing issues.
the plugin is : device_calendar: ^3.0.0+1
The enum exists in src folder outside the example everything else is being pulled into the package from the import but this enum.
This feature is not in the plugin yet, the workaround is use DayOfWeek enum in place of DayOfWeekGroup just in case someone is messing with the new version of device Calendar plugin like I was :)

Angular2 - Import barrels cause 404 at runtime

I am trying to implement the import barrels structure that is described in this link (you may have to scroll down a bit) :
https://angular.io/docs/ts/latest/guide/style-guide.html#!#application-structure
The problem I am facing is that the index.ts files that I am creating and referencing like
import {...} from './shared/services';
are not found at runtime and are throwing 404s. If I reference the modules like
import {...} from './shared/services/index';
It works fine. The problem only appears at runtime, typescript does not complain and compiles successfully. I have duplicated the issue in a plunker:
https://plnkr.co/edit/ClE76zuihFTETLDGehnd?p=preview
You can see the error in the console.
Thanks in advance for your help!
I finally found something: https://www.reddit.com/r/Angular2/comments/4i2d9x/support_problem_with_barrels/
It seems, that this is not easily possible with SystemJS, because it can not handle barrel-files.
To solve this, you can add every file as you did with [...]/index or you can add them as a package in SystemJS