Fixup Malformed Sizes + Preview Contraints
This commit is contained in:
parent
abd32293eb
commit
659c7fe75e
|
@ -55,14 +55,14 @@ class FileMessage extends Message {
|
|||
builder: (bcontext, child) {
|
||||
dynamic shareObj = jsonDecode(this.content);
|
||||
if (shareObj == null) {
|
||||
return MessageRow(MalformedBubble(), 0);
|
||||
return MalformedBubble();
|
||||
}
|
||||
String nameSuggestion = shareObj['f'] as String;
|
||||
String rootHash = shareObj['h'] as String;
|
||||
String nonce = shareObj['n'] as String;
|
||||
int fileSize = shareObj['s'] as int;
|
||||
if (!validHash(rootHash, nonce)) {
|
||||
return MessageRow(MalformedBubble(), 0);
|
||||
return MalformedBubble();
|
||||
}
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
|
|
|
@ -40,7 +40,7 @@ class QuotedMessage extends Message {
|
|||
);
|
||||
var content = message["body"];
|
||||
var formatMessages = Provider.of<Settings>(bcontext).isExperimentEnabled(FormattingExperiment);
|
||||
return compileMessageContentWidget(context, constraints ?? BoxConstraints.expand(), false, content, FocusNode(), formatMessages, false);
|
||||
return compileMessageContentWidget(context, constraints ?? BoxConstraints.loose(MediaQuery.sizeOf(context)), false, content, FocusNode(), formatMessages, false);
|
||||
} catch (e) {
|
||||
return MalformedBubble();
|
||||
}
|
||||
|
|
|
@ -13,10 +13,7 @@ class MalformedBubble extends StatefulWidget {
|
|||
class MalformedBubbleState extends State<MalformedBubble> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(builder: (context, constraints) {
|
||||
return Center(
|
||||
widthFactor: 1.0,
|
||||
child: Container(
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: malformedColor,
|
||||
border: Border.all(color: malformedColor, width: 1),
|
||||
|
@ -27,6 +24,8 @@ class MalformedBubbleState extends State<MalformedBubble> {
|
|||
bottomRight: Radius.zero,
|
||||
),
|
||||
),
|
||||
child: FittedBox(
|
||||
fit: BoxFit.contain,
|
||||
child: Center(
|
||||
widthFactor: 1.0,
|
||||
child: Padding(
|
||||
|
@ -42,18 +41,11 @@ class MalformedBubbleState extends State<MalformedBubble> {
|
|||
))),
|
||||
Center(
|
||||
widthFactor: 1.0,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.malformedMessage,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
)
|
||||
],
|
||||
textWidthBasis: TextWidthBasis.longestLine,
|
||||
))
|
||||
])))));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue