Skip to content

Commit

Permalink
Revise📖& Feature🌍
Browse files Browse the repository at this point in the history
1. 📖Update packages
2. 🌍You can add background image at Home Page now
  • Loading branch information
Cierra-Runis committed Sep 27, 2023
1 parent 2f263cd commit fa291f6
Show file tree
Hide file tree
Showing 15 changed files with 324 additions and 23 deletions.
2 changes: 2 additions & 0 deletions lib/database/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ class Config {
/// 主题模式 (不可为空)
@enumerated
ThemeMode themeMode;

String? backgroundImagePath;
}
214 changes: 211 additions & 3 deletions lib/database/config.g.dart

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

6 changes: 2 additions & 4 deletions lib/database/isar_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ class IsarService {
// }

/// 创建 `Stream` 监听所有 `editing``true` 的日记
Stream<List<Diary>> listenToDiariesEditing({int delayed = 300}) async* {
Stream<List<Diary>> listenToDiariesEditing() async* {
final isar = await _db;
await Future.delayed(Duration(milliseconds: delayed));
yield* isar.diarys
.filter()
.editingEqualTo(true)
Expand All @@ -62,9 +61,8 @@ class IsarService {
}

/// 监听所有非编辑中的日记
Stream<List<Diary>> listenToAllDiaries({int delayed = 300}) async* {
Stream<List<Diary>> listenToAllDiaries() async* {
final isar = await _db;
await Future.delayed(Duration(milliseconds: delayed));
yield* isar.diarys
.filter()
.editingEqualTo(false)
Expand Down
1 change: 1 addition & 0 deletions lib/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export 'package:flutter/gestures.dart';
export 'dart:async' show Timer, StreamSubscription;
export 'dart:convert';
export 'dart:io';
export 'dart:ui' show ImageFilter;

/// 外部包相关
export 'package:another_flushbar/flushbar.dart'; // 提示框
Expand Down
4 changes: 4 additions & 0 deletions lib/l10n/intl/messages_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class MessageLookup extends MessageLookupByLibrary {
"back": MessageLookupByLibrary.simpleMessage("Back"),
"backAgainToExit":
MessageLookupByLibrary.simpleMessage("Go Back Again To Exit"),
"backgroundImage":
MessageLookupByLibrary.simpleMessage("Background Image"),
"buttonVibration":
MessageLookupByLibrary.simpleMessage("Button vibration"),
"cancel": MessageLookupByLibrary.simpleMessage("Cancel"),
Expand Down Expand Up @@ -135,6 +137,8 @@ class MessageLookup extends MessageLookupByLibrary {
"moodText": m1,
"morePage": MessageLookupByLibrary.simpleMessage("More"),
"noData": MessageLookupByLibrary.simpleMessage("No Data"),
"noImageSelected":
MessageLookupByLibrary.simpleMessage("No Image Selected"),
"notYetCompleted":
MessageLookupByLibrary.simpleMessage("Not Yet Completed"),
"pleaseBackToHomePage":
Expand Down
2 changes: 2 additions & 0 deletions lib/l10n/intl/messages_ja.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("画像を削除してもよろしいですか?"),
"back": MessageLookupByLibrary.simpleMessage("戻る"),
"backAgainToExit": MessageLookupByLibrary.simpleMessage("もう一度戻って終了します"),
"backgroundImage": MessageLookupByLibrary.simpleMessage("背景画像"),
"buttonVibration": MessageLookupByLibrary.simpleMessage("ボタン振動"),
"cancel": MessageLookupByLibrary.simpleMessage("キャンセル"),
"changeDate": MessageLookupByLibrary.simpleMessage("日付を変える"),
Expand Down Expand Up @@ -126,6 +127,7 @@ class MessageLookup extends MessageLookupByLibrary {
"moodText": m1,
"morePage": MessageLookupByLibrary.simpleMessage("詳細"),
"noData": MessageLookupByLibrary.simpleMessage("データ無し"),
"noImageSelected": MessageLookupByLibrary.simpleMessage("画像が選択されていません"),
"notYetCompleted": MessageLookupByLibrary.simpleMessage("まだ完成していません"),
"pleaseBackToHomePage":
MessageLookupByLibrary.simpleMessage("ホームページに戻ってください"),
Expand Down
2 changes: 2 additions & 0 deletions lib/l10n/intl/messages_zh_CN.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class MessageLookup extends MessageLookupByLibrary {
MessageLookupByLibrary.simpleMessage("确定删除图片吗?"),
"back": MessageLookupByLibrary.simpleMessage("返回"),
"backAgainToExit": MessageLookupByLibrary.simpleMessage("再次返回以退出"),
"backgroundImage": MessageLookupByLibrary.simpleMessage("背景图像"),
"buttonVibration": MessageLookupByLibrary.simpleMessage("按钮振动"),
"cancel": MessageLookupByLibrary.simpleMessage("取消"),
"changeDate": MessageLookupByLibrary.simpleMessage("修改日期"),
Expand Down Expand Up @@ -114,6 +115,7 @@ class MessageLookup extends MessageLookupByLibrary {
"moodText": m1,
"morePage": MessageLookupByLibrary.simpleMessage("更多"),
"noData": MessageLookupByLibrary.simpleMessage("无数据"),
"noImageSelected": MessageLookupByLibrary.simpleMessage("未选择图片"),
"notYetCompleted": MessageLookupByLibrary.simpleMessage("暂未完成"),
"pleaseBackToHomePage": MessageLookupByLibrary.simpleMessage("请回到主页"),
"pleaseThinkTwiceAboutDeletingTheDiary":
Expand Down
4 changes: 3 additions & 1 deletion lib/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,7 @@
"backAgainToExit": "Go Back Again To Exit",
"hiToKoToProvider": "This service is provided by Hitokoto「一言」",
"hiToKoToFetching": "Fetching 「一言」...",
"thisDayLastYear": "This Day Last Year"
"thisDayLastYear": "This Day Last Year",
"backgroundImage": "Background Image",
"noImageSelected": "No Image Selected"
}
4 changes: 3 additions & 1 deletion lib/l10n/intl_ja.arb
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,7 @@
"backAgainToExit": "もう一度戻って終了します",
"hiToKoToProvider": "このサービスは、Hitokoto「一言」が提供しています",
"hiToKoToFetching": "「一言」を取得中",
"thisDayLastYear": "去年の今日"
"thisDayLastYear": "去年の今日",
"backgroundImage": "背景画像",
"noImageSelected": "画像が選択されていません"
}
Loading

0 comments on commit fa291f6

Please sign in to comment.