fix on iOS

This commit is contained in:
open-trade 2021-08-17 15:07:01 +08:00
parent 9d37f9f2e3
commit b521175bca
5 changed files with 45 additions and 18 deletions

2
flutter_hbb/build_ios.sh Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
flutter build ipa --release --obfuscate --split-debug-info=./split-debug-info

View File

@ -42,6 +42,7 @@
7E078EE826BAB4710036E738 /* liblibrustdesk.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblibrustdesk.a; path = "../../target/aarch64-apple-ios/release/liblibrustdesk.a"; sourceTree = "<group>"; };
7E078EEA26BABB100036E738 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = "<group>"; };
7E078EEB26BADB3D0036E738 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
7E0A73A826CAB3C100FF94B3 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
94AF76B3E95A41AD3421FB7B /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
@ -110,6 +111,7 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
7E0A73A826CAB3C100FF94B3 /* Runner.entitlements */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
@ -364,6 +366,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = HZF9JMC8YN;
ENABLE_BITCODE = NO;
@ -495,6 +498,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = HZF9JMC8YN;
ENABLE_BITCODE = NO;
@ -520,6 +524,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = HZF9JMC8YN;
ENABLE_BITCODE = NO;

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.networking.wifi-info</key>
<true/>
</dict>
</plist>

View File

@ -8,6 +8,7 @@ import 'package:tuple/tuple.dart';
import 'package:wakelock/wakelock.dart';
import 'common.dart';
import 'model.dart';
import 'dart:io';
final initText = '\1' * 1024;
@ -37,7 +38,7 @@ class _RemotePageState extends State<RemotePage> {
var _more = true;
var _fn = false;
final FocusNode _focusNode = FocusNode();
var _showEdit = true;
var _showEdit = false;
var _reconnects = 1;
@override
@ -172,6 +173,8 @@ class _RemotePageState extends State<RemotePage> {
@override
Widget build(BuildContext context) {
final pi = Provider.of<FfiModel>(context).pi;
final hideKeyboard = Platform.isIOS && _showEdit;
final showActionButton = !_showBar || hideKeyboard;
EasyLoading.instance.loadingStyle = EasyLoadingStyle.light;
return WillPopScope(
onWillPop: () async {
@ -179,14 +182,21 @@ class _RemotePageState extends State<RemotePage> {
return false;
},
child: Scaffold(
floatingActionButton: _showBar
floatingActionButton: !showActionButton
? null
: FloatingActionButton(
mini: true,
child: Icon(Icons.expand_less),
mini: !hideKeyboard,
child: Icon(
hideKeyboard ? Icons.expand_more : Icons.expand_less),
backgroundColor: MyTheme.accent50,
onPressed: () {
setState(() => _showBar = !_showBar);
setState(() {
if (hideKeyboard) {
_showEdit = !_showEdit;
} else {
_showBar = !_showBar;
}
});
}),
bottomNavigationBar: _showBar && pi.displays != null
? BottomAppBar(
@ -337,18 +347,19 @@ class _RemotePageState extends State<RemotePage> {
}
Widget getHelpTools() {
final keyboard = _bottom >= 100;
final keyboard = _showEdit;
if (!_mouseTools && !keyboard) {
return SizedBox();
}
final size = MediaQuery.of(context).size;
var wrap =
(String text, void Function() onPressed, [bool active, IconData icon]) {
return TextButton(
style: TextButton.styleFrom(
minimumSize: Size(0, 0),
padding: EdgeInsets.symmetric(
vertical: icon != null ? 3 : 6,
horizontal: 6), //adds padding inside the button
vertical: 10,
horizontal: 9.75), //adds padding inside the button
tapTargetSize: MaterialTapTargetSize
.shrinkWrap, //limits the touch area to the button area
shape: RoundedRectangleBorder(
@ -394,22 +405,22 @@ class _RemotePageState extends State<RemotePage> {
final pi = FFI.ffiModel.pi;
final isMac = pi.platform == "Mac OS";
final modifiers = <Widget>[
wrap('Ctrl', () {
wrap('Ctrl ', () {
setState(() => FFI.ctrl = !FFI.ctrl);
}, FFI.ctrl),
wrap('Alt', () {
wrap(' Alt ', () {
setState(() => FFI.alt = !FFI.alt);
}, FFI.alt),
wrap('Shift', () {
setState(() => FFI.shift = !FFI.shift);
}, FFI.shift),
wrap(isMac ? 'Cmd' : 'Win', () {
wrap(isMac ? ' Cmd ' : ' Win ', () {
setState(() => FFI.command = !FFI.command);
}, FFI.command),
];
final keys = <Widget>[
wrap(
'Fn',
' Fn ',
() => setState(
() {
_fn = !_fn;
@ -420,7 +431,7 @@ class _RemotePageState extends State<RemotePage> {
),
_fn),
wrap(
'...',
' ... ',
() => setState(
() {
_more = !_more;
@ -460,7 +471,7 @@ class _RemotePageState extends State<RemotePage> {
wrap('PgUp', () {
FFI.inputKey('VK_PRIOR');
}),
wrap('PgDown', () {
wrap('PgDn', () {
FFI.inputKey('VK_NEXT');
}),
SizedBox(width: 9999),
@ -486,13 +497,14 @@ class _RemotePageState extends State<RemotePage> {
sendPrompt(isMac, 'VK_S');
}),
];
final space = size.width > 320 ? 4.0 : 2.0;
return Container(
color: Color(0xAA000000),
padding: EdgeInsets.only(
top: keyboard ? 24 : 4, left: 8, right: 8, bottom: 8),
top: keyboard ? 24 : 4, left: 0, right: 0, bottom: 8),
child: Wrap(
spacing: 4,
runSpacing: 4,
spacing: space,
runSpacing: space,
children: <Widget>[SizedBox(width: 9999)] +
(keyboard
? modifiers + keys + (_fn ? fn : []) + (_more ? more : [])

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.7+9
version: 1.1.7+10
environment:
sdk: ">=2.7.0 <3.0.0"