|
|
@ -7,13 +7,13 @@ import 'package:neon/src/bloc/result_builder.dart'; |
|
|
|
import 'package:neon/src/blocs/accounts.dart'; |
|
|
|
import 'package:neon/src/blocs/accounts.dart'; |
|
|
|
import 'package:neon/src/blocs/unified_search.dart'; |
|
|
|
import 'package:neon/src/blocs/unified_search.dart'; |
|
|
|
import 'package:neon/src/models/account.dart'; |
|
|
|
import 'package:neon/src/models/account.dart'; |
|
|
|
|
|
|
|
import 'package:neon/src/theme/sizes.dart'; |
|
|
|
import 'package:neon/src/widgets/cached_image.dart'; |
|
|
|
import 'package:neon/src/widgets/cached_image.dart'; |
|
|
|
import 'package:neon/src/widgets/exception.dart'; |
|
|
|
import 'package:neon/src/widgets/exception.dart'; |
|
|
|
import 'package:neon/src/widgets/image_wrapper.dart'; |
|
|
|
import 'package:neon/src/widgets/image_wrapper.dart'; |
|
|
|
import 'package:neon/src/widgets/linear_progress_indicator.dart'; |
|
|
|
import 'package:neon/src/widgets/linear_progress_indicator.dart'; |
|
|
|
import 'package:neon/src/widgets/list_view.dart'; |
|
|
|
import 'package:neon/src/widgets/list_view.dart'; |
|
|
|
import 'package:neon/src/widgets/server_icon.dart'; |
|
|
|
import 'package:neon/src/widgets/server_icon.dart'; |
|
|
|
import 'package:neon/src/widgets/user_avatar.dart'; |
|
|
|
|
|
|
|
import 'package:nextcloud/nextcloud.dart'; |
|
|
|
import 'package:nextcloud/nextcloud.dart'; |
|
|
|
import 'package:provider/provider.dart'; |
|
|
|
import 'package:provider/provider.dart'; |
|
|
|
|
|
|
|
|
|
|
@ -77,7 +77,7 @@ class NeonUnifiedSearchResults extends StatelessWidget { |
|
|
|
ListTile( |
|
|
|
ListTile( |
|
|
|
leading: const Icon( |
|
|
|
leading: const Icon( |
|
|
|
Icons.close, |
|
|
|
Icons.close, |
|
|
|
size: kAvatarSize, |
|
|
|
size: largeIconSize, |
|
|
|
), |
|
|
|
), |
|
|
|
title: Text(AppLocalizations.of(context).searchNoResults), |
|
|
|
title: Text(AppLocalizations.of(context).searchNoResults), |
|
|
|
), |
|
|
|
), |
|
|
@ -85,7 +85,7 @@ class NeonUnifiedSearchResults extends StatelessWidget { |
|
|
|
for (final entry in entries) ...[ |
|
|
|
for (final entry in entries) ...[ |
|
|
|
ListTile( |
|
|
|
ListTile( |
|
|
|
leading: NeonImageWrapper( |
|
|
|
leading: NeonImageWrapper( |
|
|
|
size: const Size.square(kAvatarSize), |
|
|
|
size: const Size.square(largeIconSize), |
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(8)), |
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(8)), |
|
|
|
child: _buildThumbnail(context, accountsBloc.activeAccount.value!, entry), |
|
|
|
child: _buildThumbnail(context, accountsBloc.activeAccount.value!, entry), |
|
|
|
), |
|
|
|
), |
|
|
@ -105,7 +105,7 @@ class NeonUnifiedSearchResults extends StatelessWidget { |
|
|
|
Widget _buildThumbnail(final BuildContext context, final Account account, final CoreUnifiedSearchResultEntry entry) { |
|
|
|
Widget _buildThumbnail(final BuildContext context, final Account account, final CoreUnifiedSearchResultEntry entry) { |
|
|
|
if (entry.thumbnailUrl.isNotEmpty) { |
|
|
|
if (entry.thumbnailUrl.isNotEmpty) { |
|
|
|
return NeonCachedImage.url( |
|
|
|
return NeonCachedImage.url( |
|
|
|
size: const Size.square(kAvatarSize), |
|
|
|
size: const Size.square(largeIconSize), |
|
|
|
url: entry.thumbnailUrl, |
|
|
|
url: entry.thumbnailUrl, |
|
|
|
account: account, |
|
|
|
account: account, |
|
|
|
// The thumbnail URL might be set but a 404 is returned because there is no preview available |
|
|
|
// The thumbnail URL might be set but a 404 is returned because there is no preview available |
|
|
@ -121,7 +121,7 @@ class NeonUnifiedSearchResults extends StatelessWidget { |
|
|
|
final Account account, |
|
|
|
final Account account, |
|
|
|
final CoreUnifiedSearchResultEntry entry, |
|
|
|
final CoreUnifiedSearchResultEntry entry, |
|
|
|
) { |
|
|
|
) { |
|
|
|
const size = Size.square(kAvatarSize * 2 / 3); |
|
|
|
final size = Size.square(IconTheme.of(context).size!); |
|
|
|
if (entry.icon.startsWith('/')) { |
|
|
|
if (entry.icon.startsWith('/')) { |
|
|
|
return NeonCachedImage.url( |
|
|
|
return NeonCachedImage.url( |
|
|
|
size: size, |
|
|
|
size: size, |
|
|
|