fix: custom emote placeholder

- place emote loading spinner in the position as the emote itself
- add key to preview in order to ensure proper states aligned

Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
TheOneWithTheBraid 2023-06-02 18:39:47 +02:00
parent ec9155d8f0
commit 044171c002
2 changed files with 11 additions and 5 deletions

View File

@ -263,6 +263,8 @@ class InputBar extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
MxcImage( MxcImage(
// ensure proper ordering ...
key: ValueKey(suggestion['name']),
uri: suggestion['mxc'] is String uri: suggestion['mxc'] is String
? Uri.parse(suggestion['mxc'] ?? '') ? Uri.parse(suggestion['mxc'] ?? '')
: null, : null,

View File

@ -212,16 +212,20 @@ class EmotesSettingsView extends StatelessWidget {
class _EmoteImage extends StatelessWidget { class _EmoteImage extends StatelessWidget {
final Uri mxc; final Uri mxc;
const _EmoteImage(this.mxc); const _EmoteImage(this.mxc);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
const size = 38.0; const size = 38.0;
return MxcImage( return SizedBox.square(
dimension: size,
child: MxcImage(
uri: mxc, uri: mxc,
fit: BoxFit.contain, fit: BoxFit.contain,
width: size, width: size,
height: size, height: size,
),
); );
} }
} }