shubham-gupta-16 / flutter_ecommerce_demo

A basic responsive ecommerce project based on Flutter 3.

Home Page:https://shubham-gupta-16.github.io/flutter_ecommerce_demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error compiling

leehongfay opened this issue · comments

Please choose one (To quit, press "q/Q"): 1
Using hardware rendering with device sdk gphone64 arm64. If you notice graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
lib/ui/products/pages/products_page.dart:34:23: Error: No named parameter with the name 'badgeColor'.
badgeColor: Colors.white,
^^^^^^^^^^
/opt/homebrew/Caskroom/flutter/3.7.0/flutter/packages/flutter/lib/src/material/badge.dart:29:9: Context: Found this candidate, but the arguments don't match.
const Badge({
^^^^^
Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

  • Where:
    Script '/opt/homebrew/Caskroom/flutter/3.7.0/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1151

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

Process 'command '/opt/homebrew/Caskroom/flutter/3.7.0/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.

BUILD FAILED in 2s
Running Gradle task 'assembleDebug'... 2,860ms
Exception: Gradle task assembleDebug failed with exit code 1

@leehongfay In Version 3.7.0, Flutter added a few new Widgets. Badge is one of them. Ref: https://medium.com/flutter/whats-new-in-flutter-3-7-38cbea71133c

I did this project on Flutter 3.0.5. At that time, I used badges package with version 2.0.3. Now things are charged.

To solve this error, there are few options:

  1. Use any Flutter version below 3.0.7 (Quick Fix)
  2. Remove badges package and use Flutter's Badge Widget.
  3. Update badges package version, 3.0.2, and make relevant changes in import.

I will fix the code to support Flutter version 3.0.7 within a few days. Or you are also welcome to contribute to this project.

Import fixed for badges package. Also, fixed Dio version which was causing security issues.