idle
This commit is contained in:
@@ -27,6 +27,7 @@ class _FileExplorerState extends State<FileExplorer> {
|
||||
bool _showField = false;
|
||||
final TextEditingController _searchController = TextEditingController();
|
||||
String _searchQuery = '';
|
||||
final Map<String, bool> _hovered = {};
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@@ -59,9 +60,9 @@ class _FileExplorerState extends State<FileExplorer> {
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
const Text(
|
||||
'New Folder',
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
color: AppTheme.primaryText,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -94,7 +95,9 @@ class _FileExplorerState extends State<FileExplorer> {
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
borderSide: BorderSide(color: AppTheme.accentColor),
|
||||
borderSide: const BorderSide(
|
||||
color: AppTheme.accentColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -169,9 +172,9 @@ class _FileExplorerState extends State<FileExplorer> {
|
||||
child: Stack(
|
||||
alignment: Alignment.centerLeft,
|
||||
children: [
|
||||
Positioned(
|
||||
const Positioned(
|
||||
left: 0,
|
||||
child: const Text(
|
||||
child: Text(
|
||||
'/Drive',
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
@@ -233,27 +236,13 @@ class _FileExplorerState extends State<FileExplorer> {
|
||||
children: [
|
||||
PopupMenuButton<String>(
|
||||
color: AppTheme.accentColor.withAlpha(200),
|
||||
|
||||
position: PopupMenuPosition.under,
|
||||
offset: const Offset(48, 8),
|
||||
itemBuilder: (BuildContext context) => [
|
||||
const PopupMenuItem(
|
||||
value: 'name',
|
||||
|
||||
child: Text('Name'),
|
||||
),
|
||||
const PopupMenuItem(
|
||||
value: 'date',
|
||||
child: Text('Date'),
|
||||
),
|
||||
const PopupMenuItem(
|
||||
value: 'size',
|
||||
child: Text('Size'),
|
||||
),
|
||||
const PopupMenuItem(
|
||||
value: 'type',
|
||||
child: Text('Type'),
|
||||
),
|
||||
itemBuilder: (BuildContext context) => const [
|
||||
PopupMenuItem(value: 'name', child: Text('Name')),
|
||||
PopupMenuItem(value: 'date', child: Text('Date')),
|
||||
PopupMenuItem(value: 'size', child: Text('Size')),
|
||||
PopupMenuItem(value: 'type', child: Text('Type')),
|
||||
],
|
||||
onSelected: (value) {
|
||||
context.read<FileBrowserBloc>().add(
|
||||
@@ -335,7 +324,7 @@ class _FileExplorerState extends State<FileExplorer> {
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
borderSide: BorderSide(color: AppTheme.accentColor),
|
||||
borderSide: const BorderSide(color: AppTheme.accentColor),
|
||||
),
|
||||
),
|
||||
onChanged: (value) {
|
||||
@@ -585,7 +574,6 @@ class _FileExplorerState extends State<FileExplorer> {
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(width: 16),
|
||||
ModernGlassButton(
|
||||
onPressed: () async {
|
||||
@@ -623,95 +611,104 @@ class _FileExplorerState extends State<FileExplorer> {
|
||||
itemBuilder: (context, index) {
|
||||
final file = state.paginatedFiles[index];
|
||||
final isSelected = _selectedFilePath == file.path;
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_selectedFilePath = file.path;
|
||||
});
|
||||
if (file.type == FileType.folder) {
|
||||
context.read<FileBrowserBloc>().add(
|
||||
NavigateToFolder(file.path),
|
||||
);
|
||||
} else {
|
||||
// Open viewer
|
||||
context.go('/viewer/${file.name}');
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.symmetric(
|
||||
vertical: 4,
|
||||
horizontal: 8,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: isSelected
|
||||
? Border.all(
|
||||
color: AppTheme.accentColor.withValues(
|
||||
alpha: 0.4,
|
||||
),
|
||||
width: 2,
|
||||
)
|
||||
: null,
|
||||
color: isSelected
|
||||
? AppTheme.accentColor.withValues(alpha: 0.08)
|
||||
: Colors.transparent,
|
||||
),
|
||||
child: ListTile(
|
||||
leading: Icon(
|
||||
file.type == FileType.folder
|
||||
? Icons.folder
|
||||
: Icons.insert_drive_file,
|
||||
color: AppTheme.primaryText,
|
||||
final isHovered = _hovered[file.path] ?? false;
|
||||
return MouseRegion(
|
||||
onEnter: (_) =>
|
||||
setState(() => _hovered[file.path] = true),
|
||||
onExit: (_) =>
|
||||
setState(() => _hovered[file.path] = false),
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_selectedFilePath = file.path;
|
||||
});
|
||||
if (file.type == FileType.folder) {
|
||||
context.read<FileBrowserBloc>().add(
|
||||
NavigateToFolder(file.path),
|
||||
);
|
||||
} else {
|
||||
// Open viewer
|
||||
context.go('/viewer/${file.name}');
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.symmetric(
|
||||
vertical: 4,
|
||||
horizontal: 8,
|
||||
),
|
||||
title: Text(
|
||||
file.type == FileType.folder
|
||||
? (file.name.startsWith('/')
|
||||
? file.name
|
||||
: '/${file.name}')
|
||||
: file.name,
|
||||
style: const TextStyle(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: isSelected
|
||||
? Border.all(
|
||||
color: AppTheme.accentColor.withValues(
|
||||
alpha: 0.4,
|
||||
),
|
||||
width: 2,
|
||||
)
|
||||
: null,
|
||||
color: isSelected
|
||||
? AppTheme.accentColor.withValues(alpha: 0.08)
|
||||
: isHovered
|
||||
? Colors.white.withValues(alpha: 0.05)
|
||||
: Colors.transparent,
|
||||
),
|
||||
child: ListTile(
|
||||
leading: Icon(
|
||||
file.type == FileType.folder
|
||||
? Icons.folder
|
||||
: Icons.insert_drive_file,
|
||||
color: AppTheme.primaryText,
|
||||
),
|
||||
),
|
||||
subtitle: Text(
|
||||
file.type == FileType.folder
|
||||
? 'Folder'
|
||||
: 'File - ${file.size} bytes',
|
||||
style: const TextStyle(
|
||||
color: AppTheme.secondaryText,
|
||||
title: Text(
|
||||
file.type == FileType.folder
|
||||
? (file.name.startsWith('/')
|
||||
? file.name
|
||||
: '/${file.name}')
|
||||
: file.name,
|
||||
style: const TextStyle(
|
||||
color: AppTheme.primaryText,
|
||||
),
|
||||
),
|
||||
),
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.edit,
|
||||
color: AppTheme.secondaryText,
|
||||
),
|
||||
splashColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onPressed: () => _editFile(file),
|
||||
subtitle: Text(
|
||||
file.type == FileType.folder
|
||||
? 'Folder'
|
||||
: 'File - ${file.size} bytes',
|
||||
style: const TextStyle(
|
||||
color: AppTheme.secondaryText,
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.download,
|
||||
color: AppTheme.secondaryText,
|
||||
),
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.edit,
|
||||
color: AppTheme.secondaryText,
|
||||
),
|
||||
splashColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onPressed: () => _editFile(file),
|
||||
),
|
||||
splashColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onPressed: () => _downloadFile(file),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.send,
|
||||
color: AppTheme.secondaryText,
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.download,
|
||||
color: AppTheme.secondaryText,
|
||||
),
|
||||
splashColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onPressed: () => _downloadFile(file),
|
||||
),
|
||||
splashColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onPressed: () => _sendFile(file),
|
||||
),
|
||||
],
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.send,
|
||||
color: AppTheme.secondaryText,
|
||||
),
|
||||
splashColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
onPressed: () => _sendFile(file),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user