This commit is contained in:
Leon Bösche
2025-12-17 00:19:03 +01:00
parent 2d6cf4e8bc
commit d3adefe70b

View File

@@ -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,7 +611,13 @@ class _FileExplorerState extends State<FileExplorer> {
itemBuilder: (context, index) {
final file = state.paginatedFiles[index];
final isSelected = _selectedFilePath == file.path;
return GestureDetector(
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;
@@ -654,6 +648,8 @@ class _FileExplorerState extends State<FileExplorer> {
: null,
color: isSelected
? AppTheme.accentColor.withValues(alpha: 0.08)
: isHovered
? Colors.white.withValues(alpha: 0.05)
: Colors.transparent,
),
child: ListTile(
@@ -715,6 +711,7 @@ class _FileExplorerState extends State<FileExplorer> {
),
),
),
),
);
},
),