Gsheets package not importing - flutter

I'm trying to use gsheets in my flutter project, but every time I try to import it by writing import 'package:gsheets/ghsheets.dart'; the package it's underlined in red and gives me this error:
Error: Could not resolve the package 'gsheets' in 'package:gsheets/ghsheets.dart'. lib/main.dart:2:8: Error: Not found: 'package:gsheets/ghsheets.dart'import 'package:gsheets/ghsheets.dart'; ^Unhandled exception: FileSystemException(uri=org-dartlang-untranslatable-uri:package%3Agsheets%2Fghsheets.dart; message=StandardFileSystem only supports file:* and data:* URIs) #0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:33:7) #1 asFileUri (package:vm/kernel_front_end.dart:657:37) #2 writeDepfile (package:vm/kernel_front_end.dart:825:21) <asynchronous suspension> #3 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:583:15) <asynchronous suspension> #4 _FlutterFrontendCompiler.compile (package:flutter_frontend_server/server.dart:43:22) #5 starter (package:flutter_frontend_server/server.dart:180:27) #6 main (file:///opt/s/w/ir/cache/builder/src/flutter/flutter_frontend_server/bin/starter.dart:13:30) #7 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32) #8 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
Why is this happening and how do I fix it?
Thanks!

Related

Flutterfire configure Unexpected character (at character 1) error

