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; bool _showField = false;
final TextEditingController _searchController = TextEditingController(); final TextEditingController _searchController = TextEditingController();
String _searchQuery = ''; String _searchQuery = '';
final Map<String, bool> _hovered = {};
@override @override
void dispose() { void dispose() {
@@ -59,9 +60,9 @@ class _FileExplorerState extends State<FileExplorer> {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( const Text(
'New Folder', 'New Folder',
style: const TextStyle( style: TextStyle(
color: AppTheme.primaryText, color: AppTheme.primaryText,
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@@ -94,7 +95,9 @@ class _FileExplorerState extends State<FileExplorer> {
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(16), 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( child: Stack(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
children: [ children: [
Positioned( const Positioned(
left: 0, left: 0,
child: const Text( child: Text(
'/Drive', '/Drive',
style: TextStyle( style: TextStyle(
fontSize: 24, fontSize: 24,
@@ -233,27 +236,13 @@ class _FileExplorerState extends State<FileExplorer> {
children: [ children: [
PopupMenuButton<String>( PopupMenuButton<String>(
color: AppTheme.accentColor.withAlpha(200), color: AppTheme.accentColor.withAlpha(200),
position: PopupMenuPosition.under, position: PopupMenuPosition.under,
offset: const Offset(48, 8), offset: const Offset(48, 8),
itemBuilder: (BuildContext context) => [ itemBuilder: (BuildContext context) => const [
const PopupMenuItem( PopupMenuItem(value: 'name', child: Text('Name')),
value: 'name', PopupMenuItem(value: 'date', child: Text('Date')),
PopupMenuItem(value: 'size', child: Text('Size')),
child: Text('Name'), PopupMenuItem(value: 'type', child: Text('Type')),
),
const PopupMenuItem(
value: 'date',
child: Text('Date'),
),
const PopupMenuItem(
value: 'size',
child: Text('Size'),
),
const PopupMenuItem(
value: 'type',
child: Text('Type'),
),
], ],
onSelected: (value) { onSelected: (value) {
context.read<FileBrowserBloc>().add( context.read<FileBrowserBloc>().add(
@@ -335,7 +324,7 @@ class _FileExplorerState extends State<FileExplorer> {
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(24), borderRadius: BorderRadius.circular(24),
borderSide: BorderSide(color: AppTheme.accentColor), borderSide: const BorderSide(color: AppTheme.accentColor),
), ),
), ),
onChanged: (value) { onChanged: (value) {
@@ -585,7 +574,6 @@ class _FileExplorerState extends State<FileExplorer> {
], ],
), ),
), ),
const SizedBox(width: 16), const SizedBox(width: 16),
ModernGlassButton( ModernGlassButton(
onPressed: () async { onPressed: () async {
@@ -623,7 +611,13 @@ class _FileExplorerState extends State<FileExplorer> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
final file = state.paginatedFiles[index]; final file = state.paginatedFiles[index];
final isSelected = _selectedFilePath == file.path; 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: () { onTap: () {
setState(() { setState(() {
_selectedFilePath = file.path; _selectedFilePath = file.path;
@@ -654,6 +648,8 @@ class _FileExplorerState extends State<FileExplorer> {
: null, : null,
color: isSelected color: isSelected
? AppTheme.accentColor.withValues(alpha: 0.08) ? AppTheme.accentColor.withValues(alpha: 0.08)
: isHovered
? Colors.white.withValues(alpha: 0.05)
: Colors.transparent, : Colors.transparent,
), ),
child: ListTile( child: ListTile(
@@ -715,6 +711,7 @@ class _FileExplorerState extends State<FileExplorer> {
), ),
), ),
), ),
),
); );
}, },
), ),