19

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

Vinayak Sutar
  • 305
  • 2
  • 10

6 Answers6

15

After I upgraded to Flutter 3.3.0 this error appearing to me

After some searching I resolved it by run upgrade for packages in my project

flutter pub upgrade 

then

flutter clean 

flutter pub get
Ahmad Darwesh
  • 553
  • 4
  • 12
13

Please try it out by upgrading the dependency flutter pub upgrade fwfh_text_style

SHYAM
  • 195
  • 1
  • 4
1

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 = [];

Aslan Demir
  • 54
  • 1
  • 5
1

Try to add fwfh_text_style this plugin in your project if not added. It works for me.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – mohammad mobasher Oct 20 '22 at 06:29
0

I tried flutter upgrade and then flutter clean but it didn't work for me.

I then run this command flutter pub outdated and it worked good.

Shady Boshra
  • 2,521
  • 3
  • 23
  • 35
0

I had to run rm -rf ~/.pub-cache and then flutter pub get ‍♂️

David Chopin
  • 2,780
  • 2
  • 19
  • 40