Show last reading position on Comic Details page.

This commit is contained in:
2025-02-15 10:59:37 +08:00
parent a2b113ca20
commit 94098eea77
2 changed files with 47 additions and 3 deletions

View File

@@ -333,7 +333,11 @@
"name": "名称",
"Reverse tap to turn Pages": "反转点击翻页",
"Show all": "显示全部",
"Number of images preloaded": "预加载图片数量"
"Number of images preloaded": "预加载图片数量",
"Ascending": "升序",
"Descending": "降序",
"Last Reading: Chapter @ep Page @page": "上次阅读: 第 @ep 章 第 @page 页",
"Last Reading: Page @page": "上次阅读: 第 @page 页"
},
"zh_TW": {
"Home": "首頁",
@@ -669,6 +673,10 @@
"name": "名稱",
"Reverse tap to turn Pages": "反轉點擊翻頁",
"Show all": "顯示全部",
"Number of images preloaded": "預加載圖片數量"
"Number of images preloaded": "預加載圖片數量",
"Ascending": "升序",
"Descending": "降序",
"Last Reading: Chapter @ep Page @page": "上次閱讀: 第 @ep 章 第 @page 頁",
"Last Reading: Page @page": "上次閱讀: 第 @page 頁"
}
}

View File

@@ -362,7 +362,43 @@ class _ComicPageState extends LoadingState<ComicPage, ComicDetails>
: FilledButton(onPressed: read, child: Text("Read".tl)),
)
],
).paddingHorizontal(16).paddingVertical(8),
).paddingHorizontal(16).paddingTop(8),
if (history != null)
Container(
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
decoration: BoxDecoration(
color: context.colorScheme.surfaceContainerLow,
borderRadius: BorderRadius.circular(16),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.history, color: context.useTextColor(Colors.teal)),
const SizedBox(width: 8),
Builder(
builder: (context) {
bool haveChapter = comic.chapters != null;
var page = history!.page;
var ep = history!.ep;
String text;
if (haveChapter) {
text = "Last Reading: Chapter @ep Page @page".tlParams({
'ep': ep,
'page': page,
});
} else {
text = "Last Reading: Page @page".tlParams({
'page': page,
});
}
return Text(text);
},
),
const SizedBox(width: 4),
],
),
).toAlign(Alignment.centerLeft),
const Divider(),
],
).paddingTop(16),