Replace vocsy_epub_viewer with flutter_epub_viewer to provide an integrated reading experience within the app instead of separate native FolioReader takeover. Key changes: - Replace vocsy_epub_viewer with flutter_epub_viewer (1.2.2) for WebView-based EPUB rendering - Add EpubReaderScreen with CFI-based position tracking and progress restoration - Add EpubDownloadService with download progress tracking - Update database schema to add epub_location field for CFI storage - Enhance ReadingProgress model to support EPUB locations as JSON - Update PublicationDetailScreen to route to appropriate reader (EPUB vs image) - Add EPUB reader route configuration - Update Android configuration (NDK 25.1.8937393, network permissions) - Add loading progress bar showing download and processing status Benefits: - Integrated Flutter widget stays within app - CFI-based position tracking works cross-platform - Chapter navigation and search functionality - Better UI customization and theme integration Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
285 lines
9.2 KiB
Dart
285 lines
9.2 KiB
Dart
// coverage:ignore-file
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
// ignore_for_file: type=lint
|
|
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
|
|
|
part of 'opds_stream_link.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
T _$identity<T>(T value) => value;
|
|
|
|
final _privateConstructorUsedError = UnsupportedError(
|
|
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
|
|
|
|
OPDSStreamLink _$OPDSStreamLinkFromJson(Map<String, dynamic> json) {
|
|
return _OPDSStreamLink.fromJson(json);
|
|
}
|
|
|
|
/// @nodoc
|
|
mixin _$OPDSStreamLink {
|
|
/// URL template with {pageNumber} and optionally {maxWidth} placeholders
|
|
/// This should be an absolute URL (resolved against server base URL during parsing)
|
|
String get href => throw _privateConstructorUsedError;
|
|
|
|
/// Image MIME type (image/jpeg, image/png, image/gif)
|
|
String get type => throw _privateConstructorUsedError;
|
|
|
|
/// Total number of pages
|
|
int get pageCount => throw _privateConstructorUsedError;
|
|
|
|
/// Last read page (0-indexed), null if never read
|
|
int? get lastRead => throw _privateConstructorUsedError;
|
|
|
|
/// Last read timestamp
|
|
DateTime? get lastReadDate => throw _privateConstructorUsedError;
|
|
|
|
/// Serializes this OPDSStreamLink to a JSON map.
|
|
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
|
|
|
/// Create a copy of OPDSStreamLink
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
$OPDSStreamLinkCopyWith<OPDSStreamLink> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class $OPDSStreamLinkCopyWith<$Res> {
|
|
factory $OPDSStreamLinkCopyWith(
|
|
OPDSStreamLink value, $Res Function(OPDSStreamLink) then) =
|
|
_$OPDSStreamLinkCopyWithImpl<$Res, OPDSStreamLink>;
|
|
@useResult
|
|
$Res call(
|
|
{String href,
|
|
String type,
|
|
int pageCount,
|
|
int? lastRead,
|
|
DateTime? lastReadDate});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$OPDSStreamLinkCopyWithImpl<$Res, $Val extends OPDSStreamLink>
|
|
implements $OPDSStreamLinkCopyWith<$Res> {
|
|
_$OPDSStreamLinkCopyWithImpl(this._value, this._then);
|
|
|
|
// ignore: unused_field
|
|
final $Val _value;
|
|
// ignore: unused_field
|
|
final $Res Function($Val) _then;
|
|
|
|
/// Create a copy of OPDSStreamLink
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? href = null,
|
|
Object? type = null,
|
|
Object? pageCount = null,
|
|
Object? lastRead = freezed,
|
|
Object? lastReadDate = freezed,
|
|
}) {
|
|
return _then(_value.copyWith(
|
|
href: null == href
|
|
? _value.href
|
|
: href // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
type: null == type
|
|
? _value.type
|
|
: type // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
pageCount: null == pageCount
|
|
? _value.pageCount
|
|
: pageCount // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
lastRead: freezed == lastRead
|
|
? _value.lastRead
|
|
: lastRead // ignore: cast_nullable_to_non_nullable
|
|
as int?,
|
|
lastReadDate: freezed == lastReadDate
|
|
? _value.lastReadDate
|
|
: lastReadDate // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,
|
|
) as $Val);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class _$$OPDSStreamLinkImplCopyWith<$Res>
|
|
implements $OPDSStreamLinkCopyWith<$Res> {
|
|
factory _$$OPDSStreamLinkImplCopyWith(_$OPDSStreamLinkImpl value,
|
|
$Res Function(_$OPDSStreamLinkImpl) then) =
|
|
__$$OPDSStreamLinkImplCopyWithImpl<$Res>;
|
|
@override
|
|
@useResult
|
|
$Res call(
|
|
{String href,
|
|
String type,
|
|
int pageCount,
|
|
int? lastRead,
|
|
DateTime? lastReadDate});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$$OPDSStreamLinkImplCopyWithImpl<$Res>
|
|
extends _$OPDSStreamLinkCopyWithImpl<$Res, _$OPDSStreamLinkImpl>
|
|
implements _$$OPDSStreamLinkImplCopyWith<$Res> {
|
|
__$$OPDSStreamLinkImplCopyWithImpl(
|
|
_$OPDSStreamLinkImpl _value, $Res Function(_$OPDSStreamLinkImpl) _then)
|
|
: super(_value, _then);
|
|
|
|
/// Create a copy of OPDSStreamLink
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? href = null,
|
|
Object? type = null,
|
|
Object? pageCount = null,
|
|
Object? lastRead = freezed,
|
|
Object? lastReadDate = freezed,
|
|
}) {
|
|
return _then(_$OPDSStreamLinkImpl(
|
|
href: null == href
|
|
? _value.href
|
|
: href // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
type: null == type
|
|
? _value.type
|
|
: type // ignore: cast_nullable_to_non_nullable
|
|
as String,
|
|
pageCount: null == pageCount
|
|
? _value.pageCount
|
|
: pageCount // ignore: cast_nullable_to_non_nullable
|
|
as int,
|
|
lastRead: freezed == lastRead
|
|
? _value.lastRead
|
|
: lastRead // ignore: cast_nullable_to_non_nullable
|
|
as int?,
|
|
lastReadDate: freezed == lastReadDate
|
|
? _value.lastReadDate
|
|
: lastReadDate // ignore: cast_nullable_to_non_nullable
|
|
as DateTime?,
|
|
));
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
@JsonSerializable()
|
|
class _$OPDSStreamLinkImpl extends _OPDSStreamLink {
|
|
const _$OPDSStreamLinkImpl(
|
|
{required this.href,
|
|
required this.type,
|
|
required this.pageCount,
|
|
this.lastRead,
|
|
this.lastReadDate})
|
|
: super._();
|
|
|
|
factory _$OPDSStreamLinkImpl.fromJson(Map<String, dynamic> json) =>
|
|
_$$OPDSStreamLinkImplFromJson(json);
|
|
|
|
/// URL template with {pageNumber} and optionally {maxWidth} placeholders
|
|
/// This should be an absolute URL (resolved against server base URL during parsing)
|
|
@override
|
|
final String href;
|
|
|
|
/// Image MIME type (image/jpeg, image/png, image/gif)
|
|
@override
|
|
final String type;
|
|
|
|
/// Total number of pages
|
|
@override
|
|
final int pageCount;
|
|
|
|
/// Last read page (0-indexed), null if never read
|
|
@override
|
|
final int? lastRead;
|
|
|
|
/// Last read timestamp
|
|
@override
|
|
final DateTime? lastReadDate;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'OPDSStreamLink(href: $href, type: $type, pageCount: $pageCount, lastRead: $lastRead, lastReadDate: $lastReadDate)';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _$OPDSStreamLinkImpl &&
|
|
(identical(other.href, href) || other.href == href) &&
|
|
(identical(other.type, type) || other.type == type) &&
|
|
(identical(other.pageCount, pageCount) ||
|
|
other.pageCount == pageCount) &&
|
|
(identical(other.lastRead, lastRead) ||
|
|
other.lastRead == lastRead) &&
|
|
(identical(other.lastReadDate, lastReadDate) ||
|
|
other.lastReadDate == lastReadDate));
|
|
}
|
|
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
int get hashCode =>
|
|
Object.hash(runtimeType, href, type, pageCount, lastRead, lastReadDate);
|
|
|
|
/// Create a copy of OPDSStreamLink
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
_$$OPDSStreamLinkImplCopyWith<_$OPDSStreamLinkImpl> get copyWith =>
|
|
__$$OPDSStreamLinkImplCopyWithImpl<_$OPDSStreamLinkImpl>(
|
|
this, _$identity);
|
|
|
|
@override
|
|
Map<String, dynamic> toJson() {
|
|
return _$$OPDSStreamLinkImplToJson(
|
|
this,
|
|
);
|
|
}
|
|
}
|
|
|
|
abstract class _OPDSStreamLink extends OPDSStreamLink {
|
|
const factory _OPDSStreamLink(
|
|
{required final String href,
|
|
required final String type,
|
|
required final int pageCount,
|
|
final int? lastRead,
|
|
final DateTime? lastReadDate}) = _$OPDSStreamLinkImpl;
|
|
const _OPDSStreamLink._() : super._();
|
|
|
|
factory _OPDSStreamLink.fromJson(Map<String, dynamic> json) =
|
|
_$OPDSStreamLinkImpl.fromJson;
|
|
|
|
/// URL template with {pageNumber} and optionally {maxWidth} placeholders
|
|
/// This should be an absolute URL (resolved against server base URL during parsing)
|
|
@override
|
|
String get href;
|
|
|
|
/// Image MIME type (image/jpeg, image/png, image/gif)
|
|
@override
|
|
String get type;
|
|
|
|
/// Total number of pages
|
|
@override
|
|
int get pageCount;
|
|
|
|
/// Last read page (0-indexed), null if never read
|
|
@override
|
|
int? get lastRead;
|
|
|
|
/// Last read timestamp
|
|
@override
|
|
DateTime? get lastReadDate;
|
|
|
|
/// Create a copy of OPDSStreamLink
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
_$$OPDSStreamLinkImplCopyWith<_$OPDSStreamLinkImpl> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|