add fonts
This commit is contained in:
BIN
assets/fonts/HYQiHei-60S.ttf
Normal file
BIN
assets/fonts/HYQiHei-60S.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/HYQiHei-80S.ttf
Normal file
BIN
assets/fonts/HYQiHei-80S.ttf
Normal file
Binary file not shown.
BIN
assets/fonts/VWHead-Bold.otf
Normal file
BIN
assets/fonts/VWHead-Bold.otf
Normal file
Binary file not shown.
BIN
assets/fonts/VWHead-Regular.otf
Normal file
BIN
assets/fonts/VWHead-Regular.otf
Normal file
Binary file not shown.
BIN
assets/fonts/iconfont.ttf
Normal file
BIN
assets/fonts/iconfont.ttf
Normal file
Binary file not shown.
@@ -1,10 +1,17 @@
|
||||
import 'package:basic_intl/intl.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppTheme {
|
||||
|
||||
static String _getLocaleAwareFontFamily() {
|
||||
final isChinese = Intl.getCurrentLocale().startsWith('zh');
|
||||
return isChinese ? 'HYQiHei_Regular' : 'VWHead_Regular';
|
||||
}
|
||||
|
||||
static final ThemeData lightTheme = ThemeData(
|
||||
primaryColor: const Color(0xFF6C63FF),
|
||||
scaffoldBackgroundColor: Colors.white,
|
||||
fontFamily: 'Roboto',
|
||||
fontFamily: _getLocaleAwareFontFamily(),
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: const Color(0xFF6C63FF),
|
||||
brightness: Brightness.light,
|
||||
@@ -14,7 +21,7 @@ class AppTheme {
|
||||
static final ThemeData darkTheme = ThemeData(
|
||||
primaryColor: const Color(0xFF6C63FF),
|
||||
scaffoldBackgroundColor: const Color(0xFF121212),
|
||||
fontFamily: 'Roboto',
|
||||
fontFamily: _getLocaleAwareFontFamily(),
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: const Color(0xFF6C63FF),
|
||||
brightness: Brightness.dark,
|
||||
|
||||
13
pubspec.yaml
13
pubspec.yaml
@@ -27,3 +27,16 @@ flutter:
|
||||
uses-material-design: true
|
||||
assets:
|
||||
- assets/images/
|
||||
fonts:
|
||||
- family: VWHead_Bold
|
||||
fonts:
|
||||
- asset: assets/fonts/VWHead-Bold.otf
|
||||
- family: VWHead_Regular
|
||||
fonts:
|
||||
- asset: assets/fonts/VWHead-Regular.otf
|
||||
- family: HYQiHei_Bold
|
||||
fonts:
|
||||
- asset: assets/fonts/HYQiHei-80S.ttf
|
||||
- family: HYQiHei_Regular
|
||||
fonts:
|
||||
- asset: assets/fonts/HYQiHei-60S.ttf
|
||||
Reference in New Issue
Block a user