💄 Optimize thoughts

This commit is contained in:
2025-11-15 21:15:41 +08:00
parent 5e9341a19c
commit a9c8f49797
3 changed files with 75 additions and 76 deletions

View File

@@ -608,26 +608,30 @@ class FileListView extends HookConsumerWidget {
previewWidget = getFileIcon(file, size: 48);
break;
case 'text':
previewWidget = FutureBuilder<String>(
future: ref
.read(apiClientProvider)
.get(uri)
.then((response) => response.data as String),
builder:
(context, snapshot) =>
snapshot.hasData
? SingleChildScrollView(
child: Text(
snapshot.data!,
style: const TextStyle(
fontSize: 8,
fontFamily: 'monospace',
previewWidget = Container(
color: Theme.of(context).colorScheme.surfaceContainer,
child: FutureBuilder<String>(
future: ref
.read(apiClientProvider)
.get(uri)
.then((response) => response.data as String),
builder:
(context, snapshot) =>
snapshot.hasData
? SingleChildScrollView(
padding: EdgeInsets.all(24),
child: Text(
snapshot.data!,
style: const TextStyle(
fontSize: 9,
fontFamily: 'monospace',
),
maxLines: 20,
overflow: TextOverflow.ellipsis,
),
maxLines: 20,
overflow: TextOverflow.ellipsis,
),
)
: const Center(child: CircularProgressIndicator()),
)
: const Center(child: CircularProgressIndicator()),
),
);
break;
case 'application' when file.mimeType == 'application/pdf':