Skip to content

Commit

Permalink
Feat: Set app-wide font
Browse files Browse the repository at this point in the history
  • Loading branch information
songbirdzz committed May 25, 2024
1 parent 65fbeb0 commit 84dc2ad
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 4 deletions.
Binary file added assets/fonts/NotoSerifHK-Black.ttf
Binary file not shown.
Binary file added assets/fonts/NotoSerifHK-Bold.ttf
Binary file not shown.
Binary file added assets/fonts/NotoSerifHK-ExtraBold.ttf
Binary file not shown.
Binary file added assets/fonts/NotoSerifHK-ExtraLight.ttf
Binary file not shown.
Binary file added assets/fonts/NotoSerifHK-Light.ttf
Binary file not shown.
Binary file added assets/fonts/NotoSerifHK-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/NotoSerifHK-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/NotoSerifHK-SemiBold.ttf
Binary file not shown.
Binary file added assets/fonts/NotoSerifHK-VariableFont_wght.ttf
Binary file not shown.
7 changes: 5 additions & 2 deletions lib/app_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:io';
import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:knkpanime/navigation.dart';
import 'package:knkpanime/utils/utils.dart';
import 'package:flutter_displaymode/flutter_displaymode.dart';
Expand Down Expand Up @@ -29,8 +30,10 @@ class _AppWidgetState extends State<AppWidget> {
} catch (_) {}
}
return AdaptiveTheme(
light: ThemeData.light(useMaterial3: true),
dark: ThemeData.dark(useMaterial3: true),
light: ThemeData.light(useMaterial3: true)
.copyWith(textTheme: GoogleFonts.notoSerifHkTextTheme()),
dark: ThemeData.dark(useMaterial3: true)
.copyWith(textTheme: GoogleFonts.notoSerifHkTextTheme()),
initial: AdaptiveThemeMode.light,
builder: (theme, darkTheme) => MaterialApp.router(
title: "KNKP Anime",
Expand Down
12 changes: 10 additions & 2 deletions lib/navigation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ class _SideMenuState extends State<SideMenu> {
var listContent = <Widget>[];
listContent
.addAll(routes.where((e) => !(e['bottom'] as bool)).map((e) => ListTile(
title: Text(e['name'] as String),
title: Text(e['name'] as String,
style: Theme.of(context)
.textTheme
.bodyLarge
?.copyWith(color: Colors.white)),
leading: e['icon'] as Widget,
onTap: () {
_onItemTapped(routes.indexOf(e));
Expand All @@ -109,7 +113,11 @@ class _SideMenuState extends State<SideMenu> {
listContent.add(const Spacer());
listContent
.addAll(routes.where((e) => e['bottom'] as bool).map((e) => ListTile(
title: Text(e['name'] as String),
title: Text(e['name'] as String,
style: Theme.of(context)
.textTheme
.bodyLarge
?.copyWith(color: Colors.white)),
leading: e['icon'] as Widget,
onTap: () {
_onItemTapped(routes.indexOf(e));
Expand Down
8 changes: 8 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.2"
google_fonts:
dependency: "direct main"
description:
name: google_fonts
sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82
url: "https://pub.dev"
source: hosted
version: "6.2.1"
graphs:
dependency: transitive
description:
Expand Down
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ dependencies:
media_kit: ^1.1.10
media_kit_video: ^1.2.4
media_kit_libs_video: ^1.0.4
google_fonts: ^6.2.1
flutter_inappwebview:
git:
url: https://github.com/songbirdzz/flutter_inappwebview
Expand Down Expand Up @@ -124,6 +125,7 @@ flutter:
assets:
- assets/
- assets/images/
- assets/fonts/

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
Expand Down

0 comments on commit 84dc2ad

Please sign in to comment.