Skip to content

Commit

Permalink
Test custom textTheme
Browse files Browse the repository at this point in the history
  • Loading branch information
sukso96100 committed Sep 4, 2023
1 parent f9e40cf commit 6a68089
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,25 @@ class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {

return YaruTheme(
data: const YaruThemeData(
variant: YaruVariant.orange, useMaterial3: true),
builder: (context, yaru, child) {
return DefaultTextStyle(
style: const TextStyle(
fontFamily: "Ubuntu", fontFamilyFallback: ["NotoSansCJK"]),
child: MaterialApp(
theme: yaru.theme,
ThemeData customTheme = yaru.theme!.copyWith(
textTheme: yaru.theme!.textTheme.apply(
fontFamily: 'Ubuntu',
fontFamilyFallback: ['NotoSansCJK']
),
primaryTextTheme: yaru.theme!.textTheme.apply(
fontFamily: 'Ubuntu',
fontFamilyFallback: ['NotoSansCJK']
),
);
return MaterialApp(
theme: customTheme,
darkTheme: yaru.darkTheme,
home: const KioskMainPage()));
home: const KioskMainPage());
});
}
}
Expand Down

0 comments on commit 6a68089

Please sign in to comment.