0

flutter code

errors

pubspec.yaml

font file

In flutter, I have a problem when using variable fonts: The function 'FontVariation' isn't defined. Try importing the library that defines 'FontVariation', correcting the name to the name of an existing function, or defining a function named 'FontVariation'. Could it be that I didn't import something?

style: TextStyle(
    fontVariations: const <FontVariation>[
        FontVariation("wght", 500),
    ],
),
WWill
  • 3
  • 2

1 Answers1

0

Make sure that you've imported the dart ui package.

import 'dart:ui';