I have language selection settings in my app. On the basis of language selection English or Arabic , I want to use different font family. I did it inside MaterialApp() but it will not achieve my target.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'OnlyTick',
theme: ThemeData(
primarySwatch: Colors.indigo,
buttonColor: Colors.indigo,
iconTheme: IconThemeData(color: Colors.indigo),
accentIconTheme: IconThemeData(color: Colors.indigoAccent),
fontFamily: appLang == 'English'?'Proxima':'DroidKufi',
),
debugShowCheckedModeBanner: false,
home: SplashScreenPage(),
localizationsDelegates: [
// const TranslationsDelegate(), //TODO: will create it later, refer https://www.didierboelens.com/2018/04/internationalization---make-an-flutter-application-multi-lingual/
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
],
supportedLocales: [
const Locale('en', ''),
const Locale('ar', ''),
],
// setHome(),
routes: routes,
);
}