new: icloud manual
This commit is contained in:
@@ -7,6 +7,8 @@ import 'package:toolbox/core/extension/context/common.dart';
|
||||
import 'package:toolbox/core/extension/context/dialog.dart';
|
||||
import 'package:toolbox/core/extension/context/locale.dart';
|
||||
import 'package:toolbox/core/extension/context/snackbar.dart';
|
||||
import 'package:toolbox/core/persistant_store.dart';
|
||||
import 'package:toolbox/core/utils/icloud.dart';
|
||||
import 'package:toolbox/core/utils/platform/base.dart';
|
||||
import 'package:toolbox/core/utils/rebuild.dart';
|
||||
import 'package:toolbox/data/model/app/backup.dart';
|
||||
@@ -14,15 +16,19 @@ import 'package:toolbox/data/res/logger.dart';
|
||||
import 'package:toolbox/data/res/path.dart';
|
||||
import 'package:toolbox/data/res/provider.dart';
|
||||
import 'package:toolbox/data/res/store.dart';
|
||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||
import 'package:toolbox/view/widget/expand_tile.dart';
|
||||
import 'package:toolbox/view/widget/cardx.dart';
|
||||
import 'package:toolbox/view/widget/store_switch.dart';
|
||||
import 'package:toolbox/view/widget/value_notifier.dart';
|
||||
|
||||
import '../../core/utils/misc.dart';
|
||||
import '../../data/res/ui.dart';
|
||||
import '../widget/custom_appbar.dart';
|
||||
import '../widget/store_switch.dart';
|
||||
|
||||
class BackupPage extends StatelessWidget {
|
||||
const BackupPage({Key? key}) : super(key: key);
|
||||
BackupPage({Key? key}) : super(key: key);
|
||||
|
||||
final icloudLoading = ValueNotifier(false);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -35,66 +41,38 @@ class BackupPage extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildBody(BuildContext context) {
|
||||
final tip = () {
|
||||
if (isMacOS || isIOS) {
|
||||
return '${l10n.syncTip}\n${l10n.backupTip}';
|
||||
}
|
||||
return l10n.backupTip;
|
||||
}();
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(17),
|
||||
children: [
|
||||
if (isMacOS || isIOS) _buildIcloudSync(context),
|
||||
UIs.height13,
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(37),
|
||||
child: Text(
|
||||
tip,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
UIs.height77,
|
||||
_buildCard(
|
||||
l10n.restore,
|
||||
Icons.download,
|
||||
() => _onRestore(context),
|
||||
),
|
||||
UIs.height13,
|
||||
const SizedBox(
|
||||
width: 37,
|
||||
child: Divider(),
|
||||
),
|
||||
UIs.height13,
|
||||
_buildCard(
|
||||
l10n.backup,
|
||||
Icons.save,
|
||||
() async {
|
||||
await Backup.backup();
|
||||
await shareFiles([await Paths.bak]);
|
||||
},
|
||||
)
|
||||
_buildManual(context),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCard(
|
||||
String text,
|
||||
IconData icon,
|
||||
FutureOr Function() onTap,
|
||||
) {
|
||||
return RoundRectCard(
|
||||
InkWell(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 7, horizontal: 17),
|
||||
Widget _buildManual(BuildContext context) {
|
||||
return CardX(
|
||||
ListTile(
|
||||
title: Text(l10n.files),
|
||||
subtitle: Text(
|
||||
l10n.backupTip,
|
||||
style: UIs.textGrey,
|
||||
),
|
||||
trailing: SizedBox(
|
||||
width: 120,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(icon, size: 20),
|
||||
UIs.width7,
|
||||
Text(text),
|
||||
TextButton(
|
||||
onPressed: () => _onRestore(context),
|
||||
child: Text(l10n.restore),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
await Backup.backup();
|
||||
await shareFiles([await Paths.bak]);
|
||||
},
|
||||
child: Text(l10n.backup),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -103,27 +81,72 @@ class BackupPage extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildIcloudSync(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Text(
|
||||
'iCloud',
|
||||
textAlign: TextAlign.center,
|
||||
return CardX(
|
||||
ExpandTile(
|
||||
title: const Text('iCloud'),
|
||||
initiallyExpanded: true,
|
||||
subtitle: Text(
|
||||
l10n.syncTip,
|
||||
style: UIs.textGrey,
|
||||
),
|
||||
UIs.width13,
|
||||
// Hive db only save data into local file after app exit,
|
||||
// so this button is useless
|
||||
// IconButton(
|
||||
// onPressed: () async {
|
||||
// showLoadingDialog(context);
|
||||
// await ICloud.syncDb();
|
||||
// context.pop();
|
||||
// showRestartSnackbar(context, btn: s.restart, msg: s.icloudSynced);
|
||||
// },
|
||||
// icon: const Icon(Icons.sync)),
|
||||
// width13,
|
||||
StoreSwitch(prop: Stores.setting.icloudSync)
|
||||
],
|
||||
children: [
|
||||
ListTile(
|
||||
title: Text(l10n.auto),
|
||||
subtitle: const Text(
|
||||
'Please wait for optimization :)',
|
||||
style: UIs.textGrey,
|
||||
),
|
||||
trailing: StoreSwitch(
|
||||
prop: Stores.setting.icloudSync,
|
||||
func: (val) async {
|
||||
if (val) {
|
||||
final relativePaths = await PersistentStore.getFileNames();
|
||||
await ICloud.sync(relativePaths: relativePaths);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: Text('Manual'),
|
||||
trailing: ValueBuilder(
|
||||
listenable: icloudLoading,
|
||||
build: () {
|
||||
if (icloudLoading.value) {
|
||||
return UIs.centerSizedLoading;
|
||||
}
|
||||
return SizedBox(
|
||||
width: 120,
|
||||
child: Row(
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
icloudLoading.value = true;
|
||||
final files = await PersistentStore.getFileNames();
|
||||
for (final file in files) {
|
||||
await ICloud.download(relativePath: file);
|
||||
}
|
||||
},
|
||||
child: Text(l10n.download),
|
||||
),
|
||||
UIs.width7,
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
icloudLoading.value = true;
|
||||
final files = await PersistentStore.getFileNames();
|
||||
for (final file in files) {
|
||||
await ICloud.upload(relativePath: file);
|
||||
}
|
||||
},
|
||||
child: Text(l10n.upload),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import '../../data/res/ui.dart';
|
||||
import '../../data/res/url.dart';
|
||||
import '../widget/custom_appbar.dart';
|
||||
import '../widget/popup_menu.dart';
|
||||
import '../widget/round_rect_card.dart';
|
||||
import '../widget/cardx.dart';
|
||||
import '../widget/two_line_text.dart';
|
||||
import '../widget/url_text.dart';
|
||||
|
||||
@@ -213,7 +213,7 @@ class _DockerManagePageState extends State<DockerManagePage> {
|
||||
_buildPs(),
|
||||
_buildImage(),
|
||||
_buildEditHost(),
|
||||
].map((e) => RoundRectCard(e));
|
||||
].map((e) => CardX(e));
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(7),
|
||||
children: items.toList(),
|
||||
|
||||
@@ -26,7 +26,7 @@ import '../../data/res/misc.dart';
|
||||
import '../../data/res/ui.dart';
|
||||
import '../../data/res/url.dart';
|
||||
import '../widget/custom_appbar.dart';
|
||||
import '../widget/round_rect_card.dart';
|
||||
import '../widget/cardx.dart';
|
||||
import '../widget/url_text.dart';
|
||||
import '../widget/value_notifier.dart';
|
||||
|
||||
@@ -256,7 +256,7 @@ class _HomePageState extends State<HomePage>
|
||||
title: Text('${l10n.about} & ${l10n.feedback}'),
|
||||
onTap: _showAboutDialog,
|
||||
)
|
||||
].map((e) => RoundRectCard(e)).toList(),
|
||||
].map((e) => CardX(e)).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import '../../data/model/server/ping_result.dart';
|
||||
import '../../data/res/color.dart';
|
||||
import '../../data/res/ui.dart';
|
||||
import '../widget/input_field.dart';
|
||||
import '../widget/round_rect_card.dart';
|
||||
import '../widget/cardx.dart';
|
||||
|
||||
/// Only permit ipv4 / ipv6 / domain chars
|
||||
final targetReg = RegExp(r'[a-zA-Z0-9\.-_:]+');
|
||||
@@ -103,7 +103,7 @@ class _PingPageState extends State<PingPage>
|
||||
return Center(
|
||||
child: Text(
|
||||
l10n.noResult,
|
||||
style: const TextStyle(fontSize: 18),
|
||||
style: const TextStyle(fontSize: 15),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -118,7 +118,7 @@ class _PingPageState extends State<PingPage>
|
||||
Widget _buildResultItem(PingResult result) {
|
||||
final unknown = l10n.unknown;
|
||||
final ms = l10n.ms;
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 7, horizontal: 17),
|
||||
title: Text(
|
||||
|
||||
@@ -15,7 +15,7 @@ import '../../../data/model/server/private_key_info.dart';
|
||||
import '../../../data/provider/private_key.dart';
|
||||
import '../../../data/res/ui.dart';
|
||||
import '../../widget/custom_appbar.dart';
|
||||
import '../../../view/widget/round_rect_card.dart';
|
||||
import '../../widget/cardx.dart';
|
||||
|
||||
class PrivateKeysListPage extends StatefulWidget {
|
||||
const PrivateKeysListPage({Key? key}) : super(key: key);
|
||||
@@ -53,7 +53,7 @@ class _PrivateKeyListState extends State<PrivateKeysListPage>
|
||||
itemCount: key.pkis.length,
|
||||
itemBuilder: (context, idx) {
|
||||
final item = key.pkis[idx];
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
ListTile(
|
||||
leading: Text(
|
||||
'#$idx',
|
||||
|
||||
@@ -15,7 +15,7 @@ import '../../data/model/server/proc.dart';
|
||||
import '../../data/model/server/server_private_info.dart';
|
||||
import '../../data/res/ui.dart';
|
||||
import '../widget/custom_appbar.dart';
|
||||
import '../widget/round_rect_card.dart';
|
||||
import '../widget/cardx.dart';
|
||||
import '../widget/two_line_text.dart';
|
||||
|
||||
class ProcessPage extends StatefulWidget {
|
||||
@@ -142,7 +142,7 @@ class _ProcessPageState extends State<ProcessPage> {
|
||||
final leading = proc.user == null
|
||||
? Text(proc.pid.toString())
|
||||
: TwoLineText(up: proc.pid.toString(), down: proc.user!);
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
ListTile(
|
||||
leading: SizedBox(
|
||||
width: _media.size.width / 6,
|
||||
|
||||
@@ -20,7 +20,7 @@ import '../../../data/res/color.dart';
|
||||
import '../../../data/res/default.dart';
|
||||
import '../../../data/res/ui.dart';
|
||||
import '../../widget/custom_appbar.dart';
|
||||
import '../../widget/round_rect_card.dart';
|
||||
import '../../widget/cardx.dart';
|
||||
|
||||
class ServerDetailPage extends StatefulWidget {
|
||||
const ServerDetailPage({Key? key, required this.spi}) : super(key: key);
|
||||
@@ -131,7 +131,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
]);
|
||||
}
|
||||
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
Padding(
|
||||
padding: UIs.roundRectCardPadding,
|
||||
child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
@@ -201,7 +201,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
}
|
||||
|
||||
Widget _buildUpTimeAndSys(ServerStatus ss) {
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
Padding(
|
||||
padding: UIs.roundRectCardPadding,
|
||||
child: Row(
|
||||
@@ -229,7 +229,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
final used = ss.mem.usedPercent * 100;
|
||||
final usedStr = used.toStringAsFixed(0);
|
||||
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
Padding(
|
||||
padding: UIs.roundRectCardPadding,
|
||||
child: Column(
|
||||
@@ -274,7 +274,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
if (ss.swap.total == 0) return UIs.placeholder;
|
||||
final used = ss.swap.usedPercent * 100;
|
||||
final cached = ss.swap.cached / ss.swap.total * 100;
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
Padding(
|
||||
padding: UIs.roundRectCardPadding,
|
||||
child: Column(
|
||||
@@ -339,7 +339,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
),
|
||||
))
|
||||
.toList();
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
Padding(
|
||||
padding: UIs.roundRectCardPadding,
|
||||
child: Column(
|
||||
@@ -351,7 +351,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
}
|
||||
|
||||
Widget _buildNetView(ServerStatus ss) {
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
Padding(
|
||||
padding: UIs.roundRectCardPadding,
|
||||
child: ValueBuilder(
|
||||
@@ -503,7 +503,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
||||
),
|
||||
],
|
||||
)));
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
Padding(
|
||||
padding: UIs.roundRectCardPadding,
|
||||
child: Column(children: children),
|
||||
|
||||
@@ -13,7 +13,7 @@ import '../../../data/provider/private_key.dart';
|
||||
import '../../../data/res/ui.dart';
|
||||
import '../../widget/custom_appbar.dart';
|
||||
import '../../widget/input_field.dart';
|
||||
import '../../widget/round_rect_card.dart';
|
||||
import '../../widget/cardx.dart';
|
||||
import '../../widget/tag.dart';
|
||||
import '../../widget/value_notifier.dart';
|
||||
|
||||
@@ -283,7 +283,7 @@ class _ServerEditPageState extends State<ServerEditPage> {
|
||||
),
|
||||
),
|
||||
);
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 17),
|
||||
child: Column(
|
||||
|
||||
@@ -23,7 +23,7 @@ import '../../../data/model/server/server_status.dart';
|
||||
import '../../../data/provider/server.dart';
|
||||
import '../../../data/res/color.dart';
|
||||
import '../../../data/res/ui.dart';
|
||||
import '../../widget/round_rect_card.dart';
|
||||
import '../../widget/cardx.dart';
|
||||
import '../../widget/server_func_btns.dart';
|
||||
import '../../widget/tag.dart';
|
||||
|
||||
@@ -173,7 +173,7 @@ class _ServerPageState extends State<ServerPage>
|
||||
return UIs.placeholder;
|
||||
}
|
||||
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
key: Key(si.spi.id + (_tag ?? '')),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
|
||||
@@ -11,7 +11,7 @@ import 'package:toolbox/data/res/store.dart';
|
||||
import 'package:toolbox/view/page/setting/platform_pub.dart';
|
||||
import 'package:toolbox/view/widget/custom_appbar.dart';
|
||||
import 'package:toolbox/view/widget/input_field.dart';
|
||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||
import 'package:toolbox/view/widget/cardx.dart';
|
||||
import 'package:toolbox/view/widget/store_switch.dart';
|
||||
|
||||
class AndroidSettingsPage extends StatefulWidget {
|
||||
@@ -43,7 +43,7 @@ class _AndroidSettingsPageState extends State<AndroidSettingsPage> {
|
||||
_buildAndroidWidgetSharedPreference(),
|
||||
if (BioAuth.isPlatformSupported)
|
||||
PlatformPublicSettings.buildBioAuth(),
|
||||
].map((e) => RoundRectCard(e)).toList(),
|
||||
].map((e) => CardX(e)).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import '../../../data/res/ui.dart';
|
||||
import '../../widget/color_picker.dart';
|
||||
import '../../widget/custom_appbar.dart';
|
||||
import '../../widget/input_field.dart';
|
||||
import '../../widget/round_rect_card.dart';
|
||||
import '../../widget/cardx.dart';
|
||||
import '../../widget/store_switch.dart';
|
||||
import '../../widget/value_notifier.dart';
|
||||
|
||||
@@ -194,7 +194,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
children.add(_buildPlatformSetting());
|
||||
}
|
||||
return Column(
|
||||
children: children.map((e) => RoundRectCard(e)).toList(),
|
||||
children: children.map((e) => CardX(e)).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
_buildFullScreenSwitch(),
|
||||
_buildFullScreenJitter(),
|
||||
_buildFulScreenRotateQuarter(),
|
||||
].map((e) => RoundRectCard(e)).toList(),
|
||||
].map((e) => CardX(e)).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
//_buildDiskIgnorePath(),
|
||||
_buildDeleteServers(),
|
||||
//if (isDesktop) _buildDoubleColumnServersPage(),
|
||||
].map((e) => RoundRectCard(e)).toList(),
|
||||
].map((e) => CardX(e)).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
// Use hardware keyboard on desktop, so there is no need to set it
|
||||
if (isMobile) _buildKeyboardType(),
|
||||
_buildSSHVirtKeys(),
|
||||
].map((e) => RoundRectCard(e)).toList(),
|
||||
].map((e) => CardX(e)).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
_buildEditorTheme(),
|
||||
_buildEditorDarkTheme(),
|
||||
_buildEditorHighlight(),
|
||||
].map((e) => RoundRectCard(e)).toList(),
|
||||
].map((e) => CardX(e)).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -848,7 +848,7 @@ class _SettingPageState extends State<SettingPage> {
|
||||
children: [
|
||||
_buildSftpRmrDir(),
|
||||
_buildSftpOpenLastPath(),
|
||||
].map((e) => RoundRectCard(e)).toList(),
|
||||
].map((e) => CardX(e)).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import 'package:toolbox/data/res/ui.dart';
|
||||
import 'package:toolbox/view/page/setting/platform_pub.dart';
|
||||
import 'package:toolbox/view/widget/custom_appbar.dart';
|
||||
import 'package:toolbox/view/widget/future_widget.dart';
|
||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||
import 'package:toolbox/view/widget/cardx.dart';
|
||||
import 'package:toolbox/view/widget/store_switch.dart';
|
||||
import 'package:watch_connectivity/watch_connectivity.dart';
|
||||
|
||||
@@ -44,7 +44,7 @@ class _IOSSettingsPageState extends State<IOSSettingsPage> {
|
||||
_buildWatchApp(),
|
||||
if (BioAuth.isPlatformSupported)
|
||||
PlatformPublicSettings.buildBioAuth(),
|
||||
].map((e) => RoundRectCard(e)).toList(),
|
||||
].map((e) => CardX(e)).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:toolbox/data/res/store.dart';
|
||||
|
||||
import '../../../core/extension/order.dart';
|
||||
import '../../widget/custom_appbar.dart';
|
||||
import '../../widget/round_rect_card.dart';
|
||||
import '../../widget/cardx.dart';
|
||||
|
||||
class ServerDetailOrderPage extends StatefulWidget {
|
||||
const ServerDetailOrderPage({super.key});
|
||||
@@ -53,7 +53,7 @@ class _ServerDetailOrderPageState extends State<ServerDetailOrderPage> {
|
||||
return ReorderableDelayedDragStartListener(
|
||||
key: ValueKey('$index'),
|
||||
index: index,
|
||||
child: RoundRectCard(ListTile(
|
||||
child: CardX(ListTile(
|
||||
title: Text(id),
|
||||
trailing: const Icon(Icons.drag_handle),
|
||||
)),
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:toolbox/core/extension/context/locale.dart';
|
||||
import 'package:toolbox/core/extension/order.dart';
|
||||
import 'package:toolbox/data/res/provider.dart';
|
||||
import 'package:toolbox/data/res/store.dart';
|
||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||
import 'package:toolbox/view/widget/cardx.dart';
|
||||
|
||||
import '../../widget/custom_appbar.dart';
|
||||
|
||||
@@ -54,7 +54,7 @@ class _ServerOrderPageState extends State<ServerOrderPage> {
|
||||
return ReorderableDelayedDragStartListener(
|
||||
key: ValueKey('$index'),
|
||||
index: index,
|
||||
child: RoundRectCard(ListTile(
|
||||
child: CardX(ListTile(
|
||||
title: Text(spi.name),
|
||||
subtitle: Text(spi.id),
|
||||
leading: CircleAvatar(
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:toolbox/core/utils/platform/base.dart';
|
||||
import 'package:toolbox/data/model/ssh/virtual_key.dart';
|
||||
import 'package:toolbox/data/res/store.dart';
|
||||
import 'package:toolbox/data/res/ui.dart';
|
||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||
import 'package:toolbox/view/widget/cardx.dart';
|
||||
|
||||
import '../../widget/custom_appbar.dart';
|
||||
|
||||
@@ -41,7 +41,7 @@ class _SSHVirtKeySettingPageState extends State<SSHVirtKeySettingPage> {
|
||||
itemBuilder: (_, idx) {
|
||||
final key = allKeys[idx];
|
||||
final help = key.help;
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
key: ValueKey(idx),
|
||||
ListTile(
|
||||
title: _buildTitle(key),
|
||||
|
||||
@@ -13,7 +13,7 @@ import '../../../data/res/ui.dart';
|
||||
import '../../widget/tag.dart';
|
||||
import '/core/route.dart';
|
||||
import '/data/provider/snippet.dart';
|
||||
import '/view/widget/round_rect_card.dart';
|
||||
import '../../widget/cardx.dart';
|
||||
|
||||
class SnippetListPage extends StatefulWidget {
|
||||
const SnippetListPage({Key? key}) : super(key: key);
|
||||
@@ -94,7 +94,7 @@ class _SnippetListPageState extends State<SnippetListPage> {
|
||||
}
|
||||
|
||||
Widget _buildSnippetItem(Snippet snippet) {
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.only(left: 23, right: 17),
|
||||
title: Text(
|
||||
|
||||
@@ -11,7 +11,7 @@ import 'package:toolbox/data/res/misc.dart';
|
||||
import 'package:toolbox/data/res/provider.dart';
|
||||
import 'package:toolbox/view/widget/input_field.dart';
|
||||
import 'package:toolbox/view/widget/omit_start_text.dart';
|
||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||
import 'package:toolbox/view/widget/cardx.dart';
|
||||
|
||||
import '../../../core/extension/numx.dart';
|
||||
import '../../../core/route.dart';
|
||||
@@ -153,7 +153,7 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
|
||||
var stat = file.statSync();
|
||||
var isDir = stat.type == FileSystemEntityType.directory;
|
||||
|
||||
return RoundRectCard(ListTile(
|
||||
return CardX(ListTile(
|
||||
leading: isDir
|
||||
? const Icon(Icons.folder)
|
||||
: const Icon(Icons.insert_drive_file),
|
||||
|
||||
@@ -14,7 +14,7 @@ import 'package:toolbox/data/res/misc.dart';
|
||||
import 'package:toolbox/data/res/provider.dart';
|
||||
import 'package:toolbox/data/res/store.dart';
|
||||
import 'package:toolbox/view/widget/omit_start_text.dart';
|
||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||
import 'package:toolbox/view/widget/cardx.dart';
|
||||
|
||||
import '../../../core/extension/numx.dart';
|
||||
import '../../../core/route.dart';
|
||||
@@ -277,7 +277,7 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
|
||||
style: UIs.textGrey,
|
||||
textAlign: TextAlign.right,
|
||||
);
|
||||
return RoundRectCard(ListTile(
|
||||
return CardX(ListTile(
|
||||
leading: Icon(isDir ? Icons.folder : Icons.insert_drive_file),
|
||||
title: Text(file.filename),
|
||||
trailing: trailing,
|
||||
|
||||
@@ -13,7 +13,7 @@ import '../../../data/model/sftp/req.dart';
|
||||
import '../../../data/provider/sftp.dart';
|
||||
import '../../../data/res/ui.dart';
|
||||
import '../../widget/custom_appbar.dart';
|
||||
import '../../widget/round_rect_card.dart';
|
||||
import '../../widget/cardx.dart';
|
||||
|
||||
class SftpMissionPage extends StatefulWidget {
|
||||
const SftpMissionPage({Key? key}) : super(key: key);
|
||||
@@ -119,7 +119,7 @@ class _SftpMissionPageState extends State<SftpMissionPage> {
|
||||
Widget? trailing,
|
||||
}) {
|
||||
final time = DateTime.fromMicrosecondsSinceEpoch(status.id);
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
ListTile(
|
||||
leading: Text(time.hourMinute),
|
||||
title: Text(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class RoundRectCard extends StatelessWidget {
|
||||
const RoundRectCard(this.child, {Key? key, this.color}) : super(key: key);
|
||||
class CardX extends StatelessWidget {
|
||||
const CardX(this.child, {Key? key, this.color}) : super(key: key);
|
||||
|
||||
final Widget child;
|
||||
final Color? color;
|
||||
@@ -8,5 +8,6 @@ class ExpandTile extends ExpansionTile {
|
||||
required super.title,
|
||||
super.children,
|
||||
super.subtitle,
|
||||
super.initiallyExpanded,
|
||||
}) : super(shape: _shape, collapsedShape: _shape);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'round_rect_card.dart';
|
||||
import 'cardx.dart';
|
||||
|
||||
class Input extends StatelessWidget {
|
||||
final TextEditingController? controller;
|
||||
@@ -41,7 +41,7 @@ class Input extends StatelessWidget {
|
||||
});
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RoundRectCard(
|
||||
return CardX(
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 17),
|
||||
child: TextField(
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:toolbox/core/extension/context/dialog.dart';
|
||||
import 'package:toolbox/core/extension/context/locale.dart';
|
||||
import 'package:toolbox/data/res/ui.dart';
|
||||
import 'package:toolbox/view/widget/input_field.dart';
|
||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||
import 'package:toolbox/view/widget/cardx.dart';
|
||||
|
||||
import '../../data/res/color.dart';
|
||||
|
||||
@@ -57,7 +57,7 @@ class TagEditor extends StatefulWidget {
|
||||
class _TagEditorState extends State<TagEditor> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return RoundRectCard(ListTile(
|
||||
return CardX(ListTile(
|
||||
leading: const Icon(Icons.tag),
|
||||
title: _buildTags(widget.tags),
|
||||
trailing: InkWell(
|
||||
|
||||
Reference in New Issue
Block a user