I am developing a project with flutter and i want to add crashlytics to my project. Everything else works but flutterfire configure is giving me json error. I look every where for all possible answers but still not solving the issue.
npm commands
- firebase login
- npm install -g firebase-tools
- dart pub global activate flutterfire_cli
- flutterfire configure
all these commands is also works in android studio terminal. but flutterfire gives json error.
I already added the android dependencies for firebase.
error log
⠏ Fetching available Firebase projects...
Unhandled exception:
FormatException: Unexpected character (at character 1)
#
^
#0 _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5)
#1 _ChunkedJsonParser.parseNumber (dart:convert-patch/convert_patch.dart:1250:9)
#2 _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:915:22)
#3 _parseJson (dart:convert-patch/convert_patch.dart:35:10)
#4 JsonDecoder.convert (dart:convert/json.dart:612:36)
#5 runFirebaseCommand (package:flutterfire_cli/src/firebase.dart:95:25)
<asynchronous suspension>
#6 getProjects (package:flutterfire_cli/src/firebase.dart:114:20)
<asynchronous suspension>
#7 ConfigCommand._selectFirebaseProject (package:flutterfire_cli/src/commands/config.dart:278:24)
<asynchronous suspension>
#8 ConfigCommand.run (package:flutterfire_cli/src/commands/config.dart:368:37)
<asynchronous suspension>
#9 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#10 main (file:///C:/Users/USER/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutterfire_cli-0.2.4/bin/flutterfire.dart:57:5)
<asynchronous suspension>
⠧ Fetching available Firebase projects...
Unhandled exception:
FormatException: Unexpected character (at character 1)
#
^
#0 _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5)
#1 _ChunkedJsonParser.parseNumber (dart:convert-patch/convert_patch.dart:1250:9)
#2 _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:915:22)
#3 _parseJson (dart:convert-patch/convert_patch.dart:35:10)
#4 JsonDecoder.convert (dart:convert/json.dart:612:36)
#5 runFirebaseCommand (package:flutterfire_cli/src/firebase.dart:95:25)
<asynchronous suspension>
#6 getProjects (package:flutterfire_cli/src/firebase.dart:114:20)
<asynchronous suspension>
#7 ConfigCommand._selectFirebaseProject (package:flutterfire_cli/src/commands/config.dart:278:24)
<asynchronous suspension>
#8 ConfigCommand.run (package:flutterfire_cli/src/commands/config.dart:368:37)
<asynchronous suspension>
#9 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#10 main (file:///C:/Users/USER/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutterfire_cli-0.2.4/bin/flutterfire.dart:57:5)
<asynchronous suspension>
Would you please help me to solve this issue?
For those of us on windows, do not forget to check if you are running an old version which you may have configured the PATH to point to. This seemed to be the problem in my case. I resolved by removing the old windows binary, then did a fresh install using npm (a fresh/updated windows install may work too). :
npm install -g firebase-tools
followed by:
firebase logout
firebase login
then:
flutterfire configure
**** update ****
i resolve error by this step :
1 - re connect to network
2 - run dart pub global activate flutterfire_cli
3- run flutterfire configure
see Docs help you to get started
Add Firebase To Flutter App
hope this help you
same error here i used firebase in another project but in this project it give me this
Unhandled exception:
FormatException: Unexpected character (at line 5, character 1)
{
^
#0 _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5)
#1 _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:848:48)
#2 _parseJson (dart:convert-patch/convert_patch.dart:35:10)
#3 JsonDecoder.convert (dart:convert/json.dart:612:36)
#4 runFirebaseCommand (package:flutterfire_cli/src/firebase.dart:95:25)
<asynchronous suspension>
#5 getApps (package:flutterfire_cli/src/firebase.dart:162:20)
<asynchronous suspension>
#6 findOrCreateFirebaseApp (package:flutterfire_cli/src/firebase.dart:257:34)
<asynchronous suspension>
#7 FirebaseAndroidOptions.forFlutterApp (package:flutterfire_cli/src/firebase/firebase_android_options.dart:47:25)
<asynchronous suspension>
#8 ConfigCommand.run (package:flutterfire_cli/src/commands/config.dart:377:24)
<asynchronous suspension>
#9 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#10 main (file:///home/abdalazeez/.pub-cache/hosted/pub.dartlang.org/flutterfire_cli-0.2.4/bin/flutterfire.dart:57:5)
<asynchronous suspension>
and this content file
try {
final flutterApp = await FlutterApp.load(Directory.current);
await FlutterFireCommandRunner(flutterApp).run(arguments); <=====the error happen here
} on FlutterFireException catch (err) {
if (utils.activeSpinnerState != null) {
try {
utils.activeSpinnerState!.done();
} catch (_) {}
}
stderr.writeln(err.toString());
exitCode = 1;
} catch (err) {
exitCode = 1;
rethrow;
}
Try installing the Firebase CLI using the standalone binary instead of NPM on Windows, or the install script on Mac.
following steps helped me:
update firebase cli
curl -sL firebase.tools | upgrade=true bash
call
firebase login --reauth
reference:
https://github.com/invertase/flutterfire_cli/issues/27
downloading and installing the node.js setup does the trick for me,
after installation, search for the node.js terminal , then run 'firebase login', after login successfully, then run 'dart pub global activate flutterfire_cli', after succesfully getting the flutterfire cli, then navigate to the folder where the flutter app you created is using the cd(change directory)
after navigating to the directory, then run 'flutterfire configure'
this would create a firebase project in your flutter app project. finish
install latest version of npm and then run command of flutter fire.
example: from any directory run: npm install -g npm#latest version
=> npm install -g npm#9.2.0
as of now latest version of npm is 9.2.0
Deleting the C:\Users\USERNAME.cache\firebase folder
Then re-running flutterfire configure worked for me after first trying the standalone binary and then nvm.

Flutter share_plus is not working and getting error [duplicate]

I am trying to use the plugin
_launchURL(url) async {
await launch("www.google.com");
}
I have put "www.google.com" just for debugging purposes.
The error I get is MissingPluginException :
E/flutter ( 8299): MissingPluginException(No implementation found for method launch on channel plugins.flutter.io/url_launcher)
E/flutter ( 8299): #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7)
E/flutter ( 8299): <asynchronous suspension>
E/flutter ( 8299): #1 launch (package:url_launcher/url_launcher.dart:47:19)
E/flutter ( 8299): #2 _launchURL (file:///Users/matejsimunic/Work/dart/suhail/lib/main.dart:834:9)
E/flutter ( 8299): <asynchronous suspension>
E/flutter ( 8299): #3 _TripDetailBodyState.build.<anonymous closure> (file:///Users/matejsimunic/Work/dart/suhail/lib/main.dart:818:19)
E/flutter ( 8299): #4 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:494:14)
E/flutter ( 8299): #5 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:549:30)
E/flutter ( 8299): #6 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
E/flutter ( 8299): #7 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:161:9)
E/flutter ( 8299): #8 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:94:7)
E/flutter ( 8299): #9 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:315:9)
E/flutter ( 8299): #10 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12)
E/flutter ( 8299): #11 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11)
E/flutter ( 8299): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143:19)
E/flutter ( 8299): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:121:22)
E/flutter ( 8299): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:101:7)
E/flutter ( 8299): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:64:7)
E/flutter ( 8299): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:48:7)
E/flutter ( 8299): #17 _invoke1 (dart:ui/hooks.dart:134:13)
E/flutter ( 8299): #18 _dispatchPointerDataPacket (dart:ui/hooks.dart:91:5)
restarting the app from ide doesn't work.
If you are using hot restart or hot reload, it won't do the trick.
Since Flutter has to inject plugin dependencies into the platform-specific parts of your app, hot restart/hot reload is not enough to trigger the injection.
Check this issue for more.
Close the app and execute flutter run command.
flutter clean
Inside the console did the job as stated here
I faced this Error when using Url_launcher package. just had to stop and run the app, issue got solved
Simply Run these commands..
either--
Flutter clean
or
Invalidate Caches/Restart
Had problem while using flutter toast dependency and dependencies like facebook_login. I followed these steps and resolved it:
First, u need to test whether these toast and shared preference dependencies are causing problems or some other dependencies cause the problem.
For testing that, u need to create a new seprate flutter project having the same flutter toast and shared preference dependency and check now if u r able to get toasts or not.
If u r getting toast so there is no problem with ur toast dependency.
The problem might be in ur one of the social media dependency.
In my case, I followed the above steps and found that problem was in facebook dependency. Finally, I found that I did not provide details of my app at facebook developer console. So implemented that and my app was fine.
In my case it was for the cached_network_image plugin , I have removed cached_network_image from pubspec.yaml and replaced the implementation with Image.network and the problem has disappeared
In my case, I had this problem with the image picker, then I followed the documentation and used an emulator with api 29+, it didn't work before because I was using an emulator with api 28 https://pub.dev/packages/image_picker
Uninstalling and installing the app works for me
just open terminal and
step1 flutter clean
step2 flutter pub get
step3 flutter run
Its worked for me,
Thanks have a good day .
i think if you have already done flutter pub get on the dependency, and added all the requirements for the given platform you just have to flutter run your app

