Skip to content

Commit fc4c958

Browse files
committed
msglist: Clean up MessageImage layout
Adjust layout of MessageImage to match new design. The transparent border mentioned was being treated as external padding to the image, but it's actually inner padding within the image, expanding the image size to +2 on both axis.
1 parent e28753c commit fc4c958

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

lib/widgets/content.dart

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -267,25 +267,24 @@ class MessageImage extends StatelessWidget {
267267
Navigator.of(context).push(getLightboxRoute(
268268
context: context, message: message, src: resolvedSrc));
269269
},
270-
child: Align(
271-
alignment: Alignment.centerLeft,
272-
child: Padding(
273-
// TODO clean up this padding by imitating web less precisely;
274-
// in particular, avoid adding loose whitespace at end of message.
275-
// The corresponding element on web has a 5px two-sided margin…
276-
// and then a 1px transparent border all around.
277-
padding: const EdgeInsets.fromLTRB(1, 1, 6, 6),
278-
child: Container(
279-
height: 100,
280-
width: 150,
281-
alignment: Alignment.center,
282-
color: const Color.fromRGBO(0, 0, 0, 0.03),
283-
child: LightboxHero(
284-
message: message,
285-
src: resolvedSrc,
286-
child: RealmContentNetworkImage(
287-
resolvedSrc,
288-
filterQuality: FilterQuality.medium))))));
270+
child: Padding(
271+
// TODO clean up this padding by imitating web less precisely;
272+
// in particular, avoid adding loose whitespace at end of message.
273+
padding: const EdgeInsets.only(right: 5, bottom: 5),
274+
child: ColoredBox(
275+
color: const Color.fromRGBO(0, 0, 0, 0.03),
276+
child: Padding(
277+
padding: const EdgeInsets.all(1),
278+
child: Center(
279+
child: SizedBox(
280+
height: 100,
281+
width: 150,
282+
child: LightboxHero(
283+
message: message,
284+
src: resolvedSrc,
285+
child: RealmContentNetworkImage(
286+
resolvedSrc,
287+
filterQuality: FilterQuality.medium))))))));
289288
}
290289
}
291290

0 commit comments

Comments
 (0)