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.
Related
My flutter avd showing only white screen while rendering my ecommerce app. It was working fine until I did some changes for stripe payment gateway integration and i encountered some errors so i revoked the code but now it is showing only the white screen while running the app in avd emulator
I tried upgrading flutter and revoked the code but still issue persist
Launching lib\main.dart on sdk gphone x86 in debug mode...
Running Gradle task 'assembleDebug'...
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app-debug.apk...
W/FlutterActivityAndFragmentDelegate(11141): A splash screen was provided to Flutter, but this is deprecated. See flutter.dev/go/android-splash-migration for migration steps.
Debug service listening on ws://127.0.0.1:60669/GFSkmLI7Rug=/ws
Syncing files to device sdk gphone x86...
E/flutter (11141): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Binding has not yet been initialized.
E/flutter (11141): The "instance" getter on the ServicesBinding binding mixin is only available once that binding has been initialized.
E/flutter (11141): Typically, this is done by calling "WidgetsFlutterBinding.ensureInitialized()" or "runApp()" (the latter calls the former). Typically this call is done in the "void main()" method. The "ensureInitialized" method is idempotent; calling it multiple times is not harmful. After calling that method, the "instance" getter will return the binding.
E/flutter (11141): In a test, one can call "TestWidgetsFlutterBinding.ensureInitialized()" as the first line in the test's "main()" method to initialize the binding.
E/flutter (11141): If ServicesBinding is a custom binding mixin, there must also be a custom binding class, like WidgetsFlutterBinding, but that mixes in the selected binding, and that is the class that must be constructed before using the "instance" getter.
E/flutter (11141): #0 BindingBase.checkInstance.<anonymous closure> (package:flutter/src/foundation/binding.dart:287:9)
E/flutter (11141): #1 BindingBase.checkInstance (package:flutter/src/foundation/binding.dart:369:6)
E/flutter (11141): #2 ServicesBinding.instance (package:flutter/src/services/binding.dart:55:54)
E/flutter (11141): #3 _findBinaryMessenger (package:flutter/src/services/platform_channel.dart:136:25)
E/flutter (11141): #4 BasicMessageChannel.binaryMessenger (package:flutter/src/services/platform_channel.dart:183:56)
E/flutter (11141): #5 BasicMessageChannel.send (package:flutter/src/services/platform_channel.dart:197:38)
E/flutter (11141): #6 FirebaseCoreHostApi.initializeCore (package:firebase_core_platform_interface/src/pigeon/messages.pigeon.dart:201:23)
E/flutter (11141): #7 MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:29:54)
E/flutter (11141): #8 MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:73:13)
E/flutter (11141): #9 Firebase.initializeApp (package:firebase_core/src/firebase.dart:43:47)
E/flutter (11141): #10 main (package:e_commerce_app_flutter/main.dart:9:18)
E/flutter (11141): #11 _runMain.<anonymous closure> (dart:ui/hooks.dart:131:23)
E/flutter (11141): #12 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:19)
E/flutter (11141): #13 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:192:26)
E/flutter (11141):
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
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)
I'm having problems upgrading a custom package to null safety and am not finding any solutions or even the same problem when searching on here and any other platform.
When upgrading a custom package for Flutter 2.0 null-safety I'm using dart migrate as the guide proposes, but am getting a compiler Error.
But the error does not specify where it occurs nor is the errors description any help. I looked through the entire package to find any Array/List or inclusive range error, without any success.
I'm running out of ideas to fix this error and complete the upgrade to null-safety. Does someone have an idea what I can try to fix this error?
Error message:
dart migrate
Migrating file_name
See https://dart.dev/go/null-safety-migration for a migration guide.
Note: more than one project found; migrating the top-level project.
Analyzing project...
[--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------]No analysis issues found.
Generating migration suggestions...
[--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------]
Compiling instrumentation information...
[--------------------| ]RangeError (index): Invalid value: Not in inclusive range 0..12: 13
#0 List.[] (dart:core-patch/array.dart:268:52)
#1 BestPracticesVerifier._targetKindsFor (package:analyzer/src/error/best_practices_verifier.dart:1582:38)
#2 BestPracticesVerifier.visitAnnotation (package:analyzer/src/error/best_practices_verifier.dart:250:17)
#3 AnnotationImpl.accept (package:analyzer/src/dart/ast/ast.dart:280:49)
#4 NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7611:20)
#5 AnnotatedNodeImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:148:17)
#6 ClassDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1559:11)
#7 RecursiveAstVisitor.visitClassDeclaration (package:analyzer/dart/ast/visitor.dart:707:10)
#8 BestPracticesVerifier.visitClassDeclaration (package:analyzer/src/error/best_practices_verifier.dart:320:13)
#9 ClassDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:1536:49)
#10 NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7611:20)
#11 CompilationUnitImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:2141:21)
#12 RecursiveAstVisitor.visitCompilationUnit (package:analyzer/dart/ast/visitor.dart:731:10)
#13 CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:2134:49)
#14 LibraryAnalyzer._computeHints (package:analyzer/src/dart/analysis/library_analyzer.dart:281:10)
#15 LibraryAnalyzer.analyzeSync.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:167:9)
#16 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:397:8)
#17 LibraryAnalyzer.analyzeSync (package:analyzer/src/dart/analysis/library_analyzer.dart:166:13)
#18 LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:107:12)
#19 AnalysisDriver._computeResolvedLibrary2.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1416:65)
#20 PerformanceLog.run (package:analyzer/src/dart/analysis/performance_logger.dart:32:15)
#21 AnalysisDriver._computeResolvedLibrary2 (package:analyzer/src/dart/analysis/driver.dart:1402:20)
#22 AnalysisDriver._computeResolvedLibrary.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1395:15)
#23 _rootRun (dart:async/zone.dart:1354:13)
#24 _CustomZone.run (dart:async/zone.dart:1258:19)
#25 _runZoned (dart:async/zone.dart:1788:10)
#26 runZoned (dart:async/zone.dart:1710:10)
#27 NullSafetyUnderstandingFlag.enableNullSafetyTypes (package:analyzer/dart/element/null_safety_understanding_flag.dart:42:12)
#28 AnalysisDriver._computeResolvedLibrary (package:analyzer/src/dart/analysis/driver.dart:1394:40)
#29 AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:964:22)
#30 AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2018:24)
<asynchronous suspension>
This appears to be a bug in the Dart SDK itself. This is tracked in dart-lang/sdk#46183 and was fixed in this commit.
Steps to try on your end:
Run flutter upgrade to be sure you're on the latest release.
If you are still encountering the issue after that, consider changing to Flutter's beta channel to get a more bleeding-edge SDK in order to run the migration tool, then switch back to the stable channel once you're done. You can do this by running flutter channel beta, then re-running the migration, then flutter channel stable to switch back.
I had the same issue, it is fixed in beta channel as stated in the cbracken's answer.
Also, in my case I had second Dart SDK (2.12) installed outside Flutter, so the issue appeared to be unresolved.
Make sure you are running dart migrate using dart included in your Flutter SDK Flutter/bin folder.
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