Formatting PR
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2022-01-10 12:28:12 -08:00
parent 306a9c4de5
commit 659e89d626
5 changed files with 34 additions and 32 deletions

View File

@ -26,10 +26,7 @@ class ChatMessage {
};
}
enum ModalState {
none,
storageMigration
}
enum ModalState { none, storageMigration }
class AppState extends ChangeNotifier {
bool cwtchInit = false;

View File

@ -222,14 +222,8 @@ class Settings extends ChangeNotifier {
// (ignores file size; if the user manually accepts the file, assume it's okay to preview)
bool shouldPreview(String path) {
var lpath = path.toLowerCase();
return isExperimentEnabled(ImagePreviewsExperiment) && (
lpath.endsWith(".jpg") ||
lpath.endsWith(".jpeg") ||
lpath.endsWith(".png") ||
lpath.endsWith(".gif") ||
lpath.endsWith(".webp") ||
lpath.endsWith(".bmp")
);
return isExperimentEnabled(ImagePreviewsExperiment) &&
(lpath.endsWith(".jpg") || lpath.endsWith(".jpeg") || lpath.endsWith(".png") || lpath.endsWith(".gif") || lpath.endsWith(".webp") || lpath.endsWith(".bmp"));
}
String get downloadPath => _downloadPath;

View File

@ -87,7 +87,9 @@ class _MessageViewState extends State<MessageView> {
appBarButtons.add(IconButton(
icon: Icon(Icons.attach_file, size: 24),
tooltip: AppLocalizations.of(context)!.tooltipSendFile,
onPressed: (){_showFilePicker(context);},
onPressed: () {
_showFilePicker(context);
},
));
}
appBarButtons.add(IconButton(
@ -154,8 +156,7 @@ class _MessageViewState extends State<MessageView> {
builder: (BuildContext bcontext) {
if (Provider.of<ContactInfoState>(context, listen: false).isGroup == true) {
return MultiProvider(
providers: [ChangeNotifierProvider.value(value: Provider.of<ContactInfoState>(context)),
ChangeNotifierProvider.value(value: Provider.of<ProfileInfoState>(context))],
providers: [ChangeNotifierProvider.value(value: Provider.of<ContactInfoState>(context)), ChangeNotifierProvider.value(value: Provider.of<ProfileInfoState>(context))],
child: GroupSettingsView(),
);
} else {
@ -423,7 +424,10 @@ class _MessageViewState extends State<MessageView> {
SizedBox(
height: 20,
),
Visibility(visible: showPreview, child: showPreview ? Image.file(
Visibility(
visible: showPreview,
child: showPreview
? Image.file(
imagePreview!,
cacheHeight: 150, // limit the amount of space the image can decode too, we keep this high-ish to allow quality previews...
filterQuality: FilterQuality.medium,
@ -434,8 +438,13 @@ class _MessageViewState extends State<MessageView> {
errorBuilder: (context, error, stackTrace) {
return MalformedBubble();
},
) : Container()),
Visibility(visible: showPreview, child: SizedBox(height: 10,)),
)
: Container()),
Visibility(
visible: showPreview,
child: SizedBox(
height: 10,
)),
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
ElevatedButton(
child: Text(AppLocalizations.of(context)!.cancel, semanticsLabel: AppLocalizations.of(context)!.cancel),
@ -443,7 +452,9 @@ class _MessageViewState extends State<MessageView> {
Navigator.pop(bcontext);
},
),
SizedBox(width: 20,),
SizedBox(
width: 20,
),
ElevatedButton(
child: Text(AppLocalizations.of(context)!.btnSendFile, semanticsLabel: AppLocalizations.of(context)!.btnSendFile),
onPressed: () {