diff --git a/lib/cwtch/gomobile.dart b/lib/cwtch/gomobile.dart index c121ff28..36f4c24a 100644 --- a/lib/cwtch/gomobile.dart +++ b/lib/cwtch/gomobile.dart @@ -151,7 +151,10 @@ class CwtchGomobile implements Cwtch { // ignore: non_constant_identifier_names void ExportPreviewedFile(String sourceFile, String suggestion) { - cwtchPlatform.invokeMethod("ExportPreviewedFile", {"Path": sourceFile, "FileName": suggestion,}); + cwtchPlatform.invokeMethod("ExportPreviewedFile", { + "Path": sourceFile, + "FileName": suggestion, + }); } @override diff --git a/lib/views/globalsettingsview.dart b/lib/views/globalsettingsview.dart index 5b4d5d64..f473e223 100644 --- a/lib/views/globalsettingsview.dart +++ b/lib/views/globalsettingsview.dart @@ -250,12 +250,12 @@ class _GlobalSettingsViewState extends State { Visibility( visible: settings.isExperimentEnabled(ImagePreviewsExperiment) && !Platform.isAndroid, child: CwtchFolderPicker( - label: AppLocalizations.of(context)!.settingDownloadFolder, - initialValue: settings.downloadPath, - onSave: (newVal) { - settings.downloadPath = newVal; - saveSettings(context); - }, + label: AppLocalizations.of(context)!.settingDownloadFolder, + initialValue: settings.downloadPath, + onSave: (newVal) { + settings.downloadPath = newVal; + saveSettings(context); + }, ), ), SwitchListTile( diff --git a/lib/widgets/filebubble.dart b/lib/widgets/filebubble.dart index a6e7c999..b29ef870 100644 --- a/lib/widgets/filebubble.dart +++ b/lib/widgets/filebubble.dart @@ -80,7 +80,7 @@ class FileBubbleState extends State { senderDisplayStr = Provider.of(context).senderHandle; } } - return LayoutBuilder(builder: (context, constraints) { + return LayoutBuilder(builder: (bcontext, constraints) { var wdgSender = Center( widthFactor: 1, child: SelectableText(senderDisplayStr + '\u202F', @@ -117,7 +117,7 @@ class FileBubbleState extends State { }, ), onTap: () { - pop(myFile!, wdgMessage); + pop(bcontext, myFile!, wdgMessage); }, ); } else { @@ -330,30 +330,23 @@ class FileBubbleState extends State { ); } - void pop(File myFile, Widget meta) async { + void pop(context, File myFile, Widget meta) async { await showDialog( context: context, builder: (_) => Dialog( - child: Container( + alignment: Alignment.center, + child: Container( padding: EdgeInsets.all(10), - width: 500, - height: 550, child: Column(children: [ meta, - Container( - width: 300, - height: 300, - decoration: BoxDecoration( - image: DecorationImage( - 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) + Image.file( + myFile, + cacheHeight: (MediaQuery.of(context).size.height * 0.6).floor(), + cacheWidth: (MediaQuery.of(context).size.width * 0.6).floor(), + fit: BoxFit.scaleDown, ), + Visibility(visible: !Platform.isAndroid, child: Text(myFile.path, textAlign: TextAlign.center)), + Visibility(visible: Platform.isAndroid, child: IconButton(icon: Icon(Icons.arrow_downward), onPressed: androidExport)), ]), ))); }