I created and ran Flutter
projects. but today, while I'm creating new Flutter
projects. I'm getting this kind of error when doing flutter run
, I updated my flutter with the latest version. What went wrong with this
flutter 3.13.9 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d211f42860 (2 weeks ago) • 2023-10-25 13:42:25 -0700
Engine • revision 0545f8705d
Tools • Dart 3.1.5 • DevTools 2.25.0
I created an issue Flutter on GitHub - issue link
the error I'm getting,
Checking for wireless devices...
[1]: macOS (macos)
[2]: Chrome (chrome)
Please choose one (or "q" to quit): 2
Launching lib/main.dart on Chrome in debug mode...
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:56:3: Error: Getters, setters and methods can't be declared to be
'const'.
Try removing the 'const' keyword.
const CounterPagePlaceholder({
^^^^^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:54:7: Error: The non-abstract class 'Placeholder' is missing
implementations for these members:
- Placeholder.CounterPagePlaceholder
Try to either
- provide an implementation,
- inherit an implementation from a superclass or mixin,
- mark the class as abstract, or
- provide a 'noSuchMethod' implementation.
class Placeholder extends StatelessWidget {
^^^^^^^^^^^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:56:9: Context: 'Placeholder.CounterPagePlaceholder' is defined here.
const CounterPagePlaceholder({
^^^^^^^^^^^^^^^^^^^^^^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/image.dart:1238:13: Error: No named parameter with the name 'color'.
color: Color(0xCF8D021F),
^^^^^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:54:7: Context: The class 'Placeholder' has a constructor that takes
no arguments.
class Placeholder extends StatelessWidget {
^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:57:5: Error: Super-initializer formal parameters can only be used in
generative constructors.
Try removing 'super.'.
super.key,
^^^^^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:58:5: Error: Field formal parameters can only be used in a
constructor.
Try removing 'this.'.
this.color = const Color(0xFF455A64), // Blue Grey 700
^^^^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:59:5: Error: Field formal parameters can only be used in a
constructor.
Try removing 'this.'.
this.strokeWidth = 2.0,
^^^^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:60:5: Error: Field formal parameters can only be used in a
constructor.
Try removing 'this.'.
this.fallbackWidth = 400.0,
^^^^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:61:5: Error: Field formal parameters can only be used in a
constructor.
Try removing 'this.'.
this.fallbackHeight = 400.0,
^^^^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:62:5: Error: Field formal parameters can only be used in a
constructor.
Try removing 'this.'.
this.child
^^^^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:66:15: Error: Final field 'color' is not initialized.
Try to initialize the field in the declaration or in every constructor.
final Color color;
^^^^^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:69:16: Error: Final field 'strokeWidth' is not initialized.
Try to initialize the field in the declaration or in every constructor.
final double strokeWidth;
^^^^^^^^^^^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:77:16: Error: Final field 'fallbackWidth' is not initialized.
Try to initialize the field in the declaration or in every constructor.
final double fallbackWidth;
^^^^^^^^^^^^^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:85:16: Error: Final field 'fallbackHeight' is not initialized.
Try to initialize the field in the declaration or in every constructor.
final double fallbackHeight;
^^^^^^^^^^^^^^
../../../../../Developer/flutter/packages/flutter/lib/src/widgets/placeholder.dart:90:17: Error: Final field 'child' is not initialized.
Try to initialize the field in the declaration or in every constructor.
final Widget? child;
^^^^^
Waiting for connection from debug service on Chrome... 10.6s
Failed to compile application.