Error: The method 'Style.textStyle' has fewer positional arguments than

Viewed 26

Error is

The method 'Style.textStyle' has fewer positional arguments than those of overridden method 'StyleHook.textStyle'. TextStyle textStyle(Color color)

Here is the problem @override TextStyle textStyle(Color color) { return TextStyle(color: color);

THE SCREENSHOT

class Style extends StyleHook {
  @override
  double get activeIconSize => 28;

  @override
  double get activeIconMargin => 10;

  @override
  double get iconSize => 20;

  @override
  TextStyle textStyle(Color color) {
    return TextStyle(color: color);
  }

}
1 Answers

Your error says exactly what's wrong. StyleHook expects a Color and a String? as argument for the textStyle function. You extend StyleHook and override that function but are not providing the same arguments for it. It needs to look like

TextStyle textStyle(Color color, String? s) {
Related