My app is not building because of this error and I am not able to understand the error. I tried ‘flutter upgrade’ and ‘flutter get’ but nothing was helpful.
Launching lib/main.dart on SM A127F in debug mode...
Running Gradle task 'assembleDebug'...
../../flutter/.pub-cache/hosted/pub.dartlang.org/fwfh_text_style-2.7.3+2/lib/fwfh_text_style.dart:11:7: Error: The non-abstract class 'FwfhTextStyle' is missing implementations for these members:
- TextStyle.fontVariations
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 FwfhTextStyle extends _TextStyleProxy {
^^^^^^^^^^^^^
../../flutter/packages/flutter/lib/src/painting/text_style.dart:789:33: Context: 'TextStyle.fontVariations' is defined here.
final List<ui.FontVariation>? fontVariations;
^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script '/home/vrs/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1159
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/home/vrs/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 16s
Exception: Gradle task assembleDebug failed with exit code 1
6
Answers
I think this is about the definition of
final List<ui.FontVariation>? fontVariations;
Whether it’s defined at the last indexes or it’s not defined at all.
I’d do something like that to prevent an error.
List<ui.FontVariation> fontVariations = [];
After I upgraded to Flutter
3.3.0
this error appearing to meAfter some searching I resolved it by run upgrade for packages in my project
then
Please try it out by upgrading the dependency
flutter pub upgrade fwfh_text_style
I tried
flutter upgrade
and thenflutter clean
but it didn’t work for me.I then run this command
flutter pub outdated
and it worked good.Try to add fwfh_text_style this plugin in your project if not added. It works for me.
I had to run
rm -rf ~/.pub-cache
and thenflutter pub get
🤷🏻♂️