i forgot
This commit is contained in:
parent
d5fb1cfa13
commit
58a9b17988
|
|
@ -1,9 +1,9 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/generated/l10n/l10n.dart';
|
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
|
|
||||||
import 'package:fluffychat/config/app_config.dart';
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
|
import 'package:fluffychat/generated/l10n/l10n.dart';
|
||||||
import 'package:fluffychat/utils/url_launcher.dart';
|
import 'package:fluffychat/utils/url_launcher.dart';
|
||||||
import 'package:fluffychat/widgets/mxc_image.dart';
|
import 'package:fluffychat/widgets/mxc_image.dart';
|
||||||
import '../../widgets/avatar.dart';
|
import '../../widgets/avatar.dart';
|
||||||
|
|
@ -73,26 +73,29 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
itemBuilder: (BuildContext context, int imageIndex) {
|
itemBuilder: (BuildContext context, int imageIndex) {
|
||||||
final image = pack.images[imageKeys[imageIndex]]!;
|
final image = pack.images[imageKeys[imageIndex]]!;
|
||||||
return InkWell(
|
return Tooltip(
|
||||||
radius: AppConfig.borderRadius,
|
message: image.body ?? imageKeys[imageIndex],
|
||||||
key: ValueKey(image.url.toString()),
|
child: InkWell(
|
||||||
onTap: () {
|
radius: AppConfig.borderRadius,
|
||||||
// copy the image
|
key: ValueKey(image.url.toString()),
|
||||||
final imageCopy =
|
onTap: () {
|
||||||
ImagePackImageContent.fromJson(image.toJson().copy());
|
// copy the image
|
||||||
// set the body, if it doesn't exist, to the key
|
final imageCopy =
|
||||||
imageCopy.body ??= imageKeys[imageIndex];
|
ImagePackImageContent.fromJson(image.toJson().copy());
|
||||||
widget.onSelected(imageCopy);
|
// set the body, if it doesn't exist, to the key
|
||||||
},
|
imageCopy.body ??= imageKeys[imageIndex];
|
||||||
child: AbsorbPointer(
|
widget.onSelected(imageCopy);
|
||||||
absorbing: true,
|
},
|
||||||
child: MxcImage(
|
child: AbsorbPointer(
|
||||||
uri: image.url,
|
absorbing: true,
|
||||||
fit: BoxFit.contain,
|
child: MxcImage(
|
||||||
width: 128,
|
uri: image.url,
|
||||||
height: 128,
|
fit: BoxFit.contain,
|
||||||
animated: true,
|
width: 128,
|
||||||
isThumbnail: false,
|
height: 128,
|
||||||
|
animated: true,
|
||||||
|
isThumbnail: false,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -111,6 +114,7 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
|
||||||
SliverAppBar(
|
SliverAppBar(
|
||||||
floating: true,
|
floating: true,
|
||||||
pinned: true,
|
pinned: true,
|
||||||
|
scrolledUnderElevation: 0,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
title: SizedBox(
|
title: SizedBox(
|
||||||
|
|
@ -118,6 +122,7 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
|
||||||
child: TextField(
|
child: TextField(
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
|
filled: true,
|
||||||
hintText: L10n.of(context).search,
|
hintText: L10n.of(context).search,
|
||||||
prefixIcon: const Icon(Icons.search_outlined),
|
prefixIcon: const Icon(Icons.search_outlined),
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
|
|
@ -158,4 +163,4 @@ class StickerPickerDialogState extends State<StickerPickerDialog> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue