Merge branch 'lollipopkit:main' into main
This commit is contained in:
@@ -1,7 +1,39 @@
|
|||||||
PODS:
|
PODS:
|
||||||
- countly_flutter (22.09.0):
|
- countly_flutter (22.09.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- DKImagePickerController/Core (4.3.4):
|
||||||
|
- DKImagePickerController/ImageDataManager
|
||||||
|
- DKImagePickerController/Resource
|
||||||
|
- DKImagePickerController/ImageDataManager (4.3.4)
|
||||||
|
- DKImagePickerController/PhotoGallery (4.3.4):
|
||||||
|
- DKImagePickerController/Core
|
||||||
|
- DKPhotoGallery
|
||||||
|
- DKImagePickerController/Resource (4.3.4)
|
||||||
|
- DKPhotoGallery (0.0.17):
|
||||||
|
- DKPhotoGallery/Core (= 0.0.17)
|
||||||
|
- DKPhotoGallery/Model (= 0.0.17)
|
||||||
|
- DKPhotoGallery/Preview (= 0.0.17)
|
||||||
|
- DKPhotoGallery/Resource (= 0.0.17)
|
||||||
|
- SDWebImage
|
||||||
|
- SwiftyGif
|
||||||
|
- DKPhotoGallery/Core (0.0.17):
|
||||||
|
- DKPhotoGallery/Model
|
||||||
|
- DKPhotoGallery/Preview
|
||||||
|
- SDWebImage
|
||||||
|
- SwiftyGif
|
||||||
|
- DKPhotoGallery/Model (0.0.17):
|
||||||
|
- SDWebImage
|
||||||
|
- SwiftyGif
|
||||||
|
- DKPhotoGallery/Preview (0.0.17):
|
||||||
|
- DKPhotoGallery/Model
|
||||||
|
- DKPhotoGallery/Resource
|
||||||
|
- SDWebImage
|
||||||
|
- SwiftyGif
|
||||||
|
- DKPhotoGallery/Resource (0.0.17):
|
||||||
|
- SDWebImage
|
||||||
|
- SwiftyGif
|
||||||
- file_picker (0.0.1):
|
- file_picker (0.0.1):
|
||||||
|
- DKImagePickerController/PhotoGallery
|
||||||
- Flutter
|
- Flutter
|
||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
- flutter_native_splash (0.0.1):
|
- flutter_native_splash (0.0.1):
|
||||||
@@ -13,8 +45,12 @@ PODS:
|
|||||||
- Flutter
|
- Flutter
|
||||||
- r_upgrade (0.0.1):
|
- r_upgrade (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- SDWebImage (5.15.7):
|
||||||
|
- SDWebImage/Core (= 5.15.7)
|
||||||
|
- SDWebImage/Core (5.15.7)
|
||||||
- share_plus (0.0.1):
|
- share_plus (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- SwiftyGif (5.4.4)
|
||||||
- url_launcher_ios (0.0.1):
|
- url_launcher_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
|
||||||
@@ -29,6 +65,13 @@ DEPENDENCIES:
|
|||||||
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
- share_plus (from `.symlinks/plugins/share_plus/ios`)
|
||||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||||
|
|
||||||
|
SPEC REPOS:
|
||||||
|
trunk:
|
||||||
|
- DKImagePickerController
|
||||||
|
- DKPhotoGallery
|
||||||
|
- SDWebImage
|
||||||
|
- SwiftyGif
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
countly_flutter:
|
countly_flutter:
|
||||||
:path: ".symlinks/plugins/countly_flutter/ios"
|
:path: ".symlinks/plugins/countly_flutter/ios"
|
||||||
@@ -51,15 +94,19 @@ EXTERNAL SOURCES:
|
|||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
countly_flutter: 135f1a4930f8e26ba223a14201d3f265ea7b4c83
|
countly_flutter: 135f1a4930f8e26ba223a14201d3f265ea7b4c83
|
||||||
file_picker: 1d63c4949e05e386da864365f8c13e1e64787675
|
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
|
||||||
|
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
|
||||||
|
file_picker: 63d7a9f5a3b5fe8fa001b1af955065e42a6c7b3e
|
||||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||||
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
|
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
|
||||||
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
|
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
|
||||||
plain_notification_token: b36467dc91939a7b6754267c701bbaca14996ee1
|
plain_notification_token: b36467dc91939a7b6754267c701bbaca14996ee1
|
||||||
r_upgrade: 44d715c61914cce3d01ea225abffe894fd51c114
|
r_upgrade: 44d715c61914cce3d01ea225abffe894fd51c114
|
||||||
|
SDWebImage: 25bac438318faf37e35650619ebc288a9061d292
|
||||||
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
|
share_plus: 056a1e8ac890df3e33cb503afffaf1e9b4fbae68
|
||||||
|
SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f
|
||||||
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
|
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
|
||||||
|
|
||||||
PODFILE CHECKSUM: 7fb15c416f8685fca4966867a8da218ec592ec2e
|
PODFILE CHECKSUM: 8fb0b88ad9ca0fa16f109f46126189158d7c8607
|
||||||
|
|
||||||
COCOAPODS: 1.11.3
|
COCOAPODS: 1.12.1
|
||||||
|
|||||||
@@ -360,7 +360,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 295;
|
CURRENT_PROJECT_VERSION = 300;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -368,7 +368,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.295;
|
MARKETING_VERSION = 1.0.300;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
@@ -491,7 +491,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 295;
|
CURRENT_PROJECT_VERSION = 300;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -499,7 +499,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.295;
|
MARKETING_VERSION = 1.0.300;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
@@ -516,7 +516,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
CURRENT_PROJECT_VERSION = 295;
|
CURRENT_PROJECT_VERSION = 300;
|
||||||
DEVELOPMENT_TEAM = BA88US33G6;
|
DEVELOPMENT_TEAM = BA88US33G6;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist";
|
||||||
@@ -524,7 +524,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.295;
|
MARKETING_VERSION = 1.0.300;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
|||||||
@@ -26,21 +26,21 @@ Future<bool> shareFiles(BuildContext context, List<String> filePaths) async {
|
|||||||
} else {
|
} else {
|
||||||
text = '${filePaths.length} ${S.of(context)!.files}';
|
text = '${filePaths.length} ${S.of(context)!.files}';
|
||||||
}
|
}
|
||||||
_app.setMoveBg(false);
|
_app.setCanMoveBg(false);
|
||||||
// ignore: deprecated_member_use
|
// ignore: deprecated_member_use
|
||||||
await Share.shareFiles(filePaths, text: 'ServerBox -> $text');
|
await Share.shareFiles(filePaths, text: 'ServerBox -> $text');
|
||||||
_app.setMoveBg(true);
|
_app.setCanMoveBg(true);
|
||||||
return filePaths.isNotEmpty;
|
return filePaths.isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
void copy(String text) {
|
void copy2Clipboard(String text) {
|
||||||
Clipboard.setData(ClipboardData(text: text));
|
Clipboard.setData(ClipboardData(text: text));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String?> pickOneFile() async {
|
Future<String?> pickOneFile() async {
|
||||||
_app.setMoveBg(false);
|
_app.setCanMoveBg(false);
|
||||||
final result = await FilePicker.platform.pickFiles(type: FileType.any);
|
final result = await FilePicker.platform.pickFiles(type: FileType.any);
|
||||||
_app.setMoveBg(true);
|
_app.setCanMoveBg(true);
|
||||||
return result?.files.single.path;
|
return result?.files.single.path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class AppProvider extends BusyProvider {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setMoveBg(bool moveBg) {
|
void setCanMoveBg(bool moveBg) {
|
||||||
_moveBg = moveBg;
|
_moveBg = moveBg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,31 @@ import '../store/server.dart';
|
|||||||
import '../store/setting.dart';
|
import '../store/setting.dart';
|
||||||
|
|
||||||
typedef ServersMap = Map<String, Server>;
|
typedef ServersMap = Map<String, Server>;
|
||||||
|
typedef ServerOrder = List<String>;
|
||||||
|
|
||||||
|
extension ServerOrderX on ServerOrder {
|
||||||
|
void move(int oldIndex, int newIndex) {
|
||||||
|
if (oldIndex == newIndex) return;
|
||||||
|
if (oldIndex < newIndex) {
|
||||||
|
newIndex -= 1;
|
||||||
|
}
|
||||||
|
final item = this[oldIndex];
|
||||||
|
removeAt(oldIndex);
|
||||||
|
insert(newIndex, item);
|
||||||
|
locator<SettingStore>().serverOrder.put(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void update(String id, String newId) {
|
||||||
|
final index = indexOf(id);
|
||||||
|
if (index == -1) return;
|
||||||
|
this[index] = newId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class ServerProvider extends BusyProvider {
|
class ServerProvider extends BusyProvider {
|
||||||
final ServersMap _servers = {};
|
final ServersMap _servers = {};
|
||||||
ServersMap get servers => _servers;
|
ServersMap get servers => _servers;
|
||||||
|
final ServerOrder serverOrder = [];
|
||||||
|
|
||||||
final _limiter = TryLimiter();
|
final _limiter = TryLimiter();
|
||||||
|
|
||||||
@@ -29,14 +50,21 @@ class ServerProvider extends BusyProvider {
|
|||||||
|
|
||||||
final _logger = Logger('SERVER');
|
final _logger = Logger('SERVER');
|
||||||
|
|
||||||
final _store = locator<ServerStore>();
|
final _serverStore = locator<ServerStore>();
|
||||||
|
final _settingStore = locator<SettingStore>();
|
||||||
|
|
||||||
Future<void> loadLocalData() async {
|
Future<void> loadLocalData() async {
|
||||||
setBusyState(true);
|
setBusyState(true);
|
||||||
final infos = _store.fetch();
|
final infos = _serverStore.fetch();
|
||||||
for (final info in infos) {
|
for (final info in infos) {
|
||||||
_servers[info.id] = genServer(info);
|
_servers[info.id] = genServer(info);
|
||||||
}
|
}
|
||||||
|
final serverOrder_ = _settingStore.serverOrder.fetch();
|
||||||
|
if (serverOrder_ != null) {
|
||||||
|
serverOrder.addAll(serverOrder_);
|
||||||
|
} else {
|
||||||
|
serverOrder.addAll(_servers.keys);
|
||||||
|
}
|
||||||
setBusyState(false);
|
setBusyState(false);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
@@ -107,14 +135,18 @@ class ServerProvider extends BusyProvider {
|
|||||||
void addServer(ServerPrivateInfo spi) {
|
void addServer(ServerPrivateInfo spi) {
|
||||||
_servers[spi.id] = genServer(spi);
|
_servers[spi.id] = genServer(spi);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
_store.put(spi);
|
_serverStore.put(spi);
|
||||||
|
serverOrder.add(spi.id);
|
||||||
|
_settingStore.serverOrder.put(serverOrder);
|
||||||
refreshData(spi: spi);
|
refreshData(spi: spi);
|
||||||
}
|
}
|
||||||
|
|
||||||
void delServer(String id) {
|
void delServer(String id) {
|
||||||
_servers.remove(id);
|
_servers.remove(id);
|
||||||
|
serverOrder.remove(id);
|
||||||
|
_settingStore.serverOrder.put(serverOrder);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
_store.delete(id);
|
_serverStore.delete(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateServer(
|
Future<void> updateServer(
|
||||||
@@ -122,9 +154,11 @@ class ServerProvider extends BusyProvider {
|
|||||||
ServerPrivateInfo newSpi,
|
ServerPrivateInfo newSpi,
|
||||||
) async {
|
) async {
|
||||||
_servers.remove(old.id);
|
_servers.remove(old.id);
|
||||||
_store.update(old, newSpi);
|
_serverStore.update(old, newSpi);
|
||||||
_servers[newSpi.id] = genServer(newSpi);
|
_servers[newSpi.id] = genServer(newSpi);
|
||||||
_servers[newSpi.id]?.client = await genClient(newSpi);
|
_servers[newSpi.id]?.client = await genClient(newSpi);
|
||||||
|
serverOrder.update(old.id, newSpi.id);
|
||||||
|
_settingStore.serverOrder.put(serverOrder);
|
||||||
await refreshData(spi: newSpi);
|
await refreshData(spi: newSpi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
class BuildData {
|
class BuildData {
|
||||||
static const String name = "ServerBox";
|
static const String name = "ServerBox";
|
||||||
static const int build = 295;
|
static const int build = 300;
|
||||||
static const String engine = "3.10.0";
|
static const String engine = "3.10.0";
|
||||||
static const String buildAt = "2023-05-11 12:17:12.803987";
|
static const String buildAt = "2023-05-12 16:42:47.988995";
|
||||||
static const int modifications = 3;
|
static const int modifications = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,4 +39,8 @@ class SettingStore extends PersistentStore {
|
|||||||
|
|
||||||
/// Backgroud running (Android)
|
/// Backgroud running (Android)
|
||||||
StoreProperty<bool> get bgRun => property('bgRun', defaultValue: isAndroid);
|
StoreProperty<bool> get bgRun => property('bgRun', defaultValue: isAndroid);
|
||||||
|
|
||||||
|
// Server order
|
||||||
|
StoreProperty<List<String>> get serverOrder =>
|
||||||
|
property('serverOrder', defaultValue: null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class _MyHomePageState extends State<MyHomePage>
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
drawer: _buildDrawer(),
|
drawer: _buildDrawer(),
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(tabTitleName(context, _selectIndex)),
|
title: const Text(BuildData.name),
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
IconButton(
|
||||||
icon: const Icon(Icons.developer_mode, size: 23),
|
icon: const Icon(Icons.developer_mode, size: 23),
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
await _serverProvider.refreshData(onlyFailed: true),
|
await _serverProvider.refreshData(onlyFailed: true),
|
||||||
child: Consumer<ServerProvider>(
|
child: Consumer<ServerProvider>(
|
||||||
builder: (_, pro, __) {
|
builder: (_, pro, __) {
|
||||||
if (pro.servers.isEmpty) {
|
if (pro.serverOrder.isEmpty) {
|
||||||
return Center(
|
return Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
_s.serverTabEmpty,
|
_s.serverTabEmpty,
|
||||||
@@ -91,21 +91,16 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
final keys = pro.servers.keys.toList();
|
return ReorderableListView(
|
||||||
return ListView.separated(
|
|
||||||
padding: const EdgeInsets.fromLTRB(7, 10, 7, 7),
|
padding: const EdgeInsets.fromLTRB(7, 10, 7, 7),
|
||||||
controller: ScrollController(),
|
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
itemBuilder: (ctx, idx) {
|
onReorder: (oldIndex, newIndex) => setState(() {
|
||||||
if (idx == pro.servers.length) {
|
pro.serverOrder.move(oldIndex, newIndex);
|
||||||
return SizedBox(height: _media.padding.bottom);
|
}),
|
||||||
}
|
children: pro.serverOrder
|
||||||
return _buildEachServerCard(pro.servers[keys[idx]]);
|
.where((e) => pro.servers.containsKey(e))
|
||||||
},
|
.map((e) => _buildEachServerCard(pro.servers[e]))
|
||||||
itemCount: pro.servers.length,
|
.toList(),
|
||||||
separatorBuilder: (_, __) => const SizedBox(
|
|
||||||
height: 3,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -116,21 +111,18 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
if (si == null) {
|
if (si == null) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
}
|
}
|
||||||
return GestureDetector(
|
return RoundRectCard(
|
||||||
onLongPress: () => AppRoute(
|
GestureDetector(
|
||||||
ServerEditPage(spi: si.spi),
|
child: Padding(
|
||||||
'Edit server info page',
|
|
||||||
).go(context),
|
|
||||||
child: RoundRectCard(
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(13),
|
padding: const EdgeInsets.all(13),
|
||||||
child: _buildRealServerCard(si.status, si.spi.name, si.state, si.spi),
|
child: _buildRealServerCard(si.status, si.spi.name, si.state, si.spi),
|
||||||
),
|
),
|
||||||
|
onTap: () => AppRoute(
|
||||||
|
ServerDetailPage(si.spi.id),
|
||||||
|
'server detail page',
|
||||||
|
).go(context),
|
||||||
),
|
),
|
||||||
onTap: () => AppRoute(
|
key: Key(si.spi.id),
|
||||||
ServerDetailPage(si.spi.id),
|
|
||||||
'server detail page',
|
|
||||||
).go(context),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,8 +169,8 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
child: Text(ss.failedInfo ?? _s.unknownError),
|
child: Text(ss.failedInfo ?? _s.unknownError),
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () =>
|
onPressed: () => copy2Clipboard(
|
||||||
copy(ss.failedInfo ?? _s.unknownError),
|
ss.failedInfo ?? _s.unknownError),
|
||||||
child: Text(_s.copy),
|
child: Text(_s.copy),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -427,7 +427,7 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (_pushToken != null) {
|
if (_pushToken != null) {
|
||||||
copy(_pushToken!);
|
copy2Clipboard(_pushToken!);
|
||||||
showSnackBar(context, Text(_s.success));
|
showSnackBar(context, Text(_s.success));
|
||||||
} else {
|
} else {
|
||||||
showSnackBar(context, Text(_s.getPushTokenFailed));
|
showSnackBar(context, Text(_s.getPushTokenFailed));
|
||||||
@@ -453,9 +453,10 @@ class _SettingPageState extends State<SettingPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildFont() {
|
Widget _buildFont() {
|
||||||
|
final fontName = getFileName(_setting.fontPath.fetch());
|
||||||
return ListTile(
|
return ListTile(
|
||||||
title: Text(_s.chooseFontFile),
|
title: Text(_s.choose),
|
||||||
trailing: Text(getFileName(_setting.fontPath.fetch()) ?? _s.notSelected),
|
trailing: Text(fontName ?? _s.notSelected),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showRoundDialog(
|
showRoundDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
|||||||
@@ -222,7 +222,10 @@ class _SSHPageState extends State<SSHPage> {
|
|||||||
_paste();
|
_paste();
|
||||||
break;
|
break;
|
||||||
case VirtualKeyFunc.copy:
|
case VirtualKeyFunc.copy:
|
||||||
copy(terminalSelected);
|
final selected = terminalSelected;
|
||||||
|
if (selected != null) {
|
||||||
|
copy2Clipboard(selected);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case VirtualKeyFunc.snippet:
|
case VirtualKeyFunc.snippet:
|
||||||
showSnippetDialog(context, _s, (s) {
|
showSnippetDialog(context, _s, (s) {
|
||||||
@@ -241,10 +244,10 @@ class _SSHPageState extends State<SSHPage> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
String get terminalSelected {
|
String? get terminalSelected {
|
||||||
final range = _terminalController.selection;
|
final range = _terminalController.selection;
|
||||||
if (range == null) {
|
if (range == null) {
|
||||||
return '';
|
return null;
|
||||||
}
|
}
|
||||||
return _terminal.buffer.getText(range);
|
return _terminal.buffer.getText(range);
|
||||||
}
|
}
|
||||||
@@ -255,29 +258,30 @@ class _SSHPageState extends State<SSHPage> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final selected = terminalSelected;
|
final selected = terminalSelected;
|
||||||
if (selected.trim().isEmpty) {
|
final children = <Widget>[
|
||||||
// _menuController.show(
|
TextButton(
|
||||||
// context: context,
|
onPressed: () {
|
||||||
// contextMenuBuilder: (context) {
|
_paste();
|
||||||
// return TextSelectionToolbar(
|
},
|
||||||
// anchorAbove: details.globalPosition,
|
child: Text(_s.paste),
|
||||||
// anchorBelow: details.globalPosition,
|
),
|
||||||
// children: [
|
];
|
||||||
// TextButton(
|
if (selected?.trim().isNotEmpty ?? false) {
|
||||||
// child: Text(
|
children.add(
|
||||||
// _s.paste,
|
TextButton(
|
||||||
// style: _menuTextStyle,
|
child: Text(
|
||||||
// ),
|
_s.copy,
|
||||||
// onPressed: () async {
|
style: _menuTextStyle,
|
||||||
// _paste();
|
),
|
||||||
// _menuController.remove();
|
onPressed: () {
|
||||||
// },
|
_terminalController.setSelection(null);
|
||||||
// )
|
if (selected != null) {
|
||||||
// ],
|
copy2Clipboard(selected);
|
||||||
// );
|
}
|
||||||
// },
|
_menuController.remove();
|
||||||
// );
|
},
|
||||||
return;
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
_menuController.show(
|
_menuController.show(
|
||||||
context: context,
|
context: context,
|
||||||
@@ -285,19 +289,7 @@ class _SSHPageState extends State<SSHPage> {
|
|||||||
return TextSelectionToolbar(
|
return TextSelectionToolbar(
|
||||||
anchorAbove: details.globalPosition,
|
anchorAbove: details.globalPosition,
|
||||||
anchorBelow: details.globalPosition,
|
anchorBelow: details.globalPosition,
|
||||||
children: [
|
children: children,
|
||||||
TextButton(
|
|
||||||
child: Text(
|
|
||||||
_s.copy,
|
|
||||||
style: _menuTextStyle,
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
_terminalController.setSelection(null);
|
|
||||||
copy(selected);
|
|
||||||
_menuController.remove();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ PODS:
|
|||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- FlutterMacOS (from `Flutter/ephemeral`)
|
- FlutterMacOS (from `Flutter/ephemeral`)
|
||||||
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/macos`)
|
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
|
||||||
- share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)
|
- share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)
|
||||||
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
|
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ EXTERNAL SOURCES:
|
|||||||
FlutterMacOS:
|
FlutterMacOS:
|
||||||
:path: Flutter/ephemeral
|
:path: Flutter/ephemeral
|
||||||
path_provider_foundation:
|
path_provider_foundation:
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/macos
|
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
|
||||||
share_plus:
|
share_plus:
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos
|
:path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos
|
||||||
url_launcher_macos:
|
url_launcher_macos:
|
||||||
|
|||||||
Reference in New Issue
Block a user