improve enter os password

This commit is contained in:
open-trade 2020-12-21 21:52:20 +08:00
parent 8455c69733
commit a238b6a10a
4 changed files with 40 additions and 30 deletions

View File

@ -445,8 +445,8 @@ class CursorModel with ChangeNotifier {
void updateDisplayOrigin(double x, double y) {
_displayOriginX = x;
_displayOriginY = y;
_x = x;
_y = y;
_x = x + 1;
_y = y + 1;
FFI.moveMouse(x, y);
FFI.canvasModel.resetOffset();
notifyListeners();

View File

@ -751,7 +751,7 @@ void showOptions(BuildContext context) {
}, () async => true, true, 0);
}
void showActions(BuildContext context) async {
void showActions(BuildContext context) {
final size = MediaQuery.of(context).size;
final x = 120.0;
final y = size.height;
@ -763,7 +763,6 @@ void showActions(BuildContext context) async {
FFI.ffiModel.permissions['clipboard'] != false) {
more.add(PopupMenuItem<String>(child: Text('Paste'), value: 'paste'));
}
var password = await getPassword(FFI.id);
more.add(PopupMenuItem<String>(
child: Row(
children: ([
@ -804,10 +803,21 @@ void showActions(BuildContext context) async {
}
}();
} else if (value == 'enter_os_password') {
if (password != "") {
FFI.setByName('input_string', password);
FFI.inputKey('VK_RETURN');
}
() async {
var password = await getPassword(FFI.id);
if (password != "") {
var x = FFI.cursorModel.x;
var y = FFI.cursorModel.y;
FFI.moveMouse(x + 3, y + 3);
await Future.delayed(Duration(milliseconds: 50));
FFI.moveMouse(x, y);
await Future.delayed(Duration(milliseconds: 50));
FFI.tap(true);
await Future.delayed(Duration(milliseconds: 300));
FFI.setByName('input_string', password);
FFI.inputKey('VK_RETURN');
}
}();
}
}();
}

View File

@ -21,42 +21,42 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.3"
version: "2.5.0-nullsafety.1"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.0-nullsafety.1"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.5"
version: "1.1.0-nullsafety.3"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.2.0-nullsafety.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.1.0-nullsafety.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.5"
version: "1.15.0-nullsafety.3"
convert:
dependency: transitive
description:
@ -84,7 +84,7 @@ packages:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
version: "1.0.0"
device_info:
dependency: "direct main"
description:
@ -105,7 +105,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.2.0-nullsafety.1"
ffi:
dependency: "direct main"
description:
@ -255,21 +255,21 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3-nullsafety.3"
version: "0.6.2"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10-nullsafety.3"
version: "0.12.10-nullsafety.1"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.6"
version: "1.3.0-nullsafety.3"
nested:
dependency: transitive
description:
@ -290,7 +290,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.3"
version: "1.8.0-nullsafety.1"
path_provider:
dependency: "direct main"
description:
@ -428,42 +428,42 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.4"
version: "1.8.0-nullsafety.2"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.6"
version: "1.10.0-nullsafety.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.0-nullsafety.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.1.0-nullsafety.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.2.0-nullsafety.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19-nullsafety.6"
version: "0.2.19-nullsafety.2"
tuple:
dependency: "direct main"
description:
@ -477,7 +477,7 @@ packages:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.5"
version: "1.3.0-nullsafety.3"
url_launcher:
dependency: "direct main"
description:
@ -526,7 +526,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.5"
version: "2.1.0-nullsafety.3"
wakelock:
dependency: "direct main"
description:
@ -577,5 +577,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.12.0-0.0 <3.0.0"
dart: ">=2.10.0-110 <2.11.0"
flutter: ">=1.22.0 <2.0.0"

View File

@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.1.0
version: 1.1.1
environment:
sdk: ">=2.7.0 <3.0.0"