Error while running Flutter Web Project lib/generated_plugin_registrant.dart:16:3: Error: Getter not found: 'AnotherFlushbarPlugin' - flutter

I yesterday upgraded to Flutter 2.0.6 and when I added web support to an existing project I am getting this error
lib/generated_plugin_registrant.dart:16:3: Error: Getter not found: 'AnotherFlushbarPlugin'.
AnotherFlushbarPlugin.registerWith(registrar);
I am using a dependency Flushbar thought it might be due to that I removed that package run flutter clean but no use the error is still there

Fixed the issue there was package Flushbar code in the yaml file, I removed the line "another_flushbar": ^1.10.10 to fix the issue

Related

Fluttertoast problem: Member not found: 'Overlay.maybeOf'

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-8.1.3/lib/fluttertoast.dart:165:28: Error: Member not found: 'Overlay.maybeOf'.
var _overlay = Overlay.maybeOf(context!);
^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/fluttertoast-8.1.3/lib/fluttertoast.dart:154:18: Error: The getter 'mounted' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
framework.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'mounted'.
if (context?.mounted != true) {
^^^^^^^
3
FAILURE: Build failed with an exception.
* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159
After adding fluttertoast in my project it shows this problem while I run project on my device.
Now, what does it mean?
I was trying to show toast when an error or success occurred. But without snackbar fluttertoast is the only option to do.
But after adding dependency this problem showed.
Update: Found the actual issue:
Flutter toast v8.1.3 cannot work with a Flutter version older than 3.7.0 because of a breaking change in Flutter v3.7.0. You have to either use fluttertoast v8.1.2 or you have to upgrade your flutter version to v3.7.0+.
Old Answer
I faced a similar issue after running the flutter pub upgrade but even after rolling back the changes in the pubspec.yaml file, I got the same error. But this issue was fixed after rolling back the changes in the pubspec.lock file. Make sure to do flutter clean after reverting changes in pubspec.lock file.
I also came across the same problem,
Due to some limitations I was not able to change the flutter version, and Changing the version of fluttertoast has not led to any success. so what I do is try some other alternatives
toast: ^0.3.0
https://pub.dev/packages/toast
I removed fluttertoast completely from the project and install a new dependency by running the command in the terminal
flutter pub add toast
usage:
Toast.show("Toast plugin app", duration: Toast.lengthShort, gravity: Toast.bottom);
try to use this:
if (!mounted) return;
snackBar(yourText, context);//or use your fluttertoast
if you had any problem or question i'm here to answer.
happy coding.
Unfortunately, this error is caused by a version incompatibility between the fluttertoast package and your version of Flutter. The Overlay.maybeOf method was removed in Flutter 2.0 and replaced with Overlay.of, which is likely what the fluttertoast package is using.
In order to fix this error, you can try upgrading to the latest version of fluttertoast, or if that doesn't work, downgrade your version of Flutter to a version compatible with the version of fluttertoast you are using.

Error 'badge' is being imported from 2 dart sources

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(....

.pub-cache/hosted/pub.dartlang.org/http-0.13.5/lib/src/base_request.dart:144:7: Error: The getter 'Lrethrow' isn't defined for the class 'BaseRequest'

Trying to compile my flutter project. It trow an error and exit. It look like it's cause by http. But i don't know how solve it. My flutter version is 3.3.6. Sorry for the english.
My error
My dependencies
HTTP paquage version. I have updated the package and clean the app

Can anyone tell me what is this error in flutter when I am trying to add syncfusion_flutter_pdfviewer package

When I add syncfusion_flutter_pdfviewer package in yaml file I am getting the below error. can anyone tell me what is that error states ?
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdfviewer_plugin.dart:21:23: Error: Type 'Uint8List' not found.
CancelableOperation<Uint8List?>? _nativeImage;
^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdfviewer_plugin.dart:24:37: Error: Type 'Uint8List' not found.
After adding package, application should be compiled again.
Try running a command in terminal.
flutter run -d [device id]
UPDATE:
Also try to:
import 'dart:typed_data';
in a file where you are using syncfusion components.
The issue was also resolved for me by upgrading to the latest Flutter version (as of 22 October 2022).
Upgrade flutter to the latest version. This issue was solved after I upgraded to version 3.3.1.

I am not able to use flutter. It just stopped randomly working fine like 5 mins ago due to this sdk error

Building flutter tool...
Error: Error when reading '../../../flutter/packages/flutter_tools/.packages': No such file or directory
Error: Couldn't resolve the package 'flutter_tools' in 'package:flutter_tools/executable.dart'.
../../../flutter/packages/flutter_tools/bin/flutter_tools.dart:7:8: Error: Not found: 'package:flutter_tools/executable.dart'
import 'package:flutter_tools/executable.dart' as executable;
^
../../../flutter/packages/flutter_tools/bin/flutter_tools.dart:10:14: Error: Method not found: 'main'.
executable.main(args);
^^^^
I had the issue in this post before and i followed its solution : I am not able to use flutter as im getting an error with the dart sdk, only it has been working for weeks until today then i ran into the error above.. anything i can do..
I reinstalled flutter linux version and it works just fine.