add sp and support save the width and height

This commit is contained in:
Siyi Guo committed 2023-04-13 15:21:40 +08:00
1 parent 1c53032b3f
commit 595ee6fd6a
9 files changed
+187 -10

No files matched your search

+1 -5
View File
@@ -28,7 +28,6 @@ class _ImagePageState extends State<ImagePage> with WindowListener {
double offsetDy1 = 0;
double offsetDx2 = 0;
double offsetDy2 = 0;
var windowFocusNode = FocusNode(canRequestFocus: false);
@override
Widget build(BuildContext context) {
@@ -84,7 +83,6 @@ class _ImagePageState extends State<ImagePage> with WindowListener {
moveChanged: (dx, dy) {
offsetDx1 = dx;
offsetDy1 = dy;
// setState(() {});
},
dx: offsetDx1,
dy: offsetDy1,
@@ -97,8 +95,6 @@ class _ImagePageState extends State<ImagePage> with WindowListener {
moveChanged: (dx, dy) {
offsetDx2 = dx;
offsetDy2 = dy;
windowFocusNode.unfocus();
// setState(() {});
},
dx: offsetDx2,
dy: offsetDy2,
@@ -119,10 +115,10 @@ class _ImagePageState extends State<ImagePage> with WindowListener {
double dy = 0,
Function(double dx, double dy)? moveChanged,
}) {
var width = MediaQuery.of(context).size.width - 100;
if (!show || imageFile == null) {
return const SizedBox();
}
var width = MediaQuery.of(context).size.width - 100;
return DraggableArea(
key: ValueKey('${DateTime.now()}'),
dx: dx,