feat: Enhance TTS player functionality and UI
- Added resume functionality to TTS player when paused. - Display voice name or language in TTS player UI. - Improved error handling in reader provider with debug messages. - Updated TTS service to configure Vietnamese voice and handle platform-specific audio settings. - Removed wakelock dependency and related code. - Fixed search screen error handling. - Updated settings screen to navigate to home after sign out. - Improved splash screen with timer management. - Enhanced main app error handling with logging. - Removed unused package_info_plus and wakelock_plus dependencies. - Added environment variable support for mobile runtime. - Integrated Google Sign-In configuration for Android. - Created logging observer for Riverpod providers. - Added scripts for environment setup and Google Sign-In validation.
This commit is contained in:
@@ -41,13 +41,24 @@ class NovelModel extends Equatable {
|
||||
final SeriesModel? series;
|
||||
final LatestChapterInfo? latestChapter;
|
||||
|
||||
static String _stringValue(dynamic value, {String fallback = ''}) {
|
||||
if (value is String) return value;
|
||||
if (value == null) return fallback;
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
static int _intValue(dynamic value, {int fallback = 0}) {
|
||||
if (value is num) return value.toInt();
|
||||
return fallback;
|
||||
}
|
||||
|
||||
factory NovelModel.fromJson(Map<String, dynamic> json) => NovelModel(
|
||||
id: json['id'] as String,
|
||||
title: json['title'] as String,
|
||||
slug: json['slug'] as String,
|
||||
authorName: json['authorName'] as String,
|
||||
status: json['status'] as String,
|
||||
totalChapters: (json['totalChapters'] as num).toInt(),
|
||||
id: _stringValue(json['id']),
|
||||
title: _stringValue(json['title'], fallback: 'Không rõ tiêu đề'),
|
||||
slug: _stringValue(json['slug']),
|
||||
authorName: _stringValue(json['authorName'], fallback: 'Chưa rõ tác giả'),
|
||||
status: _stringValue(json['status'], fallback: 'Đang ra'),
|
||||
totalChapters: _intValue(json['totalChapters']),
|
||||
originalTitle: json['originalTitle'] as String?,
|
||||
description: json['description'] as String?,
|
||||
coverUrl: json['coverUrl'] as String?,
|
||||
|
||||
Reference in New Issue
Block a user