fix: Image search rendering problem
This commit is contained in:
parent
d7ac0aa605
commit
59648bf2d7
4 changed files with 33 additions and 9 deletions
|
|
@ -14,7 +14,6 @@ class ImageBubble extends StatelessWidget {
|
|||
final Event event;
|
||||
final bool tapToView;
|
||||
final BoxFit fit;
|
||||
final bool maxSize;
|
||||
final Color? backgroundColor;
|
||||
final Color? textColor;
|
||||
final Color? linkColor;
|
||||
|
|
@ -29,7 +28,6 @@ class ImageBubble extends StatelessWidget {
|
|||
const ImageBubble(
|
||||
this.event, {
|
||||
this.tapToView = true,
|
||||
this.maxSize = true,
|
||||
this.backgroundColor,
|
||||
this.fit = BoxFit.contain,
|
||||
this.thumbnailOnly = true,
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class NaviRailItem extends StatelessWidget {
|
|||
borderRadius: borderRadius,
|
||||
color: isSelected
|
||||
? theme.colorScheme.primaryContainer
|
||||
: theme.colorScheme.surfaceBright,
|
||||
: theme.colorScheme.surfaceContainerHigh,
|
||||
child: Tooltip(
|
||||
message: toolTip,
|
||||
child: InkWell(
|
||||
|
|
|
|||
|
|
@ -4,9 +4,11 @@ import 'package:flutter_gen/gen_l10n/l10n.dart';
|
|||
import 'package:intl/intl.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
||||
import 'package:fluffychat/pages/chat/events/image_bubble.dart';
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/pages/chat/events/video_player.dart';
|
||||
import 'package:fluffychat/pages/image_viewer/image_viewer.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
|
||||
import 'package:fluffychat/widgets/mxc_image.dart';
|
||||
|
||||
class ChatSearchImagesTab extends StatelessWidget {
|
||||
final Room room;
|
||||
|
|
@ -25,6 +27,7 @@ class ChatSearchImagesTab extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final borderRadius = BorderRadius.circular(AppConfig.borderRadius / 2);
|
||||
return StreamBuilder(
|
||||
stream: searchStream,
|
||||
builder: (context, snapshot) {
|
||||
|
|
@ -144,16 +147,39 @@ class ChatSearchImagesTab extends StatelessWidget {
|
|||
shrinkWrap: true,
|
||||
mainAxisSpacing: padding,
|
||||
crossAxisSpacing: padding,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
padding: const EdgeInsets.all(padding),
|
||||
crossAxisCount: 3,
|
||||
children: monthEvents.map(
|
||||
(event) {
|
||||
if (event.messageType == MessageTypes.Video) {
|
||||
return EventVideoPlayer(event);
|
||||
return Material(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
borderRadius: borderRadius,
|
||||
child: EventVideoPlayer(event),
|
||||
);
|
||||
}
|
||||
return ImageBubble(
|
||||
event,
|
||||
fit: BoxFit.cover,
|
||||
return InkWell(
|
||||
onTap: () => showDialog(
|
||||
context: context,
|
||||
builder: (_) => ImageViewer(
|
||||
event,
|
||||
outerContext: context,
|
||||
),
|
||||
),
|
||||
borderRadius: borderRadius,
|
||||
child: Material(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
borderRadius: borderRadius,
|
||||
child: MxcImage(
|
||||
event: event,
|
||||
width: 128,
|
||||
height: 128,
|
||||
fit: BoxFit.cover,
|
||||
animated: true,
|
||||
isThumbnail: true,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
).toList(),
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class ChatSearchView extends StatelessWidget {
|
|||
enabled: controller.tabController.index == 0,
|
||||
decoration: InputDecoration(
|
||||
hintText: L10n.of(context).search,
|
||||
suffixIcon: const Icon(Icons.search_outlined),
|
||||
prefixIcon: const Icon(Icons.search_outlined),
|
||||
filled: true,
|
||||
fillColor: theme.colorScheme.secondaryContainer,
|
||||
border: OutlineInputBorder(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue