mirror of
https://github.com/venera-app/venera.git
synced 2025-12-16 23:11:15 +00:00
Compare commits
4 Commits
b08f11f6ac
...
fix/deb-de
| Author | SHA1 | Date | |
|---|---|---|---|
| dd00ba11c8 | |||
| 09a1d2821c | |||
|
|
7842b5a1ac | ||
|
|
079f574e2f |
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@@ -143,7 +143,7 @@ jobs:
|
|||||||
- run: |
|
- run: |
|
||||||
sudo apt-get update -y
|
sudo apt-get update -y
|
||||||
sudo apt-get install -y ninja-build libgtk-3-dev webkit2gtk-4.1
|
sudo apt-get install -y ninja-build libgtk-3-dev webkit2gtk-4.1
|
||||||
dart pub global activate flutter_to_debian
|
dart pub global activate flutter_to_debian --source git https://github.com/venera-app/flutter_to_debian.git
|
||||||
- run: python3 debian/build.py x64
|
- run: python3 debian/build.py x64
|
||||||
- run: dart run flutter_to_arch
|
- run: dart run flutter_to_arch
|
||||||
- run: |
|
- run: |
|
||||||
@@ -171,7 +171,7 @@ jobs:
|
|||||||
flutter pub get
|
flutter pub get
|
||||||
sudo apt-get update -y
|
sudo apt-get update -y
|
||||||
sudo apt-get install -y ninja-build libgtk-3-dev webkit2gtk-4.1
|
sudo apt-get install -y ninja-build libgtk-3-dev webkit2gtk-4.1
|
||||||
dart pub global activate flutter_to_debian
|
dart pub global activate flutter_to_debian --source git https://github.com/venera-app/flutter_to_debian.git
|
||||||
- name: "Patch font"
|
- name: "Patch font"
|
||||||
run: |
|
run: |
|
||||||
dart run patch/font.dart
|
dart run patch/font.dart
|
||||||
|
|||||||
@@ -181,7 +181,15 @@ abstract class ImageDownloader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (configs['onResponse'] is JSInvokable) {
|
if (configs['onResponse'] is JSInvokable) {
|
||||||
buffer = (configs['onResponse'] as JSInvokable)([Uint8List.fromList(buffer)]);
|
dynamic result = (configs['onResponse'] as JSInvokable)([Uint8List.fromList(buffer)]);
|
||||||
|
if (result is Future) {
|
||||||
|
result = await result;
|
||||||
|
}
|
||||||
|
if (result is List<int>) {
|
||||||
|
buffer = result;
|
||||||
|
} else {
|
||||||
|
throw "Error: Invalid onResponse result.";
|
||||||
|
}
|
||||||
(configs['onResponse'] as JSInvokable).free();
|
(configs['onResponse'] as JSInvokable).free();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -197,11 +197,12 @@ class _NetworkSectionState extends State<_NetworkSection> {
|
|||||||
if (res.subData is List) {
|
if (res.subData is List) {
|
||||||
final list = List<String>.from(res.subData);
|
final list = List<String>.from(res.subData);
|
||||||
if (list.isNotEmpty) {
|
if (list.isNotEmpty) {
|
||||||
addedFolders = {list.first};
|
addedFolders = list.toSet();
|
||||||
|
localIsFavorite = true;
|
||||||
} else {
|
} else {
|
||||||
addedFolders.clear();
|
addedFolders.clear();
|
||||||
|
localIsFavorite = false;
|
||||||
}
|
}
|
||||||
localIsFavorite = addedFolders.isNotEmpty;
|
|
||||||
} else {
|
} else {
|
||||||
addedFolders.clear();
|
addedFolders.clear();
|
||||||
localIsFavorite = false;
|
localIsFavorite = false;
|
||||||
@@ -352,62 +353,6 @@ class _NetworkSectionState extends State<_NetworkSection> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMultiFolder() {
|
Widget _buildMultiFolder() {
|
||||||
if (localIsFavorite == true &&
|
|
||||||
widget.comicSource.favoriteData!.singleFolderForSingleComic) {
|
|
||||||
return ListTile(
|
|
||||||
title: Row(
|
|
||||||
children: [
|
|
||||||
Text("Network Favorites".tl),
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
Container(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: context.colorScheme.primaryContainer,
|
|
||||||
borderRadius: BorderRadius.circular(12),
|
|
||||||
),
|
|
||||||
child: Text("Added".tl, style: ts.s12),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
trailing: isLoading
|
|
||||||
? const SizedBox(
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
child: CircularProgressIndicator(strokeWidth: 2),
|
|
||||||
)
|
|
||||||
: _HoverButton(
|
|
||||||
isFavorite: true,
|
|
||||||
onTap: () async {
|
|
||||||
setState(() {
|
|
||||||
isLoading = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
var res = await widget
|
|
||||||
.comicSource
|
|
||||||
.favoriteData!
|
|
||||||
.addOrDelFavorite!(widget.cid, '', false, null);
|
|
||||||
if (res.success) {
|
|
||||||
// Invalidate network cache so subsequent loads see latest
|
|
||||||
NetworkCacheManager().clear();
|
|
||||||
setState(() {
|
|
||||||
localIsFavorite = false;
|
|
||||||
});
|
|
||||||
widget.onFavorite(false);
|
|
||||||
App.rootContext.showMessage(message: "Removed".tl);
|
|
||||||
if (appdata.settings['autoCloseFavoritePanel'] ?? false) {
|
|
||||||
context.pop();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
context.showMessage(message: res.errorMessage!);
|
|
||||||
}
|
|
||||||
setState(() {
|
|
||||||
isLoading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@@ -425,8 +370,10 @@ class _NetworkSectionState extends State<_NetworkSection> {
|
|||||||
var name = entry.value;
|
var name = entry.value;
|
||||||
var id = entry.key;
|
var id = entry.key;
|
||||||
var isAdded = addedFolders.contains(id);
|
var isAdded = addedFolders.contains(id);
|
||||||
var hasSelection = addedFolders.isNotEmpty;
|
// When `singleFolderForSingleComic` is `false`, all add and remove buttons are clickable.
|
||||||
var enabled = !hasSelection || isAdded;
|
// When `singleFolderForSingleComic` is `true`, the remove button is always clickable,
|
||||||
|
// while the add button is only clickable if the comic has not been added to any list.
|
||||||
|
var enabled = !(widget.comicSource.favoriteData!.singleFolderForSingleComic && addedFolders.isNotEmpty && !isAdded);
|
||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Row(
|
title: Row(
|
||||||
@@ -469,11 +416,9 @@ class _NetworkSectionState extends State<_NetworkSection> {
|
|||||||
NetworkCacheManager().clear();
|
NetworkCacheManager().clear();
|
||||||
setState(() {
|
setState(() {
|
||||||
if (isAdded) {
|
if (isAdded) {
|
||||||
addedFolders.clear();
|
addedFolders.remove(id);
|
||||||
} else {
|
} else {
|
||||||
addedFolders
|
addedFolders.add(id);
|
||||||
..clear()
|
|
||||||
..add(id);
|
|
||||||
}
|
}
|
||||||
// sync local flag for single-folder-per-comic logic and parent
|
// sync local flag for single-folder-per-comic logic and parent
|
||||||
localIsFavorite = addedFolders.isNotEmpty;
|
localIsFavorite = addedFolders.isNotEmpty;
|
||||||
|
|||||||
@@ -478,10 +478,11 @@ packages:
|
|||||||
flutter_to_debian:
|
flutter_to_debian:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: flutter_to_debian
|
path: "."
|
||||||
sha256: d23534407334b331ce20fbaa8395b9ecc255d0c047136b8998715f36933ee696
|
ref: HEAD
|
||||||
url: "https://pub.dev"
|
resolved-ref: "3777c91b6b1cc0b7c03357c67ca216d4313c3db5"
|
||||||
source: hosted
|
url: "https://github.com/venera-app/flutter_to_debian.git"
|
||||||
|
source: git
|
||||||
version: "2.0.2"
|
version: "2.0.2"
|
||||||
flutter_web_plugins:
|
flutter_web_plugins:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
|
|||||||
@@ -93,7 +93,9 @@ dev_dependencies:
|
|||||||
sdk: flutter
|
sdk: flutter
|
||||||
flutter_lints: ^5.0.0
|
flutter_lints: ^5.0.0
|
||||||
flutter_to_arch: ^1.0.1
|
flutter_to_arch: ^1.0.1
|
||||||
flutter_to_debian: ^2.0.2
|
flutter_to_debian:
|
||||||
|
git:
|
||||||
|
url: https://github.com/venera-app/flutter_to_debian.git
|
||||||
archive: any
|
archive: any
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
|
|||||||
Reference in New Issue
Block a user