minor
This commit is contained in:
parent
f86673ebcb
commit
23f1ce5da5
@ -13,7 +13,6 @@ class MyTheme {
|
|||||||
static const Color border = Color(0xFFCCCCCC);
|
static const Color border = Color(0xFFCCCCCC);
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/huangjianke/flutter_easyloading
|
|
||||||
void showLoading(String text) {
|
void showLoading(String text) {
|
||||||
dismissLoading();
|
dismissLoading();
|
||||||
EasyLoading.show(status: text);
|
EasyLoading.show(status: text);
|
||||||
@ -32,7 +31,6 @@ bool _hasDialog = false;
|
|||||||
typedef BuildAlertDailog = Tuple3<Widget, Widget, List<Widget>> Function(
|
typedef BuildAlertDailog = Tuple3<Widget, Widget, List<Widget>> Function(
|
||||||
void Function(void Function()));
|
void Function(void Function()));
|
||||||
|
|
||||||
// https://material.io/develop/flutter/components/dialogs
|
|
||||||
Future<T> showAlertDialog<T>(BuildContext context, BuildAlertDailog build,
|
Future<T> showAlertDialog<T>(BuildContext context, BuildAlertDailog build,
|
||||||
[WillPopCallback onWillPop,
|
[WillPopCallback onWillPop,
|
||||||
bool barrierDismissible = false,
|
bool barrierDismissible = false,
|
||||||
|
@ -22,7 +22,6 @@ typedef F3 = void Function(Pointer<Utf8>, Pointer<Utf8>);
|
|||||||
typedef F4 = void Function(Pointer<RgbaFrame>);
|
typedef F4 = void Function(Pointer<RgbaFrame>);
|
||||||
typedef F5 = Pointer<RgbaFrame> Function();
|
typedef F5 = Pointer<RgbaFrame> Function();
|
||||||
|
|
||||||
// https://juejin.im/post/6844903864852807694
|
|
||||||
class FfiModel with ChangeNotifier {
|
class FfiModel with ChangeNotifier {
|
||||||
PeerInfo _pi;
|
PeerInfo _pi;
|
||||||
Display _display;
|
Display _display;
|
||||||
@ -63,6 +62,7 @@ class FfiModel with ChangeNotifier {
|
|||||||
BuildContext context,
|
BuildContext context,
|
||||||
void Function(Map<String, dynamic> evt, String id, BuildContext context)
|
void Function(Map<String, dynamic> evt, String id, BuildContext context)
|
||||||
handleMsgbox) {
|
handleMsgbox) {
|
||||||
|
var pos;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
var evt = FFI.popEvent();
|
var evt = FFI.popEvent();
|
||||||
if (evt == null) break;
|
if (evt == null) break;
|
||||||
@ -78,11 +78,12 @@ class FfiModel with ChangeNotifier {
|
|||||||
} else if (name == 'cursor_id') {
|
} else if (name == 'cursor_id') {
|
||||||
FFI.cursorModel.updateCursorId(evt);
|
FFI.cursorModel.updateCursorId(evt);
|
||||||
} else if (name == 'cursor_position') {
|
} else if (name == 'cursor_position') {
|
||||||
FFI.cursorModel.updateCursorPosition(evt);
|
pos = evt;
|
||||||
} else if (name == 'permission') {
|
} else if (name == 'permission') {
|
||||||
FFI.ffiModel.updatePermission(evt);
|
FFI.ffiModel.updatePermission(evt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (pos != null) FFI.cursorModel.updateCursorPosition(pos);
|
||||||
if (!_decoding) {
|
if (!_decoding) {
|
||||||
var rgba = FFI.getRgba();
|
var rgba = FFI.getRgba();
|
||||||
if (rgba != null) {
|
if (rgba != null) {
|
||||||
@ -343,7 +344,6 @@ class FFI {
|
|||||||
var p = _getByName(Utf8.toUtf8(name), Utf8.toUtf8(arg));
|
var p = _getByName(Utf8.toUtf8(name), Utf8.toUtf8(arg));
|
||||||
assert(p != nullptr && p != null);
|
assert(p != nullptr && p != null);
|
||||||
var res = Utf8.fromUtf8(p);
|
var res = Utf8.fromUtf8(p);
|
||||||
// https://github.com/brickpop/flutter-rust-ffi
|
|
||||||
_freeCString(p);
|
_freeCString(p);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ class RemotePage extends StatefulWidget {
|
|||||||
_RemotePageState createState() => _RemotePageState();
|
_RemotePageState createState() => _RemotePageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/hanxu317317/flutter_plan_demo/blob/master/lib/src/enter.dart
|
|
||||||
class _RemotePageState extends State<RemotePage> {
|
class _RemotePageState extends State<RemotePage> {
|
||||||
Timer _interval;
|
Timer _interval;
|
||||||
bool _showBar = true;
|
bool _showBar = true;
|
||||||
@ -34,7 +33,6 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
FFI.connect(widget.id);
|
FFI.connect(widget.id);
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
// https://stackoverflow.com/questions/46640116/make-flutter-application-fullscreen
|
|
||||||
SystemChrome.setEnabledSystemUIOverlays([]);
|
SystemChrome.setEnabledSystemUIOverlays([]);
|
||||||
showLoading('Connecting...');
|
showLoading('Connecting...');
|
||||||
_interval =
|
_interval =
|
||||||
@ -82,8 +80,8 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// Size size = MediaQueryData.fromWindow(ui.window).size;
|
print('${MediaQueryData.fromWindow(ui.window).size}');
|
||||||
// MediaQuery.of(context).size.height;
|
print('${MediaQuery.of(context).size}');
|
||||||
EasyLoading.instance.loadingStyle = EasyLoadingStyle.light;
|
EasyLoading.instance.loadingStyle = EasyLoadingStyle.light;
|
||||||
return WillPopScope(
|
return WillPopScope(
|
||||||
onWillPop: () async {
|
onWillPop: () async {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user