LateInitializationError: Field 'annotationAst' has not been initialized

I upgrade my packages using dart pub outdated --mode=null-safety command. after updating my packages I got this error while running dart migrate to migrate my code to null-safety.
also when I tried to run flutter pub run build_runner build --delete-conflicting-outputs command for moor database.
I have no clue where this error is coming from and my codebase is really big to search for any initialization or annotation
Why does this issue happen and How can I solve that?
LateInitializationError: Field 'annotationAst' has not been initialized.
#0 ElementAnnotationImpl.annotationAst (package:analyzer/src/dart/element/element.dart)
#1 ConstantEvaluationEngine.computeDependencies (package:analyzer/src/dart/constant/evaluation.dart:336:39)
#2 _ConstantWalker._computeDependencies (package:analyzer/src/dart/constant/compute.dart:75:22)
#3 _ConstantNode.computeDependencies (package:analyzer/src/dart/constant/compute.dart:43:19)
#4 Node.getDependencies (package:analyzer/src/summary/link.dart:148:40)
#5 DependencyWalker.walk.strongConnect (package:analyzer/src/summary/link.dart:53:40)
#6 DependencyWalker.walk (package:analyzer/src/summary/link.dart:119:18)
#7 computeConstants (package:analyzer/src/dart/constant/compute.dart:26:14)
#8 LibraryAnalyzer._computeConstants (package:analyzer/src/dart/analysis/library_analyzer.dart:250:5)
#9 LibraryAnalyzer.analyzeSync (package:analyzer/src/dart/analysis/library_analyzer.dart:135:5)
#10 LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:103:12)
#11 AnalysisDriver._computeAnalysisResult.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1624:63)
#12 PerformanceLog.run (package:analyzer/src/dart/analysis/performance_logger.dart:32:15)
#13 AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/analysis/driver.dart:1600:20)
#14 AnalysisDriver._computeErrors (package:analyzer/src/dart/analysis/driver.dart:1678:26)
#15 AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:1301:20)
#16 AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2334:24)

Flutter project compile error after upgrading to 2.0.0

I was using Flutter version 1.25 (beta channel) and it worked just fine. After upgrading to version 2.0.0 and switching to stable channel i'm getting this error when i try to run the app either on mobile or web.
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/delegate_widget.dart:194:18: Error: Superclass has no method named 'inheritFromElement'.
return super.inheritFromElement(ancestor, aspect: aspect);
^^^^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/provider.dart:259:19: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
? context.inheritFromWidgetOfExactType(type) as InheritedProvider<T>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/provider-3.2.0/lib/src/provider.dart:260:19: Error: The method 'ancestorInheritedElementForWidgetOfExactType' isn't defined for the class 'BuildContext'.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'ancestorInheritedElementForWidgetOfExactType'.
: context.ancestorInheritedElementForWidgetOfExactType(type)?.widget
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Unhandled exception:
NoSuchMethodError: The getter 'name' was called on null.
Receiver: null
Tried calling: name
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
#1 ProgramCompiler._emitSuperTarget (package:dev_compiler/src/kernel/compiler.dart:5109:41)
#2 ProgramCompiler.visitSuperMethodInvocation (package:dev_compiler/src/kernel/compiler.dart:5102:24)
#3 SuperMethodInvocation.accept (package:kernel/ast.dart:5109:44)
#4 ProgramCompiler._visitExpression (package:dev_compiler/src/kernel/compiler.dart:3623:20)
#5 ProgramCompiler.visitAsExpression (package:dev_compiler/src/kernel/compiler.dart:5677:18)
#6 AsExpression.accept (package:kernel/ast.dart:6062:44)
#7 ProgramCompiler._visitExpression (package:dev_compiler/src/kernel/compiler.dart:3623:20)
#8 ProgramCompiler.visitReturnStatement (package:dev_compiler/src/kernel/compiler.dart:4152:38)
#9 ReturnStatement.accept (package:kernel/ast.dart:7786:43)
#10 ProgramCompiler._visitStatement (package:dev_compiler/src/kernel/compiler.dart:3551:20)
#11 MappedListIterable.elementAt (dart:_internal/iterable.dart:411:31)
#12 ListIterator.moveNext (dart:_internal/iterable.dart:340:26)
#13 new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:188:27)
#14 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28)
#15 new List.of (dart:core-patch/array_patch.dart:50:28)
#16 ListIterable.toList (dart:_internal/iterable.dart:211:44)
#17 ProgramCompiler.visitBlock (package:dev_compiler/src/kernel/compiler.dart:3717:62)
#18 Block.accept (package:kernel/ast.dart:7048:43)
#19 ProgramCompiler._visitStatement (package:dev_compiler/src/kernel/compiler.dart:3551:20)
#20 ProgramCompiler._emitFunctionScopedBody (package:dev_compiler/src/kernel/compiler.dart:3562:18)
#21 ProgramCompiler._emitSyncFunctionBody.<anonymous closure> (package:dev_compiler/src/kernel/compiler.dart:3355:17)
#22 ProgramCompiler._withLetScope (package:dev_compiler/src/kernel/compiler.dart:2235:25)
#23 ProgramCompiler._withCurrentFunction (package:dev_compiler/src/kernel/compiler.dart:3389:18)
#24 ProgramCompiler._emitSyncFunctionBody (package:dev_compiler/src/kernel/compiler.dart:3351:17)
#25 ProgramCompiler._emitFunction (package:dev_compiler/src/kernel/compiler.dart:3165:11)
#26 ProgramCompiler._emitMethodDeclaration (package:dev_compiler/src/kernel/compiler.dart:1843:12)
#27 ProgramCompiler._emitClassMethods (package:dev_compiler/src/kernel/compiler.dart:1784:23)
#28 ProgramCompiler._emitClassDeclaration (package:dev_compiler/src/kernel/compiler.dart:658:21)
#29 ProgramCompiler._emitClass (package:dev_compiler/src/kernel/compiler.dart:580:21)
#30 List.forEach (dart:core-patch/growable_array.dart:403:8)
#31 ProgramCompiler._emitLibrary (package:dev_compiler/src/kernel/compiler.dart:529:23)
#32 List.forEach (dart:core-patch/growable_array.dart:403:8)
#33 ProgramCompiler.emitModule (package:dev_compiler/src/kernel/compiler.dart:394:15)
#34 JavaScriptBundler.compile (package:frontend_server/src/javascript_bundle.dart:144:33)
<asynchronous suspension>
#35 FrontendCompiler.writeJavascriptBundle (package:frontend_server/frontend_server.dart:632:5)
<asynchronous suspension>
#36 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:545:9)
<asynchronous suspension>
#37 listenAndCompile.<anonymous closure> (package:frontend_server/frontend_server.dart:1105:11)
<asynchronous suspension>
Finished with error: the Dart compiler exited unexpectedly.
Failed to compile application.
I tried (from Android Studio) Tools > Flutter > Flutter Clean and File > Invalidate Caches / Restart... but it didn't help.
From the dart.dev site.
The dart fix command (added in Dart 2.12)
finds and fixes two types of issues:
Analysis issues that have associated automated fixes
(sometimes called quick-fixes or code actions)
Issues that have associated package API migration information
To preview proposed changes, use the --dry-run flag:
$ dart fix --dry-run
To apply the proposed changes, use the --apply flag:
$ dart fix --apply
From Flutter 1.X to Flutter 2.X you will see breaking changes. Always review these changes before committing to the upgrade so you understand the changes.
The package provider you're using is on version 3.2.0. It's likely that this package version is using incompatable methods, objects, etc with Flutter 2.0.0.
The latest version of provider is 5.0.0 which supports this new version of Flutter. Try upgrading the package to this version.

MissingPluginException while using plugin for flutter

I am trying to use the plugin
_launchURL(url) async {
await launch("www.google.com");
}
I have put "www.google.com" just for debugging purposes.
The error I get is MissingPluginException :
E/flutter ( 8299): MissingPluginException(No implementation found for method launch on channel plugins.flutter.io/url_launcher)
E/flutter ( 8299): #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7)
E/flutter ( 8299): <asynchronous suspension>
E/flutter ( 8299): #1 launch (package:url_launcher/url_launcher.dart:47:19)
E/flutter ( 8299): #2 _launchURL (file:///Users/matejsimunic/Work/dart/suhail/lib/main.dart:834:9)
E/flutter ( 8299): <asynchronous suspension>
E/flutter ( 8299): #3 _TripDetailBodyState.build.<anonymous closure> (file:///Users/matejsimunic/Work/dart/suhail/lib/main.dart:818:19)
E/flutter ( 8299): #4 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:494:14)
E/flutter ( 8299): #5 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:549:30)
E/flutter ( 8299): #6 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
E/flutter ( 8299): #7 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:161:9)
E/flutter ( 8299): #8 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:94:7)
E/flutter ( 8299): #9 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:315:9)
E/flutter ( 8299): #10 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12)
E/flutter ( 8299): #11 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11)
E/flutter ( 8299): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143:19)
E/flutter ( 8299): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:121:22)
E/flutter ( 8299): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:101:7)
E/flutter ( 8299): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:64:7)
E/flutter ( 8299): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:48:7)
E/flutter ( 8299): #17 _invoke1 (dart:ui/hooks.dart:134:13)
E/flutter ( 8299): #18 _dispatchPointerDataPacket (dart:ui/hooks.dart:91:5)
restarting the app from ide doesn't work.
If you are using hot restart or hot reload, it won't do the trick.
Since Flutter has to inject plugin dependencies into the platform-specific parts of your app, hot restart/hot reload is not enough to trigger the injection.
Check this issue for more.
Close the app and execute flutter run command.
flutter clean
Inside the console did the job as stated here
I faced this Error when using Url_launcher package. just had to stop and run the app, issue got solved
Simply Run these commands..
either--
Flutter clean
or
Invalidate Caches/Restart
Had problem while using flutter toast dependency and dependencies like facebook_login. I followed these steps and resolved it:
First, u need to test whether these toast and shared preference dependencies are causing problems or some other dependencies cause the problem.
For testing that, u need to create a new seprate flutter project having the same flutter toast and shared preference dependency and check now if u r able to get toasts or not.
If u r getting toast so there is no problem with ur toast dependency.
The problem might be in ur one of the social media dependency.
In my case, I followed the above steps and found that problem was in facebook dependency. Finally, I found that I did not provide details of my app at facebook developer console. So implemented that and my app was fine.
In my case it was for the cached_network_image plugin , I have removed cached_network_image from pubspec.yaml and replaced the implementation with Image.network and the problem has disappeared
In my case, I had this problem with the image picker, then I followed the documentation and used an emulator with api 29+, it didn't work before because I was using an emulator with api 28 https://pub.dev/packages/image_picker
Uninstalling and installing the app works for me
just open terminal and
step1 flutter clean
step2 flutter pub get
step3 flutter run
Its worked for me,
Thanks have a good day .
i think if you have already done flutter pub get on the dependency, and added all the requirements for the given platform you just have to flutter run your app