'I got Too few positional arguments error flutter and I can't understand why?

Hi everyone my app was work will before two to days today when I run my app it gives me that following error : /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/modal_bottom_sheet-0.2.0+1/lib/src/bottom_sheet.dart:295:43: Error: Too few positional arguments: 1 required, 0 given. _velocityTracker = VelocityTracker(); ^ /C:/src/flutter/packages/flutter/lib/src/gestures/velocity_tracker.dart:152:3: Context: Found this candidate, but the arguments don't match. VelocityTracker(this.kind); ^^^^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/animations-1.1.1/lib/src/fade_scale_transition.dart:148:29: Error: 'decelerateEasing' is imported from both 'package:flutter/src/material/curves.dart' and 'package:animations/src/utils/curves.dart'. ).chain(CurveTween(curve: decelerateEasing)); ^^^^^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/animations-1.1.1/lib/src/shared_axis_transition.dart:315:12: Error: 'decelerateEasing' is imported from both 'package:flutter/src/material/curves.dart' and 'package:animations/src/utils/curves.dart'. curve: decelerateEasing, ^^^^^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/animations-1.1.1/lib/src/shared_axis_transition.dart:321:29: Error: 'standardEasing' is imported from both 'package:flutter/src/material/curves.dart' and 'package:animations/src/utils/curves.dart'. ).chain(CurveTween(curve: standardEasing)); ^^^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/animations-1.1.1/lib/src/shared_axis_transition.dart:326:29: Error: 'standardEasing' is imported from both 'package:flutter/src/material/curves.dart' and 'package:animations/src/utils/curves.dart'. ).chain(CurveTween(curve: standardEasing)); ^^^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/animations-1.1.1/lib/src/shared_axis_transition.dart:335:35: Error: 'standardEasing' is imported from both 'package:flutter/src/material/curves.dart' and 'package:animations/src/utils/curves.dart'. ).chain(CurveTween(curve: standardEasing)); ^^^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/animations-1.1.1/lib/src/shared_axis_transition.dart:355:35: Error: 'standardEasing' is imported from both 'package:flutter/src/material/curves.dart' and 'package:animations/src/utils/curves.dart'. ).chain(CurveTween(curve: standardEasing)); ^^^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/animations-1.1.1/lib/src/shared_axis_transition.dart:402:12: Error: 'accelerateEasing' is imported from both 'package:flutter/src/material/curves.dart' and 'package:animations/src/utils/curves.dart'. curve: accelerateEasing, ^^^^^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/animations-1.1.1/lib/src/shared_axis_transition.dart:408:29: Error: 'standardEasing' is imported from both 'package:flutter/src/material/curves.dart' and 'package:animations/src/utils/curves.dart'. ).chain(CurveTween(curve: standardEasing)); ^^^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/animations-1.1.1/lib/src/shared_axis_transition.dart:413:29: Error: 'standardEasing' is imported from both 'package:flutter/src/material/curves.dart' and 'package:animations/src/utils/curves.dart'. ).chain(CurveTween(curve: standardEasing)); ^^^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/animations-1.1.1/lib/src/shared_axis_transition.dart:422:35: Error: 'standardEasing' is imported from both 'package:flutter/src/material/curves.dart' and 'package:animations/src/utils/curves.dart'. ).chain(CurveTween(curve: standardEasing)); ^^^^^^^^^^^^^^ /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/animations-1.1.1/lib/src/shared_axis_transition.dart:445:35: Error: 'standardEasing' is imported from both 'package:flutter/src/material/curves.dart' and 'package:animations/src/utils/curves.dart'. ).chain(CurveTween(curve: standardEasing)); ^^^^^^^^^^^^^^

FAILURE: Build failed with an exception.

  • Where: Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 904

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

Process 'command 'C:\src\flutter\bin\flutter.bat'' 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 27s Exception: Gradle task assembleDebug failed with exit code 1

I don't understand why this error is appear and how I fixed It . any suggestions will appreciated



Solution 1:[1]

I had a similiar error after I updated my flutter version to 3.0.0. I updated the modal_bottom_sheet package in the pubspec.yaml file from 2.0.0 to 2.0.1. After this it worked for me also with flutter version 3.0.0.

modal_bottom_sheet: ^2.0.1

Don't forget to run pub get after the upgrade to the new version.

Solution 2:[2]

I was missing this in my pubspec.yaml file, so i just added:

modal_bottom_sheet: ^2.0.1

ran on terminal after:

flutter pub get

and we good to go...

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Andrei Ross