opt.: tag switcher

This commit is contained in:
lollipopkit
2023-12-15 12:01:55 +08:00
parent f10c5b9ea8
commit ee18b85108
30 changed files with 316 additions and 281 deletions

View File

@@ -139,32 +139,35 @@ class _LocalStoragePageState extends State<LocalStoragePage> {
var stat = file.statSync();
var isDir = stat.type == FileSystemEntityType.directory;
return CardX(ListTile(
leading: isDir
? const Icon(Icons.folder)
: const Icon(Icons.insert_drive_file),
title: Text(fileName),
subtitle:
isDir ? null : Text(stat.size.convertBytes, style: UIs.textGrey),
trailing: Text(
stat.modified
.toString()
.substring(0, stat.modified.toString().length - 4),
style: UIs.textGrey,
return CardX(
child: ListTile(
leading: isDir
? const Icon(Icons.folder)
: const Icon(Icons.insert_drive_file),
title: Text(fileName),
subtitle: isDir
? null
: Text(stat.size.convertBytes, style: UIs.textGrey),
trailing: Text(
stat.modified
.toString()
.substring(0, stat.modified.toString().length - 4),
style: UIs.textGrey,
),
onLongPress: () {
if (!isDir) return;
_showDirActionDialog(file);
},
onTap: () async {
if (!isDir) {
await _showFileActionDialog(file);
return;
}
_path!.update(fileName);
setState(() {});
},
),
onLongPress: () {
if (!isDir) return;
_showDirActionDialog(file);
},
onTap: () async {
if (!isDir) {
await _showFileActionDialog(file);
return;
}
_path!.update(fileName);
setState(() {});
},
));
);
},
);
}

View File

@@ -264,26 +264,28 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
style: UIs.textGrey,
textAlign: TextAlign.right,
);
return CardX(ListTile(
leading: Icon(isDir ? Icons.folder : Icons.insert_drive_file),
title: Text(file.filename),
trailing: trailing,
subtitle: isDir
? null
: Text(
(file.attr.size ?? 0).convertBytes,
style: UIs.textGrey,
),
onTap: () {
if (isDir) {
_status.path?.update(file.filename);
_listDir();
} else {
_onItemPress(file, true);
}
},
onLongPress: () => _onItemPress(file, !isDir),
));
return CardX(
child: ListTile(
leading: Icon(isDir ? Icons.folder : Icons.insert_drive_file),
title: Text(file.filename),
trailing: trailing,
subtitle: isDir
? null
: Text(
(file.attr.size ?? 0).convertBytes,
style: UIs.textGrey,
),
onTap: () {
if (isDir) {
_status.path?.update(file.filename);
_listDir();
} else {
_onItemPress(file, true);
}
},
onLongPress: () => _onItemPress(file, !isDir),
),
);
}
void _onItemPress(SftpName file, bool notDir) {

View File

@@ -134,7 +134,7 @@ class _SftpMissionPageState extends State<SftpMissionPage> {
}) {
final time = DateTime.fromMicrosecondsSinceEpoch(status.id);
return CardX(
ListTile(
child: ListTile(
leading: Text(time.hourMinute),
title: Text(
status.fileName,