2020-11-17 01:22:14 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'common.dart';
|
|
|
|
import 'package:flutter/services.dart';
|
2020-11-17 11:12:55 +08:00
|
|
|
import 'dart:ui' as ui;
|
2020-11-17 01:22:14 +08:00
|
|
|
|
|
|
|
class RemotePage extends StatefulWidget {
|
|
|
|
RemotePage({Key key, this.id}) : super(key: key);
|
|
|
|
|
|
|
|
final String id;
|
|
|
|
|
|
|
|
@override
|
|
|
|
_RemotePageState createState() => _RemotePageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _RemotePageState extends State<RemotePage> {
|
2020-11-17 11:12:55 +08:00
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
FFI.connect(widget.id);
|
|
|
|
}
|
2020-11-17 01:22:14 +08:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
// https://stackoverflow.com/questions/46640116/make-flutter-application-fullscreen
|
|
|
|
SystemChrome.setEnabledSystemUIOverlays([]);
|
2020-11-17 11:12:55 +08:00
|
|
|
return CustomPaint(
|
|
|
|
painter: new ImageEditor(image: null),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class ImageEditor extends CustomPainter {
|
|
|
|
ImageEditor({
|
|
|
|
this.image,
|
|
|
|
});
|
|
|
|
|
|
|
|
ui.Image image;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void paint(Canvas canvas, Size size) {
|
|
|
|
if (image = null) return;
|
|
|
|
canvas.drawImage(image, new Offset(0.0, 0.0), new Paint());
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
bool shouldRepaint(CustomPainter oldDelegate) {
|
|
|
|
return false;
|
2020-11-17 01:22:14 +08:00
|
|
|
}
|
|
|
|
}
|