mirror of
https://github.com/venera-app/venera.git
synced 2025-12-17 07:21:15 +00:00
Compare commits
1 Commits
feat/js-di
...
fix/deb-de
| Author | SHA1 | Date | |
|---|---|---|---|
| dd00ba11c8 |
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
|
||||||
|
|||||||
@@ -1334,7 +1334,7 @@ let UI = {
|
|||||||
* Show an input dialog
|
* Show an input dialog
|
||||||
* @param title {string}
|
* @param title {string}
|
||||||
* @param validator {(string) => string | null | undefined} - A function that validates the input. If the function returns a string, the dialog will show the error message.
|
* @param validator {(string) => string | null | undefined} - A function that validates the input. If the function returns a string, the dialog will show the error message.
|
||||||
* @param image {string | ArrayBuffer | null | undefined} - Since 1.4.6, you can pass an image url to show an image in the dialog. Since 1.5.3, you can also pass an ArrayBuffer to show a custom image.
|
* @param image {string?} - Available since 1.4.6. An optional image to show in the dialog. You can use this to show a captcha.
|
||||||
* @returns {Promise<string | null>} - The input value. If the dialog is canceled, return null.
|
* @returns {Promise<string | null>} - The input value. If the dialog is canceled, return null.
|
||||||
*/
|
*/
|
||||||
showInputDialog: (title, validator, image) => {
|
showInputDialog: (title, validator, image) => {
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import 'dart:typed_data';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_qjs/flutter_qjs.dart';
|
import 'package:flutter_qjs/flutter_qjs.dart';
|
||||||
import 'package:url_launcher/url_launcher_string.dart';
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
@@ -42,6 +40,7 @@ mixin class JsUiApi {
|
|||||||
var image = message['image'];
|
var image = message['image'];
|
||||||
if (title is! String) return;
|
if (title is! String) return;
|
||||||
if (validator != null && validator is! JSInvokable) return;
|
if (validator != null && validator is! JSInvokable) return;
|
||||||
|
if (image != null && image is! String) return;
|
||||||
return _showInputDialog(title, validator, image);
|
return _showInputDialog(title, validator, image);
|
||||||
case 'showSelectDialog':
|
case 'showSelectDialog':
|
||||||
var title = message['title'];
|
var title = message['title'];
|
||||||
@@ -127,25 +126,13 @@ mixin class JsUiApi {
|
|||||||
controller?.close();
|
controller?.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String?> _showInputDialog(String title, JSInvokable? validator, dynamic image) async {
|
Future<String?> _showInputDialog(String title, JSInvokable? validator, String? image) async {
|
||||||
String? result;
|
String? result;
|
||||||
var func = validator == null ? null : JSAutoFreeFunction(validator);
|
var func = validator == null ? null : JSAutoFreeFunction(validator);
|
||||||
String? imageUrl;
|
|
||||||
Uint8List? imageData;
|
|
||||||
if (image != null) {
|
|
||||||
if (image is String) {
|
|
||||||
imageUrl = image;
|
|
||||||
} else if (image is Uint8List) {
|
|
||||||
imageData = image;
|
|
||||||
} else if (image is List<int>) {
|
|
||||||
imageData = Uint8List.fromList(image);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await showInputDialog(
|
await showInputDialog(
|
||||||
context: App.rootContext,
|
context: App.rootContext,
|
||||||
title: title,
|
title: title,
|
||||||
image: imageUrl,
|
image: image,
|
||||||
imageData: imageData,
|
|
||||||
onConfirm: (v) {
|
onConfirm: (v) {
|
||||||
if (func != null) {
|
if (func != null) {
|
||||||
var res = func.call([v]);
|
var res = func.call([v]);
|
||||||
|
|||||||
@@ -360,7 +360,6 @@ Future<void> showInputDialog({
|
|||||||
String cancelText = "Cancel",
|
String cancelText = "Cancel",
|
||||||
RegExp? inputValidator,
|
RegExp? inputValidator,
|
||||||
String? image,
|
String? image,
|
||||||
Uint8List? imageData,
|
|
||||||
}) {
|
}) {
|
||||||
var controller = TextEditingController(text: initialValue);
|
var controller = TextEditingController(text: initialValue);
|
||||||
bool isLoading = false;
|
bool isLoading = false;
|
||||||
@@ -380,11 +379,6 @@ Future<void> showInputDialog({
|
|||||||
height: 108,
|
height: 108,
|
||||||
child: Image.network(image, fit: BoxFit.none),
|
child: Image.network(image, fit: BoxFit.none),
|
||||||
).paddingBottom(8),
|
).paddingBottom(8),
|
||||||
if (image == null && imageData != null)
|
|
||||||
SizedBox(
|
|
||||||
height: 108,
|
|
||||||
child: Image.memory(imageData, fit: BoxFit.none),
|
|
||||||
).paddingBottom(8),
|
|
||||||
TextField(
|
TextField(
|
||||||
controller: controller,
|
controller: controller,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
|||||||
@@ -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