Skip to content

Commit

Permalink
add reveal
Browse files Browse the repository at this point in the history
  • Loading branch information
Notsfsssf committed Nov 3, 2024
1 parent 1ad66bc commit 6f1cf3b
Show file tree
Hide file tree
Showing 14 changed files with 87 additions and 18 deletions.
4 changes: 3 additions & 1 deletion lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -288,5 +288,7 @@
"feed_preview_quality": "Feed preview quality",
"clean_history": "Clean history?",
"novel": "Novel",
"bulletin_board": "Bulletin board"
"bulletin_board": "Bulletin board",
"hide": "Hide",
"reveal": "Reveal"
}
4 changes: 3 additions & 1 deletion lib/l10n/intl_en_US.arb
Original file line number Diff line number Diff line change
Expand Up @@ -297,5 +297,7 @@
"feed_preview_quality": "Feed preview quality",
"clean_history": "Clean history?",
"novel": "Novel",
"bulletin_board": "Bulletin board"
"bulletin_board": "Bulletin board",
"hide": "Hide",
"reveal": "Reveal"
}
4 changes: 3 additions & 1 deletion lib/l10n/intl_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -286,5 +286,7 @@
"feed_preview_quality": "Feed preview quality",
"clean_history": "Clean history?",
"novel": "Novel",
"bulletin_board": "Bulletin board"
"bulletin_board": "Bulletin board",
"hide": "Hide",
"reveal": "Reveal"
}
4 changes: 3 additions & 1 deletion lib/l10n/intl_id.arb
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@
"feed_preview_quality": "Kualitas pratinjau feed",
"clean_history": "Hapus Riwayat?",
"novel": "Novel",
"bulletin_board": "Papan buletin"
"bulletin_board": "Papan buletin",
"hide": "Hide",
"reveal": "Reveal"
}

4 changes: 3 additions & 1 deletion lib/l10n/intl_id_ID.arb
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,7 @@
"feed_preview_quality": "Kualitas pratinjau feed",
"clean_history": "Hapus histori?",
"novel": "Novel",
"bulletin_board": "Papan buletin"
"bulletin_board": "Papan buletin",
"hide": "Hide",
"reveal": "Reveal"
}
4 changes: 3 additions & 1 deletion lib/l10n/intl_ja.arb
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,7 @@
"feed_preview_quality": "フィードのプレビュー品質",
"clean_history": "履歴をクリアしますか?",
"novel": "小説",
"bulletin_board": "掲示板"
"bulletin_board": "掲示板",
"hide": "Hide",
"reveal": "Reveal"
}
4 changes: 3 additions & 1 deletion lib/l10n/intl_ko.arb
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,7 @@
"feed_preview_quality": "Feed preview quality",
"clean_history": "Clean history?",
"novel": "Novel",
"bulletin_board": "Bulletin board"
"bulletin_board": "Bulletin board",
"hide": "Hide",
"reveal": "Reveal"
}
4 changes: 3 additions & 1 deletion lib/l10n/intl_ru.arb
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,7 @@
"feed_preview_quality": "Feed preview quality",
"clean_history": "Clean history?",
"novel": "Novel",
"bulletin_board": "Bulletin board"
"bulletin_board": "Bulletin board",
"hide": "Hide",
"reveal": "Reveal"
}
4 changes: 3 additions & 1 deletion lib/l10n/intl_tr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,7 @@
"feed_preview_quality": "Akış önizleme kalitesi",
"clean_history": "Geçmiş temizlensin mi?",
"novel": "Novel",
"bulletin_board": "Duyuru panosu"
"bulletin_board": "Duyuru panosu",
"hide": "Hide",
"reveal": "Reveal"
}
4 changes: 3 additions & 1 deletion lib/l10n/intl_zh.arb
Original file line number Diff line number Diff line change
Expand Up @@ -297,5 +297,7 @@
"feed_preview_quality": "列表预览画质",
"clean_history": "清除历史记录?",
"novel": "小说",
"bulletin_board": "告示板"
"bulletin_board": "告示板",
"hide": "隐藏",
"reveal": "显示"
}
4 changes: 3 additions & 1 deletion lib/l10n/intl_zh_CN.arb
Original file line number Diff line number Diff line change
Expand Up @@ -297,5 +297,7 @@
"feed_preview_quality": "列表预览画质",
"clean_history": "清除历史记录?",
"novel": "小说",
"bulletin_board": "告示板"
"bulletin_board": "告示板",
"hide": "隐藏",
"reveal": "显示"
}
4 changes: 3 additions & 1 deletion lib/l10n/intl_zh_TW.arb
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,7 @@
"feed_preview_quality": "動態清單預覽圖像品質",
"clean_history": "是否清除歷史記錄?",
"novel": "小說",
"bulletin_board": "佈告欄"
"bulletin_board": "佈告欄",
"hide": "隐藏",
"reveal": "揭露"
}
13 changes: 12 additions & 1 deletion lib/models/account.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ create table $tableAccount (
.delete(tableAccount, where: '$columnId = ?', whereArgs: [id]);
}

Future<int> deleteByUserId(String userId) async {
Future<int> deleteByUserId(String userId) async {
return await db
.delete(tableAccount, where: '$columnUserId = ?', whereArgs: [userId]);
}
Expand Down Expand Up @@ -202,6 +202,17 @@ class AccountPersist {
Map<String, dynamic> toJson() => _$AccountPersistToJson(this);
}

extension AccountPersistEx on AccountPersist {
String hiddenEmail() {
final splits = mailAddress.split('@');
var preText = '';
for (var i = 0; i < splits[0].length; i++) {
preText += '*';
}
return '${preText}@${splits[1]}';
}
}

@JsonSerializable()
class AccountResponse {
@JsonKey(name: "access_token")
Expand Down
44 changes: 39 additions & 5 deletions lib/page/hello/setting/setting_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import 'package:pixez/er/lprinter.dart';
import 'package:pixez/er/updater.dart';
import 'package:pixez/i18n.dart';
import 'package:pixez/main.dart';
import 'package:pixez/models/account.dart';
import 'package:pixez/models/board_info.dart';
import 'package:pixez/models/glance_illust_persist.dart';
import 'package:pixez/page/about/about_page.dart';
Expand Down Expand Up @@ -65,6 +66,7 @@ class _SettingPageState extends State<SettingPage> {
}

bool hasNewVersion = false;
bool hideEmail = true;

initMethod() async {
if (Constants.isGooglePlay || Platform.isIOS) return;
Expand Down Expand Up @@ -160,11 +162,43 @@ class _SettingPageState extends State<SettingPage> {
.textTheme
.titleMedium),
),
Text(
accountStore.now!.mailAddress,
style: Theme.of(context)
.textTheme
.bodySmall,
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
hideEmail
? accountStore.now!
.hiddenEmail()
: accountStore
.now!.mailAddress,
style: Theme.of(context)
.textTheme
.bodySmall,
),
SizedBox(
width: 6,
),
GestureDetector(
onTap: () {
setState(() {
hideEmail = !hideEmail;
});
},
child: Text(
hideEmail
? I18n.of(context).reveal
: I18n.of(context).hide,
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(
color:
Theme.of(context)
.colorScheme
.primary)),
)
],
)
],
),
Expand Down

0 comments on commit 6f1cf3b

Please sign in to comment.