Flutter Error: No named parameter with the name 'keyboardDismissBehavior'

Viewed 1154

The flutter project ran well on my android device before i ran flutter grade command. And then the project just cant run anyway without any code change. Here is the error message:

Launching lib/main.dart on RMX1971 in debug mode... Running Gradle task 'assembleDebug'... ../../env/flutter/.pub-cache/hosted/pub.flutter-io.cn/pull_to_refresh-1.6.4/lib/src/smart_refresher.dart:434:9: Error: No named parameter with the name 'keyboardDismissBehavior'. keyboardDismissBehavior: ^^^^^^^^^^^^^^^^^^^^^^^ ../../env/flutter/packages/flutter/lib/src/widgets/scroll_view.dart:588:9: Context: Found this candidate, but the arguments don't match. const CustomScrollView({ ^^^^^^^^^^^^^^^^

FAILURE: Build failed with an exception.

  • Where: Script '/Users/lgk/env/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 907

  • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command '/Users/lgk/env/flutter/bin/flutter'' finished with non-zero exit value 1

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 14s Exception: Gradle task assembleDebug failed with exit code 1

1 Answers

This is actually a compatibility issue between pull_to_refresh plugin and the current version of Flutter during this time. There are some bugs related to this and most of the solutions were found on the thread:

To summarized the solution from this thread:

  1. How to solve Error: No named parameter with the name 'keyboardDismissBehavior' ?
    to solve Error: No named parameter with the name 'keyboardDismissBehavior' This error is caused due to pull_to_refresh plugin that you are using in your flutter app is not compatible with the current version of flutter. The solution is just downgraded your plugin version.

  2. Error: No named parameter with the name 'keyboardDismissBehavior
    to solve Error: No named parameter with the name 'keyboardDismissBehavior' This error is caused due to pull_to_refresh plugin that you are using in your flutter app is not compatible with the current version of flutter. The solution is just downgraded your plugin version.

Solution 1

This error is cause due to pull_to_refresh plugin that you are using in your flutter app that is not compatible with the current version of flutter. The solution is just to downgrade your plugin version. Just Follow below step to solve this error.

  1. Edit file pubspec.yaml
  2. Change This Line pull_to_refresh ^1.6.4 or pull_to_refresh ^1.6.3
  3. Replace with pull_to_refresh 1.6.3
  4. run flutter clean
  5. flutter run

Solution 2

pull_to_refresh plugin is not compatible with the current version of flutter.

Related