more web api

This commit is contained in:
open-trade
2022-01-26 19:00:23 +08:00
parent 3d77365edc
commit 16218a731b
7 changed files with 34 additions and 32 deletions

View File

@@ -78,7 +78,8 @@ class _RemotePageState extends State<RemotePage> {
return _bottom >= 100;
}
void interval() {
// crash on web before widgit initiated.
void intervalUnsafe() {
var v = MediaQuery.of(context).viewInsets.bottom;
if (v != _bottom) {
resetTool();
@@ -92,6 +93,12 @@ class _RemotePageState extends State<RemotePage> {
FFI.ffiModel.update(widget.id, context, handleMsgbox);
}
void interval() {
try {
intervalUnsafe();
} catch (e) {}
}
void handleMsgbox(Map<String, dynamic> evt, String id) {
var type = evt['type'];
var title = evt['title'];