diff --git a/b0esche_cloud/lib/pages/file_explorer.dart b/b0esche_cloud/lib/pages/file_explorer.dart index f8a8400..71a76fb 100644 --- a/b0esche_cloud/lib/pages/file_explorer.dart +++ b/b0esche_cloud/lib/pages/file_explorer.dart @@ -185,124 +185,122 @@ class _FileExplorerState extends State { curve: Curves.easeInOut, child: Padding( padding: const EdgeInsets.only(top: 2), - child: Row( - children: [ - IconButton( - icon: Icon( - _isSearching ? Icons.close : Icons.search, - color: AppTheme.accentColor, - ), - splashColor: Colors.transparent, - highlightColor: Colors.transparent, - onPressed: () { - if (_isSearching) { - setState(() { - _showField = false; - _isSearching = false; - _searchController.clear(); - _searchQuery = ''; - context.read().add(ApplyFilter('')); - }); - } else { - setState(() { - _isSearching = true; - }); - Future.delayed(const Duration(milliseconds: 150), () { - setState(() { - _showField = true; - }); - }); - } - }, - ), - const SizedBox(width: 800), + child: IconButton( + icon: Icon( + _isSearching ? Icons.close : Icons.search, + color: AppTheme.accentColor, + ), + splashColor: Colors.transparent, + highlightColor: Colors.transparent, + onPressed: () { + if (_isSearching) { + setState(() { + _showField = false; + _isSearching = false; + _searchController.clear(); + _searchQuery = ''; + context.read().add(ApplyFilter('')); + }); + } else { + setState(() { + _isSearching = true; + }); + Future.delayed(const Duration(milliseconds: 150), () { + setState(() { + _showField = true; + }); + }); + } + }, + ), + ), + ), + Positioned( + right: 0, + top: 0, + child: Padding( + padding: const EdgeInsets.only(top: 2), + child: BlocBuilder( + builder: (context, state) { + String currentSort = 'name'; + bool isAscending = true; + if (state is DirectoryLoaded) { + currentSort = state.sortBy; + isAscending = state.isAscending; + } + return Row( + children: [ + PopupMenuButton( + color: AppTheme.accentColor.withAlpha(200), - BlocBuilder( - builder: (context, state) { - String currentSort = 'name'; - bool isAscending = true; - if (state is DirectoryLoaded) { - currentSort = state.sortBy; - isAscending = state.isAscending; - } - return Row( - children: [ - PopupMenuButton( - color: AppTheme.accentColor.withAlpha(200), + position: PopupMenuPosition.under, + offset: const Offset(48, 8), + itemBuilder: (BuildContext context) => [ + const PopupMenuItem( + value: 'name', - 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'), - ), - ], - onSelected: (value) { - context.read().add( - ApplySort(value, isAscending: isAscending), - ); - }, - child: Row( - children: [ - Icon( - Icons.arrow_drop_down, - color: AppTheme.primaryText, - ), - const SizedBox(width: 4), - Text( - currentSort == 'name' - ? 'Name' - : currentSort == 'date' - ? 'Date' - : currentSort == 'size' - ? 'Size' - : 'Type', - style: const TextStyle( - color: AppTheme.primaryText, - fontSize: 14, - ), - ), - ], - ), + child: Text('Name'), ), - const SizedBox(width: 8), - IconButton( - icon: Icon( - isAscending - ? Icons.arrow_upward - : Icons.arrow_downward, - color: AppTheme.accentColor, - ), - splashColor: Colors.transparent, - highlightColor: Colors.transparent, - onPressed: () { - context.read().add( - ApplySort( - currentSort, - isAscending: !isAscending, - ), - ); - }, + const PopupMenuItem( + value: 'date', + child: Text('Date'), + ), + const PopupMenuItem( + value: 'size', + child: Text('Size'), + ), + const PopupMenuItem( + value: 'type', + child: Text('Type'), ), ], - ); - }, - ), - ], + onSelected: (value) { + context.read().add( + ApplySort(value, isAscending: isAscending), + ); + }, + child: Row( + children: [ + Icon( + Icons.arrow_drop_down, + color: AppTheme.primaryText, + ), + const SizedBox(width: 4), + Text( + currentSort == 'name' + ? 'Name' + : currentSort == 'date' + ? 'Date' + : currentSort == 'size' + ? 'Size' + : 'Type', + style: const TextStyle( + color: AppTheme.primaryText, + fontSize: 14, + ), + ), + ], + ), + ), + const SizedBox(width: 8), + IconButton( + icon: Icon( + isAscending + ? Icons.arrow_upward + : Icons.arrow_downward, + color: AppTheme.accentColor, + ), + splashColor: Colors.transparent, + highlightColor: Colors.transparent, + onPressed: () { + context.read().add( + ApplySort(currentSort, isAscending: !isAscending), + ); + }, + ), + ], + ); + }, ), ), ),