diff --git a/assets/translations/zh-CN.json b/assets/translations/zh-CN.json index fca0f78..d2f6de8 100644 --- a/assets/translations/zh-CN.json +++ b/assets/translations/zh-CN.json @@ -594,7 +594,7 @@ "walletCreate": "创建钱包", "walletCreateSubtitle": "创建于一个钱包来开始使用源点。", "walletCreatePassword": "在下方设置你的付款密码", - "walletCurrencyShort": "点", + "walletCurrencyShort": "源点", "walletCurrency": { "one": "{} 源点", "other": "{} 源点" diff --git a/assets/translations/zh-HK.json b/assets/translations/zh-HK.json index 0a203e9..8ffad9b 100644 --- a/assets/translations/zh-HK.json +++ b/assets/translations/zh-HK.json @@ -16,6 +16,8 @@ "screenAbuseReport": "濫用檢舉", "screenSettings": "設置", "screenAccountSettings": "賬號設置", + "screenFactorSettings": "驗證因子", + "screenAccountWallet": "錢包", "screenNews": "新聞", "screenAlbum": "相冊", "screenChat": "聊天", @@ -113,6 +115,8 @@ "accountSettingsSubtitle": "管理你的帳號並讓它更好的服務你。", "accountProfileEdit": "編輯資料", "accountProfileEditSubtitle": "使你的 Solarpass 賬户更像你。", + "accountWallet": "錢包", + "accountWalletSubtitle": "查看你的餘額和交易記錄。", "factorSettings": "驗證因子", "factorSettingsSubtitle": "管理你的登陸驗證方式。", "accountProfileEditApplied": "個人資料修改已被應用。", @@ -193,6 +197,9 @@ "other": "{} 條評論" }, "settingsAppearance": "外觀", + "settingsDisplayLanguage": "顯示語言", + "settingsDisplayLanguageDescription": "設置應用程序使用的語言", + "settingsDisplayLanguageSystem": "跟隨系統", "settingsBackgroundImage": "背景圖片", "settingsBackgroundImageDescription": "設置應用全局生效的的背景圖片。", "settingsBackgroundImageClear": "清除現存背景圖", @@ -581,5 +588,15 @@ "newsToday": "快訊", "totpPostSetup": "還有一件事", "totpPostSetupDescription": "使用 Google Authenticator, Microsoft Authenticator, 1Password, Authy, Bitwarden 或其他支持 TOTP 的驗證器掃描本 QR Code 來添加。", - "totpNeverShare": "永遠不要分享這個 QR Code" + "totpNeverShare": "永遠不要分享這個 QR Code", + "needHelp": "需要幫助?", + "needHelpLaunch": "查看我們的山羊維基!", + "walletCreate": "創建錢包", + "walletCreateSubtitle": "創建於一個錢包來開始使用源點。", + "walletCreatePassword": "在下方設置你的付款密碼", + "walletCurrencyShort": "源點", + "walletCurrency": { + "one": "{} 源點", + "other": "{} 源點" + } } diff --git a/assets/translations/zh-TW.json b/assets/translations/zh-TW.json index 2c97c1b..c37cd8c 100644 --- a/assets/translations/zh-TW.json +++ b/assets/translations/zh-TW.json @@ -16,6 +16,8 @@ "screenAbuseReport": "濫用檢舉", "screenSettings": "設置", "screenAccountSettings": "賬號設置", + "screenFactorSettings": "驗證因子", + "screenAccountWallet": "錢包", "screenNews": "新聞", "screenAlbum": "相冊", "screenChat": "聊天", @@ -113,6 +115,8 @@ "accountSettingsSubtitle": "管理你的帳號並讓它更好的服務你。", "accountProfileEdit": "編輯資料", "accountProfileEditSubtitle": "使你的 Solarpass 賬戶更像你。", + "accountWallet": "錢包", + "accountWalletSubtitle": "查看你的餘額和交易記錄。", "factorSettings": "驗證因子", "factorSettingsSubtitle": "管理你的登陸驗證方式。", "accountProfileEditApplied": "個人資料修改已被應用。", @@ -193,6 +197,9 @@ "other": "{} 條評論" }, "settingsAppearance": "外觀", + "settingsDisplayLanguage": "顯示語言", + "settingsDisplayLanguageDescription": "設置應用程序使用的語言", + "settingsDisplayLanguageSystem": "跟隨系統", "settingsBackgroundImage": "背景圖片", "settingsBackgroundImageDescription": "設置應用全局生效的的背景圖片。", "settingsBackgroundImageClear": "清除現存背景圖", @@ -581,5 +588,15 @@ "newsToday": "快訊", "totpPostSetup": "還有一件事", "totpPostSetupDescription": "使用 Google Authenticator, Microsoft Authenticator, 1Password, Authy, Bitwarden 或其他支持 TOTP 的驗證器掃描本 QR Code 來添加。", - "totpNeverShare": "永遠不要分享這個 QR Code" + "totpNeverShare": "永遠不要分享這個 QR Code", + "needHelp": "需要幫助?", + "needHelpLaunch": "查看我們的山羊維基!", + "walletCreate": "創建錢包", + "walletCreateSubtitle": "創建於一個錢包來開始使用源點。", + "walletCreatePassword": "在下方設置你的付款密碼", + "walletCurrencyShort": "源點", + "walletCurrency": { + "one": "{} 源點", + "other": "{} 源點" + } } diff --git a/lib/screens/home.dart b/lib/screens/home.dart index 4d33173..efe391f 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -302,20 +302,18 @@ class _HomeDashTodayNewsState extends State<_HomeDashTodayNews> { overflow: TextOverflow.ellipsis, style: Theme.of(context).textTheme.bodyMedium, ), - Builder( - builder: (context) { - final date = _article!.publishedAt ?? _article!.createdAt; - return Row( - crossAxisAlignment: CrossAxisAlignment.center, - spacing: 2, - children: [ - Text(DateFormat().format(date)).textStyle(Theme.of(context).textTheme.bodySmall!), - Text(' · ').textStyle(Theme.of(context).textTheme.bodySmall!).bold(), - Text(RelativeTime(context).format(date)).textStyle(Theme.of(context).textTheme.bodySmall!), - ], - ).opacity(0.75); - } - ), + Builder(builder: (context) { + final date = _article!.publishedAt ?? _article!.createdAt; + return Row( + crossAxisAlignment: CrossAxisAlignment.center, + spacing: 2, + children: [ + Text(DateFormat().format(date)).textStyle(Theme.of(context).textTheme.bodySmall!), + Text(' · ').textStyle(Theme.of(context).textTheme.bodySmall!).bold(), + Text(RelativeTime(context).format(date)).textStyle(Theme.of(context).textTheme.bodySmall!), + ], + ).opacity(0.75); + }), ], ).padding(horizontal: 16), onTap: () { @@ -515,6 +513,11 @@ class _HomeDashCheckInWidgetState extends State<_HomeDashCheckInWidget> { '+${_todayRecord!.resultExperience} EXP', style: Theme.of(context).textTheme.bodyLarge, ), + if (_todayRecord!.resultCoin >= 0) + Text( + '+${_todayRecord!.resultCoin} ${'walletCurrencyShort'.tr()}', + style: Theme.of(context).textTheme.bodyLarge, + ) ], ), ), diff --git a/lib/screens/wallet.dart b/lib/screens/wallet.dart index ded99db..4aa8d58 100644 --- a/lib/screens/wallet.dart +++ b/lib/screens/wallet.dart @@ -86,7 +86,7 @@ class _WalletScreenState extends State { Text('walletCurrency'.plural(double.parse(_wallet!.balance))), ], ).padding(horizontal: 20, vertical: 24), - ), + ).padding(horizontal: 8, top: 16, bottom: 4), if (_wallet != null) Expanded(child: _WalletTransactionList(myself: _wallet!)), ], ), diff --git a/lib/types/check_in.dart b/lib/types/check_in.dart index 3704c75..58c7273 100644 --- a/lib/types/check_in.dart +++ b/lib/types/check_in.dart @@ -16,6 +16,7 @@ class SnCheckInRecord with _$SnCheckInRecord { required DateTime? deletedAt, required int resultTier, required int resultExperience, + required double resultCoin, required List resultModifiers, required int accountId, }) = _SnCheckInRecord; diff --git a/lib/types/check_in.freezed.dart b/lib/types/check_in.freezed.dart index 1ad8207..383b7e7 100644 --- a/lib/types/check_in.freezed.dart +++ b/lib/types/check_in.freezed.dart @@ -26,6 +26,7 @@ mixin _$SnCheckInRecord { DateTime? get deletedAt => throw _privateConstructorUsedError; int get resultTier => throw _privateConstructorUsedError; int get resultExperience => throw _privateConstructorUsedError; + double get resultCoin => throw _privateConstructorUsedError; List get resultModifiers => throw _privateConstructorUsedError; int get accountId => throw _privateConstructorUsedError; @@ -52,6 +53,7 @@ abstract class $SnCheckInRecordCopyWith<$Res> { DateTime? deletedAt, int resultTier, int resultExperience, + double resultCoin, List resultModifiers, int accountId}); } @@ -77,6 +79,7 @@ class _$SnCheckInRecordCopyWithImpl<$Res, $Val extends SnCheckInRecord> Object? deletedAt = freezed, Object? resultTier = null, Object? resultExperience = null, + Object? resultCoin = null, Object? resultModifiers = null, Object? accountId = null, }) { @@ -105,6 +108,10 @@ class _$SnCheckInRecordCopyWithImpl<$Res, $Val extends SnCheckInRecord> ? _value.resultExperience : resultExperience // ignore: cast_nullable_to_non_nullable as int, + resultCoin: null == resultCoin + ? _value.resultCoin + : resultCoin // ignore: cast_nullable_to_non_nullable + as double, resultModifiers: null == resultModifiers ? _value.resultModifiers : resultModifiers // ignore: cast_nullable_to_non_nullable @@ -132,6 +139,7 @@ abstract class _$$SnCheckInRecordImplCopyWith<$Res> DateTime? deletedAt, int resultTier, int resultExperience, + double resultCoin, List resultModifiers, int accountId}); } @@ -155,6 +163,7 @@ class __$$SnCheckInRecordImplCopyWithImpl<$Res> Object? deletedAt = freezed, Object? resultTier = null, Object? resultExperience = null, + Object? resultCoin = null, Object? resultModifiers = null, Object? accountId = null, }) { @@ -183,6 +192,10 @@ class __$$SnCheckInRecordImplCopyWithImpl<$Res> ? _value.resultExperience : resultExperience // ignore: cast_nullable_to_non_nullable as int, + resultCoin: null == resultCoin + ? _value.resultCoin + : resultCoin // ignore: cast_nullable_to_non_nullable + as double, resultModifiers: null == resultModifiers ? _value._resultModifiers : resultModifiers // ignore: cast_nullable_to_non_nullable @@ -205,6 +218,7 @@ class _$SnCheckInRecordImpl extends _SnCheckInRecord { required this.deletedAt, required this.resultTier, required this.resultExperience, + required this.resultCoin, required final List resultModifiers, required this.accountId}) : _resultModifiers = resultModifiers, @@ -225,6 +239,8 @@ class _$SnCheckInRecordImpl extends _SnCheckInRecord { final int resultTier; @override final int resultExperience; + @override + final double resultCoin; final List _resultModifiers; @override List get resultModifiers { @@ -238,7 +254,7 @@ class _$SnCheckInRecordImpl extends _SnCheckInRecord { @override String toString() { - return 'SnCheckInRecord(id: $id, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, resultTier: $resultTier, resultExperience: $resultExperience, resultModifiers: $resultModifiers, accountId: $accountId)'; + return 'SnCheckInRecord(id: $id, createdAt: $createdAt, updatedAt: $updatedAt, deletedAt: $deletedAt, resultTier: $resultTier, resultExperience: $resultExperience, resultCoin: $resultCoin, resultModifiers: $resultModifiers, accountId: $accountId)'; } @override @@ -257,6 +273,8 @@ class _$SnCheckInRecordImpl extends _SnCheckInRecord { other.resultTier == resultTier) && (identical(other.resultExperience, resultExperience) || other.resultExperience == resultExperience) && + (identical(other.resultCoin, resultCoin) || + other.resultCoin == resultCoin) && const DeepCollectionEquality() .equals(other._resultModifiers, _resultModifiers) && (identical(other.accountId, accountId) || @@ -273,6 +291,7 @@ class _$SnCheckInRecordImpl extends _SnCheckInRecord { deletedAt, resultTier, resultExperience, + resultCoin, const DeepCollectionEquality().hash(_resultModifiers), accountId); @@ -301,6 +320,7 @@ abstract class _SnCheckInRecord extends SnCheckInRecord { required final DateTime? deletedAt, required final int resultTier, required final int resultExperience, + required final double resultCoin, required final List resultModifiers, required final int accountId}) = _$SnCheckInRecordImpl; const _SnCheckInRecord._() : super._(); @@ -321,6 +341,8 @@ abstract class _SnCheckInRecord extends SnCheckInRecord { @override int get resultExperience; @override + double get resultCoin; + @override List get resultModifiers; @override int get accountId; diff --git a/lib/types/check_in.g.dart b/lib/types/check_in.g.dart index 1a23194..9e710e6 100644 --- a/lib/types/check_in.g.dart +++ b/lib/types/check_in.g.dart @@ -17,6 +17,7 @@ _$SnCheckInRecordImpl _$$SnCheckInRecordImplFromJson( : DateTime.parse(json['deleted_at'] as String), resultTier: (json['result_tier'] as num).toInt(), resultExperience: (json['result_experience'] as num).toInt(), + resultCoin: (json['result_coin'] as num).toDouble(), resultModifiers: (json['result_modifiers'] as List) .map((e) => (e as num).toInt()) .toList(), @@ -32,6 +33,7 @@ Map _$$SnCheckInRecordImplToJson( 'deleted_at': instance.deletedAt?.toIso8601String(), 'result_tier': instance.resultTier, 'result_experience': instance.resultExperience, + 'result_coin': instance.resultCoin, 'result_modifiers': instance.resultModifiers, 'account_id': instance.accountId, };