feat: use defined font

This commit is contained in:
Simon Ding
2024-07-17 20:07:40 +08:00
parent bae9c3a1e1
commit 9f62b5583f
5 changed files with 13 additions and 4 deletions

View File

Binary file not shown.

BIN
ui/fonts/Roboto.ttf Normal file
View File

Binary file not shown.

View File

@@ -167,6 +167,8 @@ class MyApp extends StatelessWidget {
// labelMedium: TextStyle(fontFamilyFallback: ["PingFang SC", "Heiti SC"]), // labelMedium: TextStyle(fontFamilyFallback: ["PingFang SC", "Heiti SC"]),
// labelSmall: TextStyle(fontFamilyFallback: ["PingFang SC", "Heiti SC"]), // labelSmall: TextStyle(fontFamilyFallback: ["PingFang SC", "Heiti SC"]),
// ), // ),
fontFamily: "NotoSansSC",
fontFamilyFallback: const ["PingFang SC", "Heiti SC"],
colorScheme: ColorScheme.fromSeed( colorScheme: ColorScheme.fromSeed(
seedColor: Colors.blue, brightness: Brightness.dark), seedColor: Colors.blue, brightness: Brightness.dark),

View File

@@ -21,7 +21,7 @@ var storageSettingProvider =
AsyncNotifierProvider.autoDispose<StorageSettingData, List<Storage>>( AsyncNotifierProvider.autoDispose<StorageSettingData, List<Storage>>(
StorageSettingData.new); StorageSettingData.new);
class EditSettingData extends FamilyAsyncNotifier<String, String> { class EditSettingData extends AutoDisposeFamilyAsyncNotifier<String, String> {
String? key; String? key;
@override @override
@@ -53,7 +53,7 @@ class EditSettingData extends FamilyAsyncNotifier<String, String> {
} }
} }
class IndexerSetting extends AsyncNotifier<List<Indexer>> { class IndexerSetting extends AutoDisposeAsyncNotifier<List<Indexer>> {
@override @override
FutureOr<List<Indexer>> build() async { FutureOr<List<Indexer>> build() async {
final dio = await APIs.getDio(); final dio = await APIs.getDio();
@@ -121,7 +121,7 @@ class Indexer {
} }
} }
class DownloadClientSetting extends AsyncNotifier<List<DownloadClient>> { class DownloadClientSetting extends AutoDisposeAsyncNotifier<List<DownloadClient>> {
@override @override
FutureOr<List<DownloadClient>> build() async { FutureOr<List<DownloadClient>> build() async {
final dio = await APIs.getDio(); final dio = await APIs.getDio();
@@ -208,7 +208,7 @@ class DownloadClient {
} }
} }
class StorageSettingData extends AsyncNotifier<List<Storage>> { class StorageSettingData extends AutoDisposeAsyncNotifier<List<Storage>> {
@override @override
FutureOr<List<Storage>> build() async { FutureOr<List<Storage>> build() async {
final dio = await APIs.getDio(); final dio = await APIs.getDio();

View File

@@ -96,3 +96,10 @@ flutter:
# #
# For details regarding fonts from package dependencies, # For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages # see https://flutter.dev/custom-fonts/#from-packages
fonts:
- family: Roboto
fonts:
- asset: fonts/Roboto.ttf
- family: NotoSansSC
fonts:
- asset: fonts/NotoSansSC-Regular.ttf