feat: dynamic fetch google fonts
This commit is contained in:
parent
9e2850558d
commit
0e952a6ef7
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -6,7 +6,6 @@ import 'package:git_touch/models/code.dart';
|
|||
import 'package:git_touch/models/notification.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:git_touch/utils/utils.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:sentry_flutter/sentry_flutter.dart';
|
||||
|
||||
|
@ -18,8 +17,6 @@ void main() async {
|
|||
},
|
||||
// Init your App.
|
||||
appRunner: () async {
|
||||
GoogleFonts.config.allowRuntimeFetching = false;
|
||||
|
||||
final notificationModel = NotificationModel();
|
||||
final themeModel = ThemeModel();
|
||||
final authModel = AuthModel();
|
||||
|
|
|
@ -8,21 +8,15 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||
class CodeModel with ChangeNotifier {
|
||||
static var themes = themeMap.keys.toList();
|
||||
static const fontSizes = [12, 13, 14, 15, 16, 17, 18, 19, 20];
|
||||
static const fontFamilies = [
|
||||
static final fontFamilies = [
|
||||
'System',
|
||||
'JetBrains Mono',
|
||||
'Fira Code',
|
||||
'Inconsolata',
|
||||
'PT Mono',
|
||||
'Source Code Pro',
|
||||
'Ubuntu Mono',
|
||||
// 'Cascadia Code', // TODO: https://github.com/google/fonts/issues/2179
|
||||
...GoogleFonts.asMap().keys,
|
||||
];
|
||||
|
||||
String _theme = 'vs';
|
||||
String _themeDark = 'vs2015';
|
||||
int _fontSize = 14;
|
||||
String _fontFamily = 'JetBrains Mono';
|
||||
String _fontFamily = 'System';
|
||||
|
||||
String get theme => _theme;
|
||||
String get themeDark => _themeDark;
|
||||
|
|
|
@ -134,7 +134,6 @@ flutter:
|
|||
# see https://flutter.dev/custom-fonts/#from-packages
|
||||
assets:
|
||||
- images/
|
||||
- google_fonts/
|
||||
|
||||
flutter_intl:
|
||||
enabled: true
|
||||
|
|
Loading…
Reference in New Issue