like a comic

This commit is contained in:
nyne
2024-10-05 08:56:06 +08:00
parent 07dbf6e6af
commit 771feeeaa8
4 changed files with 65 additions and 14 deletions

View File

@@ -3,7 +3,6 @@ library comic_source;
import 'dart:async';
import 'dart:collection';
import 'dart:convert';
import 'dart:io';
import 'dart:math' as math;
import 'package:flutter/widgets.dart';
@@ -45,6 +44,8 @@ typedef GetThumbnailLoadingConfigFunc = Map<String, dynamic> Function(
typedef ComicThumbnailLoader = Future<Res<List<String>>> Function(String comicId, String? next);
typedef LikeOrUnlikeComicFunc = Future<Res<bool>> Function(String comicId, bool isLiking);
class ComicSource {
static final List<ComicSource> _sources = [];
@@ -171,6 +172,8 @@ class ComicSource {
final RegExp? idMatcher;
final LikeOrUnlikeComicFunc? likeOrUnlikeComic;
Future<void> loadData() async {
var file = File("${App.dataPath}/comic_source/$key.data");
if (await file.exists()) {
@@ -229,7 +232,8 @@ class ComicSource {
this.url,
this.version,
this.commentsLoader,
this.sendCommentFunc)
this.sendCommentFunc,
this.likeOrUnlikeComic)
: idMatcher = null;
ComicSource.unknown(this.key)
@@ -252,7 +256,8 @@ class ComicSource {
version = "",
commentsLoader = null,
sendCommentFunc = null,
idMatcher = null;
idMatcher = null,
likeOrUnlikeComic = null;
}
class AccountConfig {