Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
feat: 国际化
Browse files Browse the repository at this point in the history
  • Loading branch information
kjxbyz committed May 23, 2024
1 parent a1d1331 commit 58f60c1
Show file tree
Hide file tree
Showing 21 changed files with 2,641 additions and 596 deletions.
4 changes: 3 additions & 1 deletion lib/common/models/yt_video_model.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ YTThumbnails _$YTThumbnailsFromJson(Map<String, dynamic> json) {

/// @nodoc
mixin _$YTThumbnails {
// ignore: invalid_annotation_target
@JsonKey(name: 'default')
YTThumbnail? get defaults => throw _privateConstructorUsedError;
YTThumbnail? get medium => throw _privateConstructorUsedError;
Expand Down Expand Up @@ -855,6 +856,7 @@ class _$YTThumbnailsImpl implements _YTThumbnails {
factory _$YTThumbnailsImpl.fromJson(Map<String, dynamic> json) =>
_$$YTThumbnailsImplFromJson(json);

// ignore: invalid_annotation_target
@override
@JsonKey(name: 'default')
final YTThumbnail? defaults;
Expand Down Expand Up @@ -906,7 +908,7 @@ abstract class _YTThumbnails implements YTThumbnails {
factory _YTThumbnails.fromJson(Map<String, dynamic> json) =
_$YTThumbnailsImpl.fromJson;

@override
@override // ignore: invalid_annotation_target
@JsonKey(name: 'default')
YTThumbnail? get defaults;
@override
Expand Down
47 changes: 21 additions & 26 deletions lib/common/utils/dialog_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,20 @@ class DialogUtil {
builder: (BuildContext context) {
final isDark = Theme.of(context).brightness == Brightness.dark;

final androidPermissionTexts =
t.dialogs.licenseDialog.androidPermissions
.mapIndexed(
(index, permissionText) => Text(
'${index + 1}. $permissionText',
style: TextStyle(
color: isDark ? Colors.white : primaryTextColor,
fontSize: 14,
fontWeight: FontWeight.w400,
),
).nestedPadding(padding: const EdgeInsets.only(top: 4)),
)
.toList();
final androidPermissionTexts = t.dialogs.license.androidPermissions
.mapIndexed(
(index, permissionText) => Text(
'${index + 1}. $permissionText',
style: TextStyle(
color: isDark ? Colors.white : primaryTextColor,
fontSize: 14,
fontWeight: FontWeight.w400,
),
).nestedPadding(padding: const EdgeInsets.only(top: 4)),
)
.toList();

final iosPermissionTexts = t.dialogs.licenseDialog.iosPermissions
final iosPermissionTexts = t.dialogs.license.iosPermissions
.mapIndexed(
(index, permissionText) => Text(
'${index + 1}. $permissionText',
Expand All @@ -68,7 +67,7 @@ class DialogUtil {

return AlertDialog(
title: Text(
t.dialogs.licenseDialog.licenseDialogTitle,
t.dialogs.license.title,
style: TextStyle(
color: isDark ? Colors.white : primaryTextColor,
fontSize: 18,
Expand All @@ -80,15 +79,15 @@ class DialogUtil {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
t.dialogs.licenseDialog.licenseDialogContentContent,
t.dialogs.license.contentContent,
style: TextStyle(
color: isDark ? Colors.white : primaryTextColor,
fontSize: 14,
fontWeight: FontWeight.w400,
),
),
Text(
t.dialogs.licenseDialog.licenseDialogContentTip,
t.dialogs.license.contentTip,
style: TextStyle(
color: isDark ? Colors.white : primaryTextColor,
fontSize: 14,
Expand All @@ -101,17 +100,15 @@ class DialogUtil {
text: TextSpan(
children: [
TextSpan(
text:
t.dialogs.licenseDialog.licenseDialogContentPrefix,
text: t.dialogs.license.contentPrefix,
style: TextStyle(
color: isDark ? Colors.white : primaryTextColor,
fontSize: 14,
fontWeight: FontWeight.w400,
),
),
TextSpan(
text: t.dialogs.licenseDialog
.licenseDialogContentUserAgreement,
text: t.dialogs.license.contentUserAgreement,
recognizer: TapGestureRecognizer()
..onTap = () async {
final uri = Uri.parse(
Expand All @@ -128,16 +125,15 @@ class DialogUtil {
),
),
TextSpan(
text: t.dialogs.licenseDialog.licenseDialogContentAnd,
text: t.dialogs.license.contentAnd,
style: TextStyle(
color: isDark ? Colors.white : primaryTextColor,
fontSize: 14,
fontWeight: FontWeight.w400,
),
),
TextSpan(
text: t.dialogs.licenseDialog
.licenseDialogContentPrivacyAgreement,
text: t.dialogs.license.contentPrivacyAgreement,
recognizer: TapGestureRecognizer()
..onTap = () async {
final uri = Uri.parse(
Expand All @@ -154,8 +150,7 @@ class DialogUtil {
),
),
TextSpan(
text:
t.dialogs.licenseDialog.licenseDialogContentSuffix,
text: t.dialogs.license.contentSuffix,
style: TextStyle(
color: isDark ? Colors.white : primaryTextColor,
fontSize: 14,
Expand Down
2 changes: 2 additions & 0 deletions lib/common/widgets/bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class ModalBottomSheet extends StatelessWidget {
style: TextStyle(
fontSize: 18,
color: isDark ? Colors.white : primaryTextColor,
fontWeight: FontWeight.w400,
),
textAlign: TextAlign.center,
maxLines: 1,
Expand Down Expand Up @@ -123,6 +124,7 @@ class ModalBottomSheet extends StatelessWidget {
style: TextStyle(
fontSize: 18,
color: isDark ? Colors.white : primaryTextColor,
fontWeight: FontWeight.w400,
),
textAlign: TextAlign.center,
maxLines: 1,
Expand Down
Loading

0 comments on commit 58f60c1

Please sign in to comment.