forked from cwtch.im/cwtch-ui
Fixup Preview Dialog
This commit is contained in:
parent
8a8c5fc3e2
commit
df3617c5a1
|
@ -151,7 +151,10 @@ class CwtchGomobile implements Cwtch {
|
||||||
|
|
||||||
// ignore: non_constant_identifier_names
|
// ignore: non_constant_identifier_names
|
||||||
void ExportPreviewedFile(String sourceFile, String suggestion) {
|
void ExportPreviewedFile(String sourceFile, String suggestion) {
|
||||||
cwtchPlatform.invokeMethod("ExportPreviewedFile", {"Path": sourceFile, "FileName": suggestion,});
|
cwtchPlatform.invokeMethod("ExportPreviewedFile", {
|
||||||
|
"Path": sourceFile,
|
||||||
|
"FileName": suggestion,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -80,7 +80,7 @@ class FileBubbleState extends State<FileBubble> {
|
||||||
senderDisplayStr = Provider.of<MessageMetadata>(context).senderHandle;
|
senderDisplayStr = Provider.of<MessageMetadata>(context).senderHandle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return LayoutBuilder(builder: (context, constraints) {
|
return LayoutBuilder(builder: (bcontext, constraints) {
|
||||||
var wdgSender = Center(
|
var wdgSender = Center(
|
||||||
widthFactor: 1,
|
widthFactor: 1,
|
||||||
child: SelectableText(senderDisplayStr + '\u202F',
|
child: SelectableText(senderDisplayStr + '\u202F',
|
||||||
|
@ -117,7 +117,7 @@ class FileBubbleState extends State<FileBubble> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
pop(myFile!, wdgMessage);
|
pop(bcontext, myFile!, wdgMessage);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -330,30 +330,23 @@ class FileBubbleState extends State<FileBubble> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pop(File myFile, Widget meta) async {
|
void pop(context, File myFile, Widget meta) async {
|
||||||
await showDialog(
|
await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (_) => Dialog(
|
builder: (_) => Dialog(
|
||||||
|
alignment: Alignment.center,
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.all(10),
|
padding: EdgeInsets.all(10),
|
||||||
width: 500,
|
|
||||||
height: 550,
|
|
||||||
child: Column(children: [
|
child: Column(children: [
|
||||||
meta,
|
meta,
|
||||||
Container(
|
Image.file(
|
||||||
width: 300,
|
myFile,
|
||||||
height: 300,
|
cacheHeight: (MediaQuery.of(context).size.height * 0.6).floor(),
|
||||||
decoration: BoxDecoration(
|
cacheWidth: (MediaQuery.of(context).size.width * 0.6).floor(),
|
||||||
image: DecorationImage(
|
fit: BoxFit.scaleDown,
|
||||||
image: Image.file(myFile, cacheHeight: 1024, cacheWidth: 1024).image,
|
|
||||||
fit: BoxFit.fitWidth,
|
|
||||||
filterQuality: FilterQuality.none,
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
Visibility(
|
|
||||||
visible: Platform.isAndroid,
|
|
||||||
child: IconButton(icon: Icon(Icons.arrow_downward), onPressed: androidExport)
|
|
||||||
),
|
),
|
||||||
|
Visibility(visible: !Platform.isAndroid, child: Text(myFile.path, textAlign: TextAlign.center)),
|
||||||
|
Visibility(visible: Platform.isAndroid, child: IconButton(icon: Icon(Icons.arrow_downward), onPressed: androidExport)),
|
||||||
]),
|
]),
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue