migrate flutter3.0
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:countly_flutter/countly_config.dart';
|
||||
import 'package:countly_flutter/countly_flutter.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
class Analysis {
|
||||
static const _url = 'https://countly.xuty.cc';
|
||||
@@ -9,12 +12,18 @@ class Analysis {
|
||||
static bool _enabled = false;
|
||||
|
||||
static Future<void> init(bool debug) async {
|
||||
_enabled = true;
|
||||
await Countly.setLoggingEnabled(debug);
|
||||
await Countly.init(_url, _key);
|
||||
await Countly.start();
|
||||
await Countly.enableCrashReporting();
|
||||
await Countly.giveAllConsent();
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
_enabled = true;
|
||||
final config = CountlyConfig(_url, _key)
|
||||
.setLoggingEnabled(debug)
|
||||
.enableCrashReporting();
|
||||
await Countly.initWithConfig(config);
|
||||
await Countly.start();
|
||||
await Countly.giveAllConsent();
|
||||
} else {
|
||||
Logger('COUNTLY')
|
||||
.info('Unsupported platform ${Platform.operatingSystem}');
|
||||
}
|
||||
}
|
||||
|
||||
static void recordView(String view) {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:toolbox/data/res/color.dart';
|
||||
|
||||
class MenuItem {
|
||||
class DropdownBtnItem {
|
||||
final String text;
|
||||
final IconData icon;
|
||||
|
||||
const MenuItem({
|
||||
const DropdownBtnItem({
|
||||
required this.text,
|
||||
required this.icon,
|
||||
});
|
||||
@@ -24,19 +24,21 @@ class MenuItem {
|
||||
}
|
||||
|
||||
class ServerTabMenuItems {
|
||||
static const List<MenuItem> firstItems = [sftp, snippet, apt, docker];
|
||||
static const List<MenuItem> secondItems = [edit];
|
||||
static const List<DropdownBtnItem> firstItems = [sftp, snippet, apt, docker];
|
||||
static const List<DropdownBtnItem> secondItems = [edit];
|
||||
|
||||
static const sftp = MenuItem(text: 'SFTP', icon: Icons.insert_drive_file);
|
||||
static const snippet = MenuItem(text: 'Snippet', icon: Icons.label);
|
||||
static const sftp =
|
||||
DropdownBtnItem(text: 'SFTP', icon: Icons.insert_drive_file);
|
||||
static const snippet = DropdownBtnItem(text: 'Snippet', icon: Icons.label);
|
||||
static const apt =
|
||||
MenuItem(text: 'Apt/Yum', icon: Icons.system_security_update);
|
||||
static const docker = MenuItem(text: 'Docker', icon: Icons.view_agenda);
|
||||
static const edit = MenuItem(text: 'Edit', icon: Icons.edit);
|
||||
DropdownBtnItem(text: 'Apt/Yum', icon: Icons.system_security_update);
|
||||
static const docker =
|
||||
DropdownBtnItem(text: 'Docker', icon: Icons.view_agenda);
|
||||
static const edit = DropdownBtnItem(text: 'Edit', icon: Icons.edit);
|
||||
}
|
||||
|
||||
class DockerMenuItems {
|
||||
static const rm = MenuItem(text: 'Remove', icon: Icons.delete);
|
||||
static const start = MenuItem(text: 'Start', icon: Icons.play_arrow);
|
||||
static const stop = MenuItem(text: 'Stop', icon: Icons.stop);
|
||||
static const rm = DropdownBtnItem(text: 'Remove', icon: Icons.delete);
|
||||
static const start = DropdownBtnItem(text: 'Start', icon: Icons.play_arrow);
|
||||
static const stop = DropdownBtnItem(text: 'Stop', icon: Icons.stop);
|
||||
}
|
||||
|
||||
@@ -92,17 +92,20 @@ class AptProvider extends BusyProvider {
|
||||
Future<String> _update() async {
|
||||
switch (dist) {
|
||||
case Distribution.rehl:
|
||||
return await client!.run(_wrap('yum check-update')).string;
|
||||
return await client?.run(_wrap('yum check-update')).string ?? '';
|
||||
default:
|
||||
final session = await client!.execute(_wrap('apt update'));
|
||||
session.stderr.listen((event) => _onPwd(event, session.stdin));
|
||||
session.stdout.listen((event) {
|
||||
updateLog = (updateLog ?? '') + event.string;
|
||||
notifyListeners();
|
||||
onUpdate!();
|
||||
onUpdate ?? () {}();
|
||||
});
|
||||
await session.done;
|
||||
return await client!.run('apt list --upgradeable'.withLangExport).string;
|
||||
return await client
|
||||
?.run('apt list --upgradeable'.withLangExport)
|
||||
.string ??
|
||||
'';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +154,7 @@ class AptProvider extends BusyProvider {
|
||||
if (pwd.isEmpty) {
|
||||
logger.info('sudo password request cancelled');
|
||||
}
|
||||
stdin.add(Uint8List.fromList(utf8.encode(pwd + '\n')));
|
||||
stdin.add(Uint8List.fromList(utf8.encode('$pwd\n')));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ class DebugProvider extends ChangeNotifier {
|
||||
),
|
||||
);
|
||||
_addWidget(SingleChildScrollView(
|
||||
child: widget,
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: widget,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ class DockerProvider extends BusyProvider {
|
||||
}
|
||||
|
||||
final verRaw = await client!.run('docker version'.withLangExport).string;
|
||||
print(verRaw);
|
||||
if (verRaw.contains(dockerNotFound)) {
|
||||
error = 'docker not found';
|
||||
notifyListeners();
|
||||
|
||||
@@ -182,7 +182,7 @@ class ServerProvider extends BusyProvider {
|
||||
.run("echo '$shellCmd' > $shellPath && chmod +x $shellPath");
|
||||
} catch (e) {
|
||||
_servers[idx].connectionState = ServerConnectionState.failed;
|
||||
_servers[idx].status.failedInfo = e.toString() + ' ## ';
|
||||
_servers[idx].status.failedInfo = '$e ## ';
|
||||
logger.warning(e);
|
||||
} finally {
|
||||
notifyListeners();
|
||||
@@ -264,9 +264,7 @@ class ServerProvider extends BusyProvider {
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
return (int.parse(value.split('\n')[idx].trim()) / 1000)
|
||||
.toStringAsFixed(1) +
|
||||
'°C';
|
||||
return '${(int.parse(value.split('\n')[idx].trim()) / 1000).toStringAsFixed(1)}°C';
|
||||
}
|
||||
|
||||
void _getCPU(
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 133;
|
||||
static const int build = 134;
|
||||
static const String engine =
|
||||
"Flutter 2.10.5 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 5464c5bac7 (3 weeks ago) • 2022-04-18 09:55:37 -0700\nEngine • revision 57d3bac3dd\nTools • Dart 2.16.2 • DevTools 2.9.2\n";
|
||||
static const String buildAt = "2022-05-10 21:49:33.780998";
|
||||
static const int modifications = 1;
|
||||
"Flutter 3.0.0 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision ee4e09cce0 (2 days ago) • 2022-05-09 16:45:18 -0700\nEngine • revision d1b9a6938a\nTools • Dart 2.17.0 • DevTools 2.12.2\n";
|
||||
static const String buildAt = "2022-05-12 14:31:57.568409";
|
||||
static const int modifications = 37;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const backendUrl = 'https://res.lolli.tech';
|
||||
const baseUrl = backendUrl + '/toolbox';
|
||||
const baseUrl = '$backendUrl/toolbox';
|
||||
const joinQQGroupUrl = 'https://jq.qq.com/?_wv=1027&k=G0hUmPAq';
|
||||
const myGithub = 'https://github.com/LollipopKit';
|
||||
const rainSunMeGithub = 'https://github.com/RainSunMe';
|
||||
|
||||
@@ -41,7 +41,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
|
||||
static String m8(myGithub) => "\n用❤️制作 by ${myGithub}";
|
||||
|
||||
static String m9(user) => "用户${user}的密码";
|
||||
static String m9(user) => "${user}的密码";
|
||||
|
||||
static String m10(url) => "请到 ${url} 提交问题";
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
"noUpdateAvailable": "没有可用更新",
|
||||
"foundNUpdate": "找到 {count} 个更新",
|
||||
"updateAll": "更新全部",
|
||||
"pwdForUser": "用户{user}的密码",
|
||||
"pwdForUser": "{user}的密码",
|
||||
"platformNotSupportUpdate": "当前平台不支持更新,请编译最新源码后手动安装",
|
||||
"invalidVersionHelp": "请确保正确安装了docker,或者使用的非自编译版本。如果没有以上问题,请在 {url} 提交问题。",
|
||||
"noInterface": "没有可用的接口"
|
||||
|
||||
@@ -60,12 +60,15 @@ class _AptManagePageState extends State<AptManagePage>
|
||||
|
||||
// ignore: prefer_function_declarations_over_variables
|
||||
PwdRequestFunc onPwdRequest = (user) async {
|
||||
if (!mounted) return '';
|
||||
final textController = TextEditingController();
|
||||
await showRoundDialog(
|
||||
context,
|
||||
s.pwdForUser(user ?? s.unknown),
|
||||
TextField(
|
||||
controller: textController,
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
labelText: s.pwd,
|
||||
),
|
||||
@@ -153,7 +156,8 @@ class _AptManagePageState extends State<AptManagePage>
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(17),
|
||||
child: UrlText(
|
||||
text: '${s.experimentalFeature}\n${s.reportBugsOnGithubIssue(issueUrl)}',
|
||||
text:
|
||||
'${s.experimentalFeature}\n${s.reportBugsOnGithubIssue(issueUrl)}',
|
||||
replace: 'Github Issue',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
|
||||
@@ -96,7 +96,7 @@ class _ConvertPageState extends State<ConvertPage>
|
||||
Widget _buildTypeOption() {
|
||||
final decode = s.decode;
|
||||
final encode = s.encode;
|
||||
final List<String> _typeOption = [
|
||||
final List<String> typeOption = [
|
||||
'Base64 $decode',
|
||||
'Base64 $encode',
|
||||
'URL $encode',
|
||||
@@ -135,7 +135,7 @@ class _ConvertPageState extends State<ConvertPage>
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(_typeOption[_typeOptionIndex],
|
||||
Text(typeOption[_typeOptionIndex],
|
||||
textScaleFactor: 1.0,
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
@@ -151,7 +151,7 @@ class _ConvertPageState extends State<ConvertPage>
|
||||
],
|
||||
),
|
||||
),
|
||||
children: _typeOption
|
||||
children: typeOption
|
||||
.map((e) => ListTile(
|
||||
title: Text(
|
||||
e,
|
||||
@@ -159,7 +159,7 @@ class _ConvertPageState extends State<ConvertPage>
|
||||
color:
|
||||
_theme.textTheme.bodyText2!.color!.withAlpha(177)),
|
||||
),
|
||||
trailing: _buildRadio(_typeOption.indexOf(e)),
|
||||
trailing: _buildRadio(typeOption.indexOf(e)),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
|
||||
@@ -26,7 +26,6 @@ class DockerManagePage extends StatefulWidget {
|
||||
class _DockerManagePageState extends State<DockerManagePage> {
|
||||
final _docker = locator<DockerProvider>();
|
||||
final greyTextStyle = const TextStyle(color: Colors.grey);
|
||||
late MediaQueryData _media;
|
||||
late S s;
|
||||
|
||||
@override
|
||||
@@ -38,7 +37,6 @@ class _DockerManagePageState extends State<DockerManagePage> {
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
_media = MediaQuery.of(context);
|
||||
s = S.of(context);
|
||||
}
|
||||
|
||||
@@ -72,17 +70,25 @@ class _DockerManagePageState extends State<DockerManagePage> {
|
||||
return Consumer<DockerProvider>(builder: (_, docker, __) {
|
||||
final running = docker.items;
|
||||
if (docker.error != null && running == null) {
|
||||
return SizedBox.expand(child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.error, size: 37,),
|
||||
const SizedBox(height: 27),
|
||||
Text(docker.error!),
|
||||
const SizedBox(height: 27),
|
||||
Padding(padding: const EdgeInsets.all(17), child: _buildSolution(docker.error!),)
|
||||
],
|
||||
),);
|
||||
return SizedBox.expand(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.error,
|
||||
size: 37,
|
||||
),
|
||||
const SizedBox(height: 27),
|
||||
Text(docker.error!),
|
||||
const SizedBox(height: 27),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(17),
|
||||
child: _buildSolution(docker.error!),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
if (running == null) {
|
||||
_docker.refresh();
|
||||
@@ -109,7 +115,10 @@ class _DockerManagePageState extends State<DockerManagePage> {
|
||||
case 'no client':
|
||||
return Text(s.waitConnection);
|
||||
case 'invalid version':
|
||||
return UrlText(text: s.invalidVersionHelp(issueUrl), replace: 'Github',);
|
||||
return UrlText(
|
||||
text: s.invalidVersionHelp(issueUrl),
|
||||
replace: 'Github',
|
||||
);
|
||||
default:
|
||||
return Text(s.unknownError);
|
||||
}
|
||||
@@ -154,17 +163,17 @@ class _DockerManagePageState extends State<DockerManagePage> {
|
||||
),
|
||||
customItemsHeight: 8,
|
||||
items: [
|
||||
DropdownMenuItem<MenuItem>(
|
||||
DropdownMenuItem<DropdownBtnItem>(
|
||||
value: item,
|
||||
child: item.build,
|
||||
),
|
||||
DropdownMenuItem<MenuItem>(
|
||||
DropdownMenuItem<DropdownBtnItem>(
|
||||
value: DockerMenuItems.rm,
|
||||
child: DockerMenuItems.rm.build,
|
||||
),
|
||||
],
|
||||
onChanged: (value) {
|
||||
final item = value as MenuItem;
|
||||
final item = value as DropdownBtnItem;
|
||||
switch (item) {
|
||||
case DockerMenuItems.rm:
|
||||
_docker.delete(containerId);
|
||||
|
||||
@@ -53,7 +53,7 @@ class _MyHomePageState extends State<MyHomePage>
|
||||
void initState() {
|
||||
super.initState();
|
||||
_serverProvider = locator<ServerProvider>();
|
||||
WidgetsBinding.instance?.addObserver(this);
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
_selectIndex = locator<SettingStore>().launchPage.fetch()!;
|
||||
_pageController = PageController(initialPage: _selectIndex);
|
||||
_advancedDrawerController = AdvancedDrawerController();
|
||||
@@ -69,7 +69,7 @@ class _MyHomePageState extends State<MyHomePage>
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
WidgetsBinding.instance?.removeObserver(this);
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -249,7 +249,6 @@ class _MyHomePageState extends State<MyHomePage>
|
||||
),
|
||||
AboutListTile(
|
||||
icon: const Icon(Icons.text_snippet),
|
||||
child: Text(s.license),
|
||||
applicationName: BuildData.name,
|
||||
applicationVersion: _buildVersionStr(),
|
||||
applicationIcon: _buildIcon(),
|
||||
@@ -261,6 +260,7 @@ class _MyHomePageState extends State<MyHomePage>
|
||||
replace: 'RainSunMe',
|
||||
),
|
||||
],
|
||||
child: Text(s.license),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -80,9 +80,7 @@ class _PingPageState extends State<PingPage>
|
||||
style: summaryTextStyle,
|
||||
),
|
||||
trailing: Text(
|
||||
s.pingAvg +
|
||||
(result.statistic?.avg?.toStringAsFixed(2) ?? s.unknown) +
|
||||
' $ms',
|
||||
'${s.pingAvg}${result.statistic?.avg?.toStringAsFixed(2) ?? s.unknown} $ms',
|
||||
style: TextStyle(fontSize: 14, color: primaryColor)),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -85,7 +85,6 @@ class _PrivateKeyEditPageState extends State<PrivateKeyEditPage>
|
||||
],
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
child: const Icon(Icons.save),
|
||||
tooltip: s.save,
|
||||
onPressed: () async {
|
||||
final name = nameController.text;
|
||||
@@ -124,6 +123,7 @@ class _PrivateKeyEditPageState extends State<PrivateKeyEditPage>
|
||||
}
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Icon(Icons.save),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
percent.toStringAsFixed(1) + '%',
|
||||
'${percent.toStringAsFixed(1)}%',
|
||||
style: const TextStyle(fontSize: 13),
|
||||
textScaleFactor: 1.0,
|
||||
),
|
||||
|
||||
@@ -195,10 +195,9 @@ class _ServerPageState extends State<ServerPage>
|
||||
children: [
|
||||
_buildPercentCircle(ss.cpu2Status.usedPercent()),
|
||||
_buildPercentCircle(ss.memory.used / ss.memory.total * 100),
|
||||
_buildIOData('Conn:\n' + ss.tcp.maxConn.toString(),
|
||||
'Fail:\n' + ss.tcp.fail.toString()),
|
||||
_buildIOData('Total:\n' + rootDisk.size,
|
||||
'Used:\n' + rootDisk.usedPercent.toString() + '%')
|
||||
_buildIOData('Conn:\n${ss.tcp.maxConn}', 'Fail:\n${ss.tcp.fail}'),
|
||||
_buildIOData(
|
||||
'Total:\n${rootDisk.size}', 'Used:\n${rootDisk.usedPercent}%')
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 13),
|
||||
@@ -229,21 +228,21 @@ class _ServerPageState extends State<ServerPage>
|
||||
customItemsHeight: 8,
|
||||
items: [
|
||||
...ServerTabMenuItems.firstItems.map(
|
||||
(item) => DropdownMenuItem<MenuItem>(
|
||||
(item) => DropdownMenuItem<DropdownBtnItem>(
|
||||
value: item,
|
||||
child: item.build,
|
||||
),
|
||||
),
|
||||
const DropdownMenuItem<Divider>(enabled: false, child: Divider()),
|
||||
...ServerTabMenuItems.secondItems.map(
|
||||
(item) => DropdownMenuItem<MenuItem>(
|
||||
(item) => DropdownMenuItem<DropdownBtnItem>(
|
||||
value: item,
|
||||
child: item.build,
|
||||
),
|
||||
),
|
||||
],
|
||||
onChanged: (value) {
|
||||
final item = value as MenuItem;
|
||||
final item = value as DropdownBtnItem;
|
||||
switch (item) {
|
||||
case ServerTabMenuItems.apt:
|
||||
AppRoute(AptManagePage(spi), 'apt manage page').go(context);
|
||||
|
||||
@@ -150,10 +150,6 @@ class _SettingPageState extends State<SettingPage> {
|
||||
textColor: priColor,
|
||||
tilePadding: roundRectCardPadding,
|
||||
childrenPadding: roundRectCardPadding,
|
||||
children: [
|
||||
_buildAppColorPicker(priColor),
|
||||
_buildColorPickerConfirmBtn()
|
||||
],
|
||||
trailing: ClipOval(
|
||||
child: Container(
|
||||
color: priColor,
|
||||
@@ -164,7 +160,11 @@ class _SettingPageState extends State<SettingPage> {
|
||||
title: Text(
|
||||
s.appPrimaryColor,
|
||||
style: textStyle,
|
||||
));
|
||||
),
|
||||
children: [
|
||||
_buildAppColorPicker(priColor),
|
||||
_buildColorPickerConfirmBtn()
|
||||
]);
|
||||
}
|
||||
|
||||
Widget _buildAppColorPicker(Color selected) {
|
||||
|
||||
@@ -31,7 +31,7 @@ class _SFTPDownloadedPageState extends State<SFTPDownloadedPage> {
|
||||
super.initState();
|
||||
sftpDownloadDir.then((dir) {
|
||||
_path = PathWithPrefix(dir.path);
|
||||
_prefixPath = dir.path + '/';
|
||||
_prefixPath = '${dir.path}/';
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
@@ -58,8 +58,8 @@ class _SFTPDownloadedPageState extends State<SFTPDownloadedPage> {
|
||||
],
|
||||
),
|
||||
body: FadeIn(
|
||||
child: _buildBody(),
|
||||
key: UniqueKey(),
|
||||
child: _buildBody(),
|
||||
),
|
||||
bottomNavigationBar: SafeArea(
|
||||
child: _buildPath(),
|
||||
|
||||
@@ -122,6 +122,7 @@ class _SFTPPageState extends State<SFTPPage> {
|
||||
} else {
|
||||
return RefreshIndicator(
|
||||
child: FadeIn(
|
||||
key: Key(_status.spi!.name + _status.path!.path),
|
||||
child: ListView.builder(
|
||||
itemCount: _status.files!.length + 1,
|
||||
controller: _scrollController,
|
||||
@@ -155,7 +156,6 @@ class _SFTPPageState extends State<SFTPPage> {
|
||||
);
|
||||
},
|
||||
),
|
||||
key: Key(_status.spi!.name + _status.path!.path),
|
||||
),
|
||||
onRefresh: () => listDir(path: _status.path?.path));
|
||||
}
|
||||
@@ -277,7 +277,7 @@ class _SFTPPageState extends State<SFTPPage> {
|
||||
return;
|
||||
}
|
||||
_status.client!
|
||||
.mkdir(_status.path!.path + '/' + textController.text);
|
||||
.mkdir('${_status.path!.path}/${textController.text}');
|
||||
Navigator.of(context).pop();
|
||||
listDir();
|
||||
},
|
||||
@@ -316,7 +316,7 @@ class _SFTPPageState extends State<SFTPPage> {
|
||||
return;
|
||||
}
|
||||
(await _status.client!
|
||||
.open(_status.path!.path + '/' + textController.text))
|
||||
.open('${_status.path!.path}/${textController.text}'))
|
||||
.writeBytes(Uint8List(0));
|
||||
Navigator.of(context).pop();
|
||||
listDir();
|
||||
|
||||
@@ -215,6 +215,10 @@ class _SnippetListPageState extends State<SnippetListPage> {
|
||||
height: 111,
|
||||
child: Stack(children: [
|
||||
Positioned(
|
||||
top: 36,
|
||||
bottom: 36,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Container(
|
||||
height: 37,
|
||||
decoration: const BoxDecoration(
|
||||
@@ -222,10 +226,6 @@ class _SnippetListPageState extends State<SnippetListPage> {
|
||||
color: Colors.black12,
|
||||
),
|
||||
),
|
||||
top: 36,
|
||||
bottom: 36,
|
||||
left: 0,
|
||||
right: 0,
|
||||
),
|
||||
ListWheelScrollView.useDelegate(
|
||||
itemExtent: 37,
|
||||
|
||||
@@ -8,10 +8,10 @@ class RoundRectCard extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Card(
|
||||
child: child,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(17))),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,11 +22,11 @@ class UrlText extends StatelessWidget {
|
||||
List<InlineSpan> _getTextSpans(bool isDarkMode) {
|
||||
List<InlineSpan> widgets = <InlineSpan>[];
|
||||
final reg = RegExp(regUrl);
|
||||
Iterable<Match> _matches = reg.allMatches(text);
|
||||
Iterable<Match> matches = reg.allMatches(text);
|
||||
List<_ResultMatch> resultMatches = <_ResultMatch>[];
|
||||
int start = 0;
|
||||
|
||||
for (Match match in _matches) {
|
||||
for (Match match in matches) {
|
||||
final group0 = match.group(0);
|
||||
if (group0 != null && group0.isNotEmpty) {
|
||||
if (start != match.start) {
|
||||
|
||||
Reference in New Issue
Block a user