diff --git a/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Black.ttf b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Black.ttf new file mode 100644 index 00000000..074b327d Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Black.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Bold.ttf b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Bold.ttf new file mode 100644 index 00000000..a18a412a Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Bold.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Handjet/Handjet-ExtraBold.ttf b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-ExtraBold.ttf new file mode 100644 index 00000000..59386d21 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-ExtraBold.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Handjet/Handjet-ExtraLight.ttf b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-ExtraLight.ttf new file mode 100644 index 00000000..feda0226 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-ExtraLight.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Light.ttf b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Light.ttf new file mode 100644 index 00000000..f5e9757f Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Light.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Medium.ttf b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Medium.ttf new file mode 100644 index 00000000..33a7cf49 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Medium.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Regular.ttf b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Regular.ttf new file mode 100644 index 00000000..c7033870 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Regular.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Handjet/Handjet-SemiBold.ttf b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-SemiBold.ttf new file mode 100644 index 00000000..399b0f36 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-SemiBold.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Thin.ttf b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Thin.ttf new file mode 100644 index 00000000..6dc16db4 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Handjet/Handjet-Thin.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Black.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Black.ttf new file mode 100644 index 00000000..6f908eb1 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Black.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-BlackItalic.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-BlackItalic.ttf new file mode 100644 index 00000000..54ea1c8e Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-BlackItalic.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Bold.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Bold.ttf new file mode 100644 index 00000000..562f0673 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Bold.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-BoldItalic.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-BoldItalic.ttf new file mode 100644 index 00000000..71d9ac0a Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-BoldItalic.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-ExtraBold.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-ExtraBold.ttf new file mode 100644 index 00000000..0baac258 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-ExtraBold.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-ExtraBoldItalic.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-ExtraBoldItalic.ttf new file mode 100644 index 00000000..5584507c Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-ExtraBoldItalic.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-ExtraLight.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-ExtraLight.ttf new file mode 100644 index 00000000..83a1f438 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-ExtraLight.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-ExtraLightItalic.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-ExtraLightItalic.ttf new file mode 100644 index 00000000..edd1dfaf Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-ExtraLightItalic.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Italic.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Italic.ttf new file mode 100644 index 00000000..979abc64 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Italic.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Light.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Light.ttf new file mode 100644 index 00000000..34d0f897 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Light.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-LightItalic.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-LightItalic.ttf new file mode 100644 index 00000000..f3c1cfb6 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-LightItalic.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Medium.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Medium.ttf new file mode 100644 index 00000000..386a4184 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Medium.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-MediumItalic.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-MediumItalic.ttf new file mode 100644 index 00000000..803f5cb2 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-MediumItalic.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Regular.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Regular.ttf new file mode 100644 index 00000000..3955d044 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-Regular.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-SemiBold.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-SemiBold.ttf new file mode 100644 index 00000000..b2050f38 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-SemiBold.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-SemiBoldItalic.ttf b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-SemiBoldItalic.ttf new file mode 100644 index 00000000..f39baaa6 Binary files /dev/null and b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/LisuBosa-SemiBoldItalic.ttf differ diff --git a/examples/mirai_gallery/assets/fonts/Lisu_Bosa/OFL.txt b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/OFL.txt new file mode 100644 index 00000000..94d3a462 --- /dev/null +++ b/examples/mirai_gallery/assets/fonts/Lisu_Bosa/OFL.txt @@ -0,0 +1,98 @@ +Copyright (c) 1998-2019 David Morse (original regular) +with Reserved Font Name "LisuTzimu". +Copyright (c) 2019-2023 SIL International (regular revisions, bold, italic, bold italic) +with Reserved Font Name "Bosa". +Copyright (c) 2014-2019 Adobe (http://www.adobe.com/) (Latin glyphs) +with Reserved Font Name "Source". + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/examples/mirai_gallery/assets/json/example_dark_theme.json b/examples/mirai_gallery/assets/json/example_dark_theme.json index dd0bec30..117ae4c5 100644 --- a/examples/mirai_gallery/assets/json/example_dark_theme.json +++ b/examples/mirai_gallery/assets/json/example_dark_theme.json @@ -1,6 +1,7 @@ { "brightness": "dark", "disabledColor": "#60FFFFFF", + "fontFamily": "Handjet", "colorScheme": { "brightness": "dark", "primary": "#CCBDFA", diff --git a/examples/mirai_gallery/assets/json/example_light_theme.json b/examples/mirai_gallery/assets/json/example_light_theme.json index 48a2ca08..badb60f5 100644 --- a/examples/mirai_gallery/assets/json/example_light_theme.json +++ b/examples/mirai_gallery/assets/json/example_light_theme.json @@ -1,6 +1,7 @@ { "brightness": "light", "disabledColor": "#60FEF7FF", + "fontFamily": "LisuBosa", "colorScheme": { "brightness": "light", "primary": "#6750a4", diff --git a/examples/mirai_gallery/pubspec.lock b/examples/mirai_gallery/pubspec.lock index 5a98c692..348fd210 100644 --- a/examples/mirai_gallery/pubspec.lock +++ b/examples/mirai_gallery/pubspec.lock @@ -189,10 +189,10 @@ packages: dependency: transitive description: name: dio - sha256: "347d56c26d63519552ef9a569f2a593dda99a81fdbdff13c584b7197cfe05059" + sha256: "3866d67f93523161b643187af65f5ac08bc991a5bcdaf41a2d587fe4ccb49993" url: "https://pub.dev" source: hosted - version: "5.1.2" + version: "5.3.0" fake_async: dependency: transitive description: @@ -319,10 +319,10 @@ packages: dependency: "direct main" description: name: json_annotation - sha256: c33da08e136c3df0190bd5bbe51ae1df4a7d96e7954d1d7249fea2968a72d317 + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "4.8.1" json_serializable: dependency: "direct dev" description: @@ -343,10 +343,10 @@ packages: dependency: transitive description: name: logger - sha256: db2ff852ed77090ba9f62d3611e4208a3d11dfa35991a81ae724c113fcb3e3f7 + sha256: "7ad7215c15420a102ec687bb320a7312afd449bac63bfb1c60d9787c27b9767f" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.4.0" logging: dependency: transitive description: @@ -393,7 +393,7 @@ packages: path: "../../packages/mirai" relative: true source: path - version: "0.2.0" + version: "0.4.0" nested: dependency: transitive description: @@ -593,4 +593,4 @@ packages: version: "3.1.1" sdks: dart: ">=3.0.0 <4.0.0" - flutter: ">=1.17.0" \ No newline at end of file + flutter: ">=1.17.0" diff --git a/examples/mirai_gallery/pubspec.yaml b/examples/mirai_gallery/pubspec.yaml index 84e1c6eb..73212fc1 100644 --- a/examples/mirai_gallery/pubspec.yaml +++ b/examples/mirai_gallery/pubspec.yaml @@ -64,3 +64,34 @@ flutter: assets: - assets/images/ - assets/json/ + fonts: + - family: Raleway + fonts: + - asset: assets/fonts/Lisu_Bosa/LisuBosa-Black.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-BlackItalic.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-Bold.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-BoldItalic.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-ExtraBold.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-ExtraBoldItalic.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-ExtraLight.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-ExtraLightItalic.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-Italic.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-Light.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-LightItalic.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-Medium.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-MediumItalic.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-Regular.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-SemiBold.ttf + - asset: assets/fonts/Lisu_Bosa/LisuBosa-SemiBoldItalic.ttf + + - family: Handjet + fonts: + - asset: assets/fonts/Handjet/Handjet-Black.ttf + - asset: assets/fonts/Handjet/Handjet-Bold.ttf + - asset: assets/fonts/Handjet/Handjet-ExtraBold.ttf + - asset: assets/fonts/Handjet/Handjet-ExtraLight.ttf + - asset: assets/fonts/Handjet/Handjet-Light.ttf + - asset: assets/fonts/Handjet/Handjet-Medium.ttf + - asset: assets/fonts/Handjet/Handjet-Regular.ttf + - asset: assets/fonts/Handjet/Handjet-SemiBold.ttf + - asset: assets/fonts/Handjet/Handjet-Thin.ttf diff --git a/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.dart b/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.dart index 2313be38..61d9c1e3 100644 --- a/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.dart +++ b/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.dart @@ -40,6 +40,8 @@ class MiraiTheme with _$MiraiTheme { String? shadowColor, String? splashColor, String? unselectedWidgetColor, + String? fontFamily, + @Default([]) List fontFamilyFallback, MiraiAppBarTheme? appBarTheme, MiraiButtonStyle? elevatedButtonTheme, MiraiButtonStyle? outlinedButtonTheme, @@ -88,6 +90,8 @@ extension MiraiThemeParser on MiraiTheme { shadowColor: shadowColor.toColor, splashColor: splashColor.toColor, unselectedWidgetColor: unselectedWidgetColor.toColor, + fontFamily: fontFamily, + fontFamilyFallback: fontFamilyFallback, primarySwatch: primarySwatch?.parse, appBarTheme: appBarTheme?.parse, elevatedButtonTheme: diff --git a/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.freezed.dart b/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.freezed.dart index e8c35e69..d21855ef 100644 --- a/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.freezed.dart +++ b/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.freezed.dart @@ -46,6 +46,8 @@ mixin _$MiraiTheme { String? get shadowColor => throw _privateConstructorUsedError; String? get splashColor => throw _privateConstructorUsedError; String? get unselectedWidgetColor => throw _privateConstructorUsedError; + String? get fontFamily => throw _privateConstructorUsedError; + List get fontFamilyFallback => throw _privateConstructorUsedError; MiraiAppBarTheme? get appBarTheme => throw _privateConstructorUsedError; MiraiButtonStyle? get elevatedButtonTheme => throw _privateConstructorUsedError; @@ -110,6 +112,8 @@ abstract class $MiraiThemeCopyWith<$Res> { String? shadowColor, String? splashColor, String? unselectedWidgetColor, + String? fontFamily, + List fontFamilyFallback, MiraiAppBarTheme? appBarTheme, MiraiButtonStyle? elevatedButtonTheme, MiraiButtonStyle? outlinedButtonTheme, @@ -187,6 +191,8 @@ class _$MiraiThemeCopyWithImpl<$Res, $Val extends MiraiTheme> Object? shadowColor = freezed, Object? splashColor = freezed, Object? unselectedWidgetColor = freezed, + Object? fontFamily = freezed, + Object? fontFamilyFallback = null, Object? appBarTheme = freezed, Object? elevatedButtonTheme = freezed, Object? outlinedButtonTheme = freezed, @@ -305,6 +311,14 @@ class _$MiraiThemeCopyWithImpl<$Res, $Val extends MiraiTheme> ? _value.unselectedWidgetColor : unselectedWidgetColor // ignore: cast_nullable_to_non_nullable as String?, + fontFamily: freezed == fontFamily + ? _value.fontFamily + : fontFamily // ignore: cast_nullable_to_non_nullable + as String?, + fontFamilyFallback: null == fontFamilyFallback + ? _value.fontFamilyFallback + : fontFamilyFallback // ignore: cast_nullable_to_non_nullable + as List, appBarTheme: freezed == appBarTheme ? _value.appBarTheme : appBarTheme // ignore: cast_nullable_to_non_nullable @@ -645,6 +659,8 @@ abstract class _$$_MiraiThemeCopyWith<$Res> String? shadowColor, String? splashColor, String? unselectedWidgetColor, + String? fontFamily, + List fontFamilyFallback, MiraiAppBarTheme? appBarTheme, MiraiButtonStyle? elevatedButtonTheme, MiraiButtonStyle? outlinedButtonTheme, @@ -739,6 +755,8 @@ class __$$_MiraiThemeCopyWithImpl<$Res> Object? shadowColor = freezed, Object? splashColor = freezed, Object? unselectedWidgetColor = freezed, + Object? fontFamily = freezed, + Object? fontFamilyFallback = null, Object? appBarTheme = freezed, Object? elevatedButtonTheme = freezed, Object? outlinedButtonTheme = freezed, @@ -857,6 +875,14 @@ class __$$_MiraiThemeCopyWithImpl<$Res> ? _value.unselectedWidgetColor : unselectedWidgetColor // ignore: cast_nullable_to_non_nullable as String?, + fontFamily: freezed == fontFamily + ? _value.fontFamily + : fontFamily // ignore: cast_nullable_to_non_nullable + as String?, + fontFamilyFallback: null == fontFamilyFallback + ? _value._fontFamilyFallback + : fontFamilyFallback // ignore: cast_nullable_to_non_nullable + as List, appBarTheme: freezed == appBarTheme ? _value.appBarTheme : appBarTheme // ignore: cast_nullable_to_non_nullable @@ -954,6 +980,8 @@ class _$_MiraiTheme implements _MiraiTheme { this.shadowColor, this.splashColor, this.unselectedWidgetColor, + this.fontFamily, + final List fontFamilyFallback = const [], this.appBarTheme, this.elevatedButtonTheme, this.outlinedButtonTheme, @@ -969,7 +997,8 @@ class _$_MiraiTheme implements _MiraiTheme { this.cardTheme, this.listTileTheme, this.navigationBarTheme, - this.tabBarTheme}); + this.tabBarTheme}) + : _fontFamilyFallback = fontFamilyFallback; factory _$_MiraiTheme.fromJson(Map json) => _$$_MiraiThemeFromJson(json); @@ -1024,6 +1053,18 @@ class _$_MiraiTheme implements _MiraiTheme { final String? splashColor; @override final String? unselectedWidgetColor; + @override + final String? fontFamily; + final List _fontFamilyFallback; + @override + @JsonKey() + List get fontFamilyFallback { + if (_fontFamilyFallback is EqualUnmodifiableListView) + return _fontFamilyFallback; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_fontFamilyFallback); + } + @override final MiraiAppBarTheme? appBarTheme; @override @@ -1059,7 +1100,7 @@ class _$_MiraiTheme implements _MiraiTheme { @override String toString() { - return 'MiraiTheme(applyElevationOverlayColor: $applyElevationOverlayColor, inputDecorationTheme: $inputDecorationTheme, useMaterial3: $useMaterial3, brightness: $brightness, canvasColor: $canvasColor, cardColor: $cardColor, colorScheme: $colorScheme, colorSchemeSeed: $colorSchemeSeed, dialogBackgroundColor: $dialogBackgroundColor, disabledColor: $disabledColor, dividerColor: $dividerColor, focusColor: $focusColor, highlightColor: $highlightColor, hintColor: $hintColor, hoverColor: $hoverColor, indicatorColor: $indicatorColor, primaryColor: $primaryColor, primaryColorDark: $primaryColorDark, primaryColorLight: $primaryColorLight, primarySwatch: $primarySwatch, scaffoldBackgroundColor: $scaffoldBackgroundColor, secondaryHeaderColor: $secondaryHeaderColor, shadowColor: $shadowColor, splashColor: $splashColor, unselectedWidgetColor: $unselectedWidgetColor, appBarTheme: $appBarTheme, elevatedButtonTheme: $elevatedButtonTheme, outlinedButtonTheme: $outlinedButtonTheme, iconButtonTheme: $iconButtonTheme, iconTheme: $iconTheme, primaryIconTheme: $primaryIconTheme, dialogTheme: $dialogTheme, floatingActionButtonTheme: $floatingActionButtonTheme, textButtonTheme: $textButtonTheme, bottomAppBarTheme: $bottomAppBarTheme, bottomNavigationBarTheme: $bottomNavigationBarTheme, bottomSheetTheme: $bottomSheetTheme, cardTheme: $cardTheme, listTileTheme: $listTileTheme, navigationBarTheme: $navigationBarTheme, tabBarTheme: $tabBarTheme)'; + return 'MiraiTheme(applyElevationOverlayColor: $applyElevationOverlayColor, inputDecorationTheme: $inputDecorationTheme, useMaterial3: $useMaterial3, brightness: $brightness, canvasColor: $canvasColor, cardColor: $cardColor, colorScheme: $colorScheme, colorSchemeSeed: $colorSchemeSeed, dialogBackgroundColor: $dialogBackgroundColor, disabledColor: $disabledColor, dividerColor: $dividerColor, focusColor: $focusColor, highlightColor: $highlightColor, hintColor: $hintColor, hoverColor: $hoverColor, indicatorColor: $indicatorColor, primaryColor: $primaryColor, primaryColorDark: $primaryColorDark, primaryColorLight: $primaryColorLight, primarySwatch: $primarySwatch, scaffoldBackgroundColor: $scaffoldBackgroundColor, secondaryHeaderColor: $secondaryHeaderColor, shadowColor: $shadowColor, splashColor: $splashColor, unselectedWidgetColor: $unselectedWidgetColor, fontFamily: $fontFamily, fontFamilyFallback: $fontFamilyFallback, appBarTheme: $appBarTheme, elevatedButtonTheme: $elevatedButtonTheme, outlinedButtonTheme: $outlinedButtonTheme, iconButtonTheme: $iconButtonTheme, iconTheme: $iconTheme, primaryIconTheme: $primaryIconTheme, dialogTheme: $dialogTheme, floatingActionButtonTheme: $floatingActionButtonTheme, textButtonTheme: $textButtonTheme, bottomAppBarTheme: $bottomAppBarTheme, bottomNavigationBarTheme: $bottomNavigationBarTheme, bottomSheetTheme: $bottomSheetTheme, cardTheme: $cardTheme, listTileTheme: $listTileTheme, navigationBarTheme: $navigationBarTheme, tabBarTheme: $tabBarTheme)'; } @override @@ -1118,6 +1159,10 @@ class _$_MiraiTheme implements _MiraiTheme { other.splashColor == splashColor) && (identical(other.unselectedWidgetColor, unselectedWidgetColor) || other.unselectedWidgetColor == unselectedWidgetColor) && + (identical(other.fontFamily, fontFamily) || + other.fontFamily == fontFamily) && + const DeepCollectionEquality() + .equals(other._fontFamilyFallback, _fontFamilyFallback) && (identical(other.appBarTheme, appBarTheme) || other.appBarTheme == appBarTheme) && (identical(other.elevatedButtonTheme, elevatedButtonTheme) || @@ -1128,10 +1173,8 @@ class _$_MiraiTheme implements _MiraiTheme { other.iconButtonTheme == iconButtonTheme) && (identical(other.iconTheme, iconTheme) || other.iconTheme == iconTheme) && - (identical(other.primaryIconTheme, primaryIconTheme) || - other.primaryIconTheme == primaryIconTheme) && - (identical(other.dialogTheme, dialogTheme) || - other.dialogTheme == dialogTheme) && + (identical(other.primaryIconTheme, primaryIconTheme) || other.primaryIconTheme == primaryIconTheme) && + (identical(other.dialogTheme, dialogTheme) || other.dialogTheme == dialogTheme) && (identical(other.floatingActionButtonTheme, floatingActionButtonTheme) || other.floatingActionButtonTheme == floatingActionButtonTheme) && (identical(other.textButtonTheme, textButtonTheme) || other.textButtonTheme == textButtonTheme) && (identical(other.bottomAppBarTheme, bottomAppBarTheme) || other.bottomAppBarTheme == bottomAppBarTheme) && @@ -1172,6 +1215,8 @@ class _$_MiraiTheme implements _MiraiTheme { shadowColor, splashColor, unselectedWidgetColor, + fontFamily, + const DeepCollectionEquality().hash(_fontFamilyFallback), appBarTheme, elevatedButtonTheme, outlinedButtonTheme, @@ -1231,6 +1276,8 @@ abstract class _MiraiTheme implements MiraiTheme { final String? shadowColor, final String? splashColor, final String? unselectedWidgetColor, + final String? fontFamily, + final List fontFamilyFallback, final MiraiAppBarTheme? appBarTheme, final MiraiButtonStyle? elevatedButtonTheme, final MiraiButtonStyle? outlinedButtonTheme, @@ -1302,6 +1349,10 @@ abstract class _MiraiTheme implements MiraiTheme { @override String? get unselectedWidgetColor; @override + String? get fontFamily; + @override + List get fontFamilyFallback; + @override MiraiAppBarTheme? get appBarTheme; @override MiraiButtonStyle? get elevatedButtonTheme; diff --git a/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.g.dart b/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.g.dart index 724366e6..a4634142 100644 --- a/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.g.dart +++ b/packages/mirai/lib/src/parsers/mirai_theme/mirai_theme.g.dart @@ -42,6 +42,11 @@ _$_MiraiTheme _$$_MiraiThemeFromJson(Map json) => shadowColor: json['shadowColor'] as String?, splashColor: json['splashColor'] as String?, unselectedWidgetColor: json['unselectedWidgetColor'] as String?, + fontFamily: json['fontFamily'] as String?, + fontFamilyFallback: (json['fontFamilyFallback'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], appBarTheme: json['appBarTheme'] == null ? null : MiraiAppBarTheme.fromJson( @@ -135,6 +140,8 @@ Map _$$_MiraiThemeToJson(_$_MiraiTheme instance) => 'shadowColor': instance.shadowColor, 'splashColor': instance.splashColor, 'unselectedWidgetColor': instance.unselectedWidgetColor, + 'fontFamily': instance.fontFamily, + 'fontFamilyFallback': instance.fontFamilyFallback, 'appBarTheme': instance.appBarTheme, 'elevatedButtonTheme': instance.elevatedButtonTheme, 'outlinedButtonTheme': instance.outlinedButtonTheme,