Refactor chapter list provider and improve TTS functionality
Build Android APK / build-apk (push) Successful in 12m10s
Build Android AAB / build-aab (push) Successful in 19m35s

- Removed the constant chapterPageSize and refactored ChapterListQuery to use a simpler approach for fetching chapters.
- Updated the chapter list provider to handle fetching all chapters in a single request with pagination.
- Enhanced error handling for fetching chapters by resolving canonical IDs when necessary.
- Modified TTS functionality to ensure proper handling of Android fallback reading and improved error management.
- Added a new setting to enable/disable TTS on sentence tap.
- Updated UI components in the reader screen for better user experience and added navigation buttons for chapters.
- Bumped version to 1.0.3+4 in pubspec.yaml.
This commit is contained in:
2026-04-24 03:03:32 +07:00
parent 2b8fa4ee57
commit 66613857e8
11 changed files with 1112 additions and 447 deletions
+6
View File
@@ -10,6 +10,7 @@ class ReadingSettings {
this.horizontalPadding = 20,
this.paragraphSpacing = 24,
this.textAlign = 'left',
this.enableSentenceTapTts = false,
});
final double fontSize;
@@ -22,6 +23,7 @@ class ReadingSettings {
final double horizontalPadding;
final double paragraphSpacing;
final String textAlign;
final bool enableSentenceTapTts;
ReadingSettings copyWith({
double? fontSize,
@@ -34,6 +36,7 @@ class ReadingSettings {
double? horizontalPadding,
double? paragraphSpacing,
String? textAlign,
bool? enableSentenceTapTts,
}) =>
ReadingSettings(
fontSize: fontSize ?? this.fontSize,
@@ -46,6 +49,7 @@ class ReadingSettings {
horizontalPadding: horizontalPadding ?? this.horizontalPadding,
paragraphSpacing: paragraphSpacing ?? this.paragraphSpacing,
textAlign: textAlign ?? this.textAlign,
enableSentenceTapTts: enableSentenceTapTts ?? this.enableSentenceTapTts,
);
factory ReadingSettings.fromJson(Map<String, dynamic> json) => ReadingSettings(
@@ -60,6 +64,7 @@ class ReadingSettings {
horizontalPadding: (json['horizontalPadding'] as num?)?.toDouble() ?? 20,
paragraphSpacing: (json['paragraphSpacing'] as num?)?.toDouble() ?? 24,
textAlign: json['textAlign'] as String? ?? 'left',
enableSentenceTapTts: json['enableSentenceTapTts'] as bool? ?? false,
);
Map<String, dynamic> toJson() => {
@@ -73,5 +78,6 @@ class ReadingSettings {
'horizontalPadding': horizontalPadding,
'paragraphSpacing': paragraphSpacing,
'textAlign': textAlign,
'enableSentenceTapTts': enableSentenceTapTts,
};
}