This commit is contained in:
ekibun
2021-02-22 13:07:53 +08:00
parent 7fe4f5e431
commit 8fb26b20af
12 changed files with 385 additions and 362 deletions

View File

@@ -58,7 +58,7 @@ class CodeInputController extends TextEditingController {
String oldText = oldSpan.toPlainText();
String newText = value.text;
if (oldText == newText) return oldSpan;
(spanCall?.timeout(Duration.zero) ?? Future.delayed(Duration.zero))
(spanCall?.timeout(Duration.zero) ?? Future.value())
.then((_) => spanCall = compute(_convert, value.text).then((lsSpan) {
TextSpan newSpan = TextSpan(style: style, children: lsSpan);
if (newSpan.toPlainText() == value.text) oldSpan = newSpan;

View File

@@ -53,7 +53,6 @@ class _TestPageState extends State<TestPage> {
if (engine != null) return;
engine = IsolateQjs(
moduleHandler: (String module) async {
if (module == "test") return "export default '${new DateTime.now()}'";
return await rootBundle.loadString(
"js/" + module.replaceFirst(new RegExp(r".js$"), "") + ".js");
},