mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
add loginWithWebview, mixed explore page, app links, html node api;
improve ui
This commit is contained in:
@@ -197,6 +197,8 @@ class ComicSource {
|
||||
|
||||
final HandleClickTagEvent? handleClickTagEvent;
|
||||
|
||||
final LinkHandler? linkHandler;
|
||||
|
||||
Future<void> loadData() async {
|
||||
var file = File("${App.dataPath}/comic_source/$key.data");
|
||||
if (await file.exists()) {
|
||||
@@ -261,14 +263,13 @@ class ComicSource {
|
||||
this.idMatcher,
|
||||
this.translations,
|
||||
this.handleClickTagEvent,
|
||||
this.linkHandler,
|
||||
);
|
||||
}
|
||||
|
||||
class AccountConfig {
|
||||
final LoginFunction? login;
|
||||
|
||||
final FutureOr<void> Function(BuildContext)? onLogin;
|
||||
|
||||
final String? loginWebsite;
|
||||
|
||||
final String? registerWebsite;
|
||||
@@ -279,10 +280,15 @@ class AccountConfig {
|
||||
|
||||
final List<AccountInfoItem> infoItems;
|
||||
|
||||
final bool Function(String url, String title)? checkLoginStatus;
|
||||
|
||||
const AccountConfig(
|
||||
this.login, this.loginWebsite, this.registerWebsite, this.logout,
|
||||
{this.onLogin})
|
||||
: allowReLogin = true,
|
||||
this.login,
|
||||
this.loginWebsite,
|
||||
this.registerWebsite,
|
||||
this.logout,
|
||||
this.checkLoginStatus,
|
||||
) : allowReLogin = true,
|
||||
infoItems = const [];
|
||||
}
|
||||
|
||||
@@ -315,11 +321,13 @@ class ExplorePageData {
|
||||
/// return a `List` contains `List<Comic>` or `ExplorePagePart`
|
||||
final Future<Res<List<Object>>> Function(int index)? loadMixed;
|
||||
|
||||
final WidgetBuilder? overridePageBuilder;
|
||||
|
||||
ExplorePageData(this.title, this.type, this.loadPage, this.loadMultiPart)
|
||||
: loadMixed = null,
|
||||
overridePageBuilder = null;
|
||||
ExplorePageData(
|
||||
this.title,
|
||||
this.type,
|
||||
this.loadPage,
|
||||
this.loadMultiPart,
|
||||
this.loadMixed,
|
||||
);
|
||||
}
|
||||
|
||||
class ExplorePagePart {
|
||||
@@ -422,3 +430,12 @@ class CategoryComicsOptions {
|
||||
|
||||
const CategoryComicsOptions(this.options, this.notShowWhen, this.showWhen);
|
||||
}
|
||||
|
||||
|
||||
class LinkHandler {
|
||||
final List<String> domains;
|
||||
|
||||
final String? Function(String url) linkToId;
|
||||
|
||||
const LinkHandler(this.domains, this.linkToId);
|
||||
}
|
Reference in New Issue
Block a user