How to resolve 'FwfhTextStyle' error in Flutter?
Asked Answered
S

6

20

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

Spearman answered 23/7, 2022 at 6:54 Comment(0)
E
15

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

Erfurt answered 2/10, 2022 at 15:12 Comment(0)
P
13

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
Procrustes answered 7/9, 2022 at 6:46 Comment(1)
This error was occurring because of a "Better Player". I removed it.Spearman
W
2

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

Westland answered 20/10, 2022 at 2:29 Comment(2)
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.Hughhughes
This solved it for me. As a reference for others: I was using BetterPlayer library, which is largely abandoned atm. The problem came from its dependencies. Adding the library mentioned above solved it.Open
D
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 = [];

Dysphasia answered 23/7, 2022 at 6:58 Comment(0)
C
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.

Crotchety answered 13/10, 2022 at 18:8 Comment(0)
T
0

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

Tapping answered 7/3, 2023 at 22:17 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.