Skip to content

Commit 4cd65b6

Browse files
committed
initial support for ohos5.0+
1 parent 65d11d0 commit 4cd65b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+757
-58
lines changed

.flutter-plugins

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
# This is a generated file; do not edit or check into version control.
2-
file_picker=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\file_picker-8.0.0\\
2+
file_picker=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\git\\fluttertpc_file_picker-2d732270bd172e7bf2b803ebff03d3f05f4e1595\\
3+
file_picker_ohos=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\git\\fluttertpc_file_picker-2d732270bd172e7bf2b803ebff03d3f05f4e1595\\ohos\\
4+
file_selector_linux=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\file_selector_linux-0.9.3+2\\
5+
file_selector_macos=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\file_selector_macos-0.9.4+2\\
6+
file_selector_windows=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\file_selector_windows-0.9.3+4\\
37
flutter_plugin_android_lifecycle=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\flutter_plugin_android_lifecycle-2.0.17\\
8+
image_picker=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\image_picker-1.1.2\\
9+
image_picker_android=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\image_picker_android-0.8.12+12\\
10+
image_picker_for_web=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\image_picker_for_web-3.0.6\\
11+
image_picker_ios=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\image_picker_ios-0.8.12+2\\
12+
image_picker_linux=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\image_picker_linux-0.2.1+2\\
13+
image_picker_macos=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\image_picker_macos-0.2.1+2\\
14+
image_picker_windows=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\image_picker_windows-0.2.1+1\\
415
path_provider_linux=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_linux-2.0.0\\
516
path_provider_windows=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\path_provider_windows-2.1.7\\
6-
shared_preferences=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences-2.1.1\\
7-
shared_preferences_android=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_android-2.1.0\\
8-
shared_preferences_foundation=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_foundation-2.2.0\\
9-
shared_preferences_linux=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_linux-2.2.0\\
10-
shared_preferences_web=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_web-2.1.0\\
11-
shared_preferences_windows=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_windows-2.2.0\\
17+
shared_preferences=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences-2.3.2\\
18+
shared_preferences_android=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_android-2.3.2\\
19+
shared_preferences_foundation=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_foundation-2.5.4\\
20+
shared_preferences_linux=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_linux-2.4.1\\
21+
shared_preferences_web=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_web-2.4.3\\
22+
shared_preferences_windows=C:\\Users\\samuioto\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\shared_preferences_windows-2.4.1\\

.metadata

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,20 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "9f455d2486bcb28cad87b062475f42edc959f636"
8-
channel: "stable"
7+
revision: "c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd"
8+
channel: "[user-branch]"
99

1010
project_type: app
1111

1212
# Tracks metadata for the flutter migrate command
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
17-
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636
18-
- platform: android
19-
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
20-
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636
21-
- platform: ios
22-
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
23-
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636
24-
- platform: linux
25-
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
26-
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636
27-
- platform: macos
28-
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
29-
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636
30-
- platform: web
31-
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
32-
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636
33-
- platform: windows
34-
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
35-
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636
16+
create_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
17+
base_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
18+
- platform: ohos
19+
create_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
20+
base_revision: c4a66f77d0e5047ddf5a1bd353fd3ee9cbfeafcd
3621

3722
# User provided section
3823

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ A lightweight SSH connection tool based on flutter
44
* 编辑连接的启动按钮失效
55
* 连接名称的编辑
66
* SFTP
7-
* harmonyos端迁移
7+
* 极端情况下的overflow
8+
# harmonyos端迁移
9+
* 初步完成,但疑似ohos和其他端无法兼容,待上述问题解决后在新的分支修复

lib/main_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class _MainPageState extends State<MainPage> {
169169
),
170170
)
171171
: _connections.isEmpty
172-
? Expanded(
172+
? const Expanded(
173173
child: Center(
174174
child: Text(
175175
'暂无保存的连接',
@@ -336,7 +336,7 @@ class _MainPageState extends State<MainPage> {
336336
double screenHeight,
337337
) {
338338

339-
final double buttonHeight = 80;
339+
const double buttonHeight = 80;
340340

341341
Widget buildButton({
342342
required VoidCallback onPressed,

linux/flutter/generated_plugin_registrant.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
#include "generated_plugin_registrant.h"
88

9+
#include <file_selector_linux/file_selector_plugin.h>
910

1011
void fl_register_plugins(FlPluginRegistry* registry) {
12+
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
13+
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
14+
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
1115
}

linux/flutter/generated_plugins.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44

55
list(APPEND FLUTTER_PLUGIN_LIST
6+
file_selector_linux
67
)
78

89
list(APPEND FLUTTER_FFI_PLUGIN_LIST

macos/Flutter/GeneratedPluginRegistrant.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
import FlutterMacOS
66
import Foundation
77

8+
import file_selector_macos
89
import shared_preferences_foundation
910

1011
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
12+
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
1113
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
1214
}

ohos/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/node_modules
2+
/oh_modules
3+
/local.properties
4+
/.idea
5+
**/build
6+
/.hvigor
7+
.cxx
8+
/.clangd
9+
/.clang-format
10+
/.clang-tidy
11+
**/.test
12+
**/BuildProfile.ets
13+
**/oh-package-lock.json5
14+
/package.json
15+
/package-lock.json
16+
17+
**/src/main/resources/rawfile/flutter_assets/
18+
**/libs/**/libapp.so
19+
**/libs/**/libflutter.so
20+
**/libs/**/libvmservice_snapshot.so

ohos/AppScope/app.json5

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"app": {
3+
"bundleName": "com.example.t_samuioto_ssh",
4+
"vendor": "example",
5+
"versionCode": 1000000,
6+
"versionName": "1.0.0",
7+
"icon": "$media:app_icon",
8+
"label": "$string:app_name"
9+
}
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"string": [
3+
{
4+
"name": "app_name",
5+
"value": "t_samuioto_ssh"
6+
}
7+
]
8+
}

0 commit comments

Comments
 (0)