Skip to content

Commit

Permalink
google fontsに対応
Browse files Browse the repository at this point in the history
  • Loading branch information
poppingmoon committed Oct 26, 2023
1 parent bfe996f commit 96f948f
Show file tree
Hide file tree
Showing 6 changed files with 865 additions and 781 deletions.
3 changes: 3 additions & 0 deletions lib/model/general_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ class GeneralSettings with _$GeneralSettings {

/// 使用するUnicodeの絵文字種別
@Default(EmojiType.twemoji) EmojiType emojiType,

/// Google Fontsのフォント名
String? fontName,
}) = _GeneralSettings;

factory GeneralSettings.fromJson(Map<String, dynamic> json) =>
Expand Down
42 changes: 35 additions & 7 deletions lib/model/general_settings.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ mixin _$GeneralSettings {
/// 使用するUnicodeの絵文字種別
EmojiType get emojiType => throw _privateConstructorUsedError;

/// Google Fontsのフォント名
String? get fontName => throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$GeneralSettingsCopyWith<GeneralSettings> get copyWith =>
Expand All @@ -75,7 +78,8 @@ abstract class $GeneralSettingsCopyWith<$Res> {
bool enableFavoritedRenoteElipsed,
TabPosition tabPosition,
double textScaleFactor,
EmojiType emojiType});
EmojiType emojiType,
String? fontName});
}

/// @nodoc
Expand Down Expand Up @@ -103,6 +107,7 @@ class _$GeneralSettingsCopyWithImpl<$Res, $Val extends GeneralSettings>
Object? tabPosition = null,
Object? textScaleFactor = null,
Object? emojiType = null,
Object? fontName = freezed,
}) {
return _then(_value.copyWith(
lightColorThemeId: null == lightColorThemeId
Expand Down Expand Up @@ -153,6 +158,10 @@ class _$GeneralSettingsCopyWithImpl<$Res, $Val extends GeneralSettings>
? _value.emojiType
: emojiType // ignore: cast_nullable_to_non_nullable
as EmojiType,
fontName: freezed == fontName
? _value.fontName
: fontName // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
}
}
Expand All @@ -177,7 +186,8 @@ abstract class _$$_GeneralSettingsCopyWith<$Res>
bool enableFavoritedRenoteElipsed,
TabPosition tabPosition,
double textScaleFactor,
EmojiType emojiType});
EmojiType emojiType,
String? fontName});
}

/// @nodoc
Expand All @@ -203,6 +213,7 @@ class __$$_GeneralSettingsCopyWithImpl<$Res>
Object? tabPosition = null,
Object? textScaleFactor = null,
Object? emojiType = null,
Object? fontName = freezed,
}) {
return _then(_$_GeneralSettings(
lightColorThemeId: null == lightColorThemeId
Expand Down Expand Up @@ -253,6 +264,10 @@ class __$$_GeneralSettingsCopyWithImpl<$Res>
? _value.emojiType
: emojiType // ignore: cast_nullable_to_non_nullable
as EmojiType,
fontName: freezed == fontName
? _value.fontName
: fontName // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
Expand All @@ -272,7 +287,8 @@ class _$_GeneralSettings implements _GeneralSettings {
this.enableFavoritedRenoteElipsed = true,
this.tabPosition = TabPosition.top,
this.textScaleFactor = 1.0,
this.emojiType = EmojiType.twemoji});
this.emojiType = EmojiType.twemoji,
this.fontName});

factory _$_GeneralSettings.fromJson(Map<String, dynamic> json) =>
_$$_GeneralSettingsFromJson(json);
Expand Down Expand Up @@ -332,9 +348,13 @@ class _$_GeneralSettings implements _GeneralSettings {
@JsonKey()
final EmojiType emojiType;

/// Google Fontsのフォント名
@override
final String? fontName;

@override
String toString() {
return 'GeneralSettings(lightColorThemeId: $lightColorThemeId, darkColorThemeId: $darkColorThemeId, themeColorSystem: $themeColorSystem, nsfwInherit: $nsfwInherit, enableDirectReaction: $enableDirectReaction, automaticPush: $automaticPush, enableAnimatedMFM: $enableAnimatedMFM, enableLongTextElipsed: $enableLongTextElipsed, enableFavoritedRenoteElipsed: $enableFavoritedRenoteElipsed, tabPosition: $tabPosition, textScaleFactor: $textScaleFactor, emojiType: $emojiType)';
return 'GeneralSettings(lightColorThemeId: $lightColorThemeId, darkColorThemeId: $darkColorThemeId, themeColorSystem: $themeColorSystem, nsfwInherit: $nsfwInherit, enableDirectReaction: $enableDirectReaction, automaticPush: $automaticPush, enableAnimatedMFM: $enableAnimatedMFM, enableLongTextElipsed: $enableLongTextElipsed, enableFavoritedRenoteElipsed: $enableFavoritedRenoteElipsed, tabPosition: $tabPosition, textScaleFactor: $textScaleFactor, emojiType: $emojiType, fontName: $fontName)';
}

@override
Expand Down Expand Up @@ -367,7 +387,9 @@ class _$_GeneralSettings implements _GeneralSettings {
(identical(other.textScaleFactor, textScaleFactor) ||
other.textScaleFactor == textScaleFactor) &&
(identical(other.emojiType, emojiType) ||
other.emojiType == emojiType));
other.emojiType == emojiType) &&
(identical(other.fontName, fontName) ||
other.fontName == fontName));
}

@JsonKey(ignore: true)
Expand All @@ -385,7 +407,8 @@ class _$_GeneralSettings implements _GeneralSettings {
enableFavoritedRenoteElipsed,
tabPosition,
textScaleFactor,
emojiType);
emojiType,
fontName);

@JsonKey(ignore: true)
@override
Expand Down Expand Up @@ -414,7 +437,8 @@ abstract class _GeneralSettings implements GeneralSettings {
final bool enableFavoritedRenoteElipsed,
final TabPosition tabPosition,
final double textScaleFactor,
final EmojiType emojiType}) = _$_GeneralSettings;
final EmojiType emojiType,
final String? fontName}) = _$_GeneralSettings;

factory _GeneralSettings.fromJson(Map<String, dynamic> json) =
_$_GeneralSettings.fromJson;
Expand Down Expand Up @@ -462,6 +486,10 @@ abstract class _GeneralSettings implements GeneralSettings {
/// 使用するUnicodeの絵文字種別
EmojiType get emojiType;
@override

/// Google Fontsのフォント名
String? get fontName;
@override
@JsonKey(ignore: true)
_$$_GeneralSettingsCopyWith<_$_GeneralSettings> get copyWith =>
throw _privateConstructorUsedError;
Expand Down
2 changes: 2 additions & 0 deletions lib/model/general_settings.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 96f948f

Please sign in to comment.