Error 'badge' is being imported from 2 dart sources - flutter

Getting this error for build failure:
error build: ../../../development/flutter/.pub-cache/hosted/pub.dev/bubble_bottom_bar-2.0.0/lib/bubble_bottom_bar.dart:195:14: Error: ‘Badge’ is imported from both ‘package:badges/src/badge.dart’ and ‘package:flutter/src/material/badge.dart’.
Using code from https://codecanyon.net/item/flyweb-for-web-to-app-convertor-flutter-admin-panel-v10/26840230
Can anyone suggest where and what needs to be edited to get this issue resolved.
Have tried updating the Flutter with following commands
Flutter clean
Flutter pub get
Have also reinstalled pods for ios and still failing to build on Flutter build ios

Badge is coming from both material and badge package. Flutter material provide by default.
If you wish to use the package one, you can do
import 'package:badges/src/badge.dart' as badge;
Now to use it, call badge.Badge(....

Related

Getting dart import error in Flutter App upon upgrading

I upgraded Flutter SDK for my perfectly working app today at https://docs.flutter.dev/get-started/install/macos for file - flutter_macos_3.3.6-stable.zip
However upon installing the folder, I am getting error at dart:convert which I use for Json conversions:
I did flutter clean & flutter pub get / flutter get packages and have restarted Android studio so many times. Rest all is working fine.
Am I missing something or dart:convert has been replaced with something else in the latest upgrade ?
UPDATE (Solved)
I reinstalled (unzipped) the file again & it stopped showing the error.
I think you can try this one here , if that's not working

I am having a problem building a Flutter App

I has a build a flutter app before successfully, but I try to update the code of my flutter app because I discovered some bugs but when j try to build it I get a error about error configuring video_player Android, I try to add it as a Dependencies but still it didn't work, I also invalidate cache's too it didn't work because it also said something about Cache's, I also upgraded my flutter SDK, still it didn't work, I will attach a image under this write up.
The error I am facing 😭😪
The error I am facing 😭😪
Write below command in terminal to clear cache with android project path.
flutter pub cache clean
./gradlew clean
gradlew cleanBuildCache

Flutter Error : Package io.flutter.plugins.webviewflutter does not exists

I get an error message while running a Flutter project. I tried using webview_flutter(1.0.7) plugin with Flutter 1.22.5(stable) and Flutter 1.26.0-2.0.pre.167.
This is a fresh new project with only webview_flutter plugin dependency.
I am getting the above error that package webviewflutter does not exists.
Please help to solve this issue.
You may want to check if you made the correct entry for the package in your pubspec.yaml and after that does get run successfully.
Just a tip:
It is better to paste the error text, rather than a screenshot.

new flutter project in vscode has error

when i create a new flutter project in vscode it will immediately shows an error in the main.dart file and gives a gradle error when trying to debug.
shown here: main.dart error
"compiler message: lib/main.dart:68:19: Error: Too few positional arguments: 1 required, 0 given."
I've reinstalled dart and flutter plugins. updated the java install.
in debug console i get this:
debug console
added output of flutter doctor -v
enter image description here
I was also facing the same error, but it was always on my test folder.
This is what I did:
On your terminal, make sure you are in your project repository.
Run the flutter pub get command, it worked for me, may be you
should try it too.
Do you possibly have two different versions of the Flutter SDK on your machine? I wonder if one is being used by flutter create and the other for analysis.
If you're sure you only have one, please open an issue on GitHub and attach a log file for me to investigate.

Firebase for Flutter sign-in build failure

I have been following the Firebase for Flutter tutorial with success until I reach "Set up Firebase Integration". When I relaunch the app on my phone the build fails with the following exception:
Note:
/Users/williamdevore/.pub-cache/hosted/pub.dartlang.org/firebase_storage-0.0.2/android/src/main/java/io/flutter/plugins/firebase/storage/FirebaseStoragePlugin.java
uses unchecked or unsafe operations. Note: Recompile with
-Xlint:unchecked for details. /Users/williamdevore/.pub-cache/hosted/pub.dartlang.org/google_sign_in-0.0.6/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java:30:
error: cannot find symbol import
io.flutter.app.FlutterFragmentActivity;
^ symbol: class FlutterFragmentActivity location: package io.flutter.app
/Users/williamdevore/.pub-cache/hosted/pub.dartlang.org/google_sign_in-0.0.6/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java:98:
error: cannot find symbol
+ FlutterFragmentActivity.class.getName());
^ symbol: class FlutterFragmentActivity location: class GoogleSignInPlugin 2 errors
FAILURE: Build failed with an exception.
Flutter doctor says everything is fine for Android. I have the latest "everything". I was able to setup the google-services json file and use the Firebase console with no problems.
I followed the instructions for modifying the build.gradle files exactly--twice!.
Is there some of other step I should be doing outside of the Flutter tutorial that is specific for Android, perhaps Brew or cocoapods maybe?
It looks like you might have an older version of Flutter that doesn't match the Google Sign In plugin version you're using. Right now the plugins aren't declaring which versions of Flutter they require (but that may change in the future).
Does running flutter update get you past this error? If not, try running flutter doctor and see how old your Flutter SDK is. You want it to include the commit b4ba972bf394a2269824e1eadaa1627bbc872d4b, so it should be a few days old at most.
You should replace FlutterActivity with FlutterFragmentActivity in the two places it appears in your MainActivity.java. (This won't be necessary in the next Google Sign In plugin update; see issue 10690.)