Hello Guys How are you all? Hope You all are fine. Today I just updated my flutter to its latest version flutter 2.5 and just after that I just compile my code and now I am facing following error in my terminal Error: The argument type ‘PointerEvent’ can’t be assigned to the parameter type ‘PointerDownEvent’ in a flutter. So today Here I come with all possible solutions for this error.
We are providing you all possible solutions to solve this error. let’s start this article without wasting your time.
How The argument type ‘PointerEvent’ can’t be assigned to the parameter type ‘PointerDownEvent’ Error Occurs ?
Today I just updated my flutter to its latest version flutter 2.5 and just after that I just compile my code and now I am facing following error in my terminal.
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
../plugins/flutter/.pub-cache/hosted/pub.dartlang.org/photo_view-0.11.1/lib/src/core/photo_view_gesture_detector.dart:106:29: Error: The argument type 'PointerEvent' can't be assigned to the parameter type 'PointerDownEvent'.
- 'PointerEvent' is from 'package:flutter/src/gestures/events.dart' ('../plugins/flutter/packages/flutter/lib/src/gestures/events.dart').
- 'PointerDownEvent' is from 'package:flutter/src/gestures/events.dart' ('../plugins/flutter/packages/flutter/lib/src/gestures/events.dart').
super.addAllowedPointer(event);
How to Solve The argument type ‘PointerEvent’ can’t be assigned to the parameter type ‘PointerDownEvent’ Error?
- How to Solve The argument type 'PointerEvent' can't be assigned to the parameter type 'PointerDownEvent' Error?
to Solve The argument type 'PointerEvent' can't be assigned to the parameter type 'PointerDownEvent' Error As You Update Flutter to its latest version flutter 2.5 There was an API change in new version and that's why several packages must update accordingly. As I can see in your error log photo_view package is responsible for this error so that just try to update package version in your pubspec.yaml file. Here is Latest version.
- The argument type 'PointerEvent' can't be assigned to the parameter type 'PointerDownEvent'
to Solve The argument type 'PointerEvent' can't be assigned to the parameter type 'PointerDownEvent' Error As You Update Flutter to its latest version flutter 2.5 There was an API change in new version and that's why several packages must update accordingly. As I can see in your error log photo_view package is responsible for this error so that just try to update package version in your pubspec.yaml file. Here is Latest version.
Solution 1: update package version in your pubspec.yaml file
As You Update Flutter to its latest version flutter 2.5 There was an API change in new version and that’s why several packages must update accordingly.
As I can see in your error log photo_view package is responsible for this error so that just try to update package version in your pubspec.yaml file. Here is Latest version.
photo_view: ^0.12.0
Solution 2: Add a dependency override to your pubspec.yaml file
Add a dependency override to your pubspec.yaml
, this will effectively override the version of the package being used
dependency_overrides:
photo_view: ^0.12.0
Solution 3: try to update the one that uses
Here You can also run flutter pub deps
to list the installed packages and its dependencies and try to update the one that uses photo_view
or any other dependencies that may cause error.
Summery
So, It’s All About This flutter 2.5 error. I hope this tutorial helps you to Solve your error. Please Comment Below if You stucks anywhere with my code. And please comment below on which solution worked for you. Thank You.
Leave a Reply