I am using Getx for my state management. So When I Change MaterialApp to GetMaterialApp, the fontFamily switched back to the default.
pubspec.yaml file
flutter:
uses-material-design: true
fonts:
- family: Sen
fonts:
- asset: assets/fonts/Sen-Regular.ttf
weight: 300
- asset: assets/fonts/Sen-Bold.ttf
weight: 700
and I have saved Sen.ttf files in the assets/fonts folder
main.dart
Widget build(BuildContext context) {
return GetMaterialApp(
theme: ThemeData(
colorScheme: ColorScheme.fromSwatch().copyWith(
primary: kPrimaryColor,
secondary: kSecondaryColor,
),
fontFamily: "Sen"
)
debugShowCheckedModeBanner: false,
home: const MainScreen(),
);
}
If I switch back to MaterialApp font will work fine.
Any help will be appreciated, Thank You.