I’m working on a Flutter app and have configured custom fonts in my pubspec.yaml file. While the fonts appear to work correctly when I apply them explicitly to each widget, they do not seem to be applied globally across the app.
Here’s the relevant part of my pubspec.yaml where I define the custom fonts:
pubspec.yaml (Font Configuration):
fonts:
- family: Cairo
fonts:
- asset: assets/fonts/Cairo-VariableFont_slnt,wght.ttf
weight: 700
main.dart
MaterialApp(
theme: ThemeData(
fontFamily: 'Cairo',
),
darkTheme: ThemeData.dark(),
debugShowCheckedModeBanner: false,
home: Otp(),
i tried to make a custom fontbut it dosent work