refactor: Migrate to Flutter 3.7.0

This commit is contained in:
Christian Pauly 2023-01-26 09:47:30 +01:00
commit 35174cb859
54 changed files with 876 additions and 2124 deletions

View file

@ -1,10 +1,8 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:file_picker_cross/file_picker_cross.dart';
import 'package:image_picker/image_picker.dart';
import 'package:matrix/matrix.dart';
import 'package:path_provider/path_provider.dart';
import 'package:share_plus/share_plus.dart';
import 'package:fluffychat/utils/platform_infos.dart';
@ -22,17 +20,12 @@ extension MatrixFileExtension on MatrixFile {
}
void share(BuildContext context) async {
final fileName = name.split('/').last;
final tmpDirectory = await getTemporaryDirectory();
final path = '${tmpDirectory.path}$fileName';
await File(path).writeAsBytes(bytes);
// Workaround for iPad from
// https://github.com/fluttercommunity/plus_plugins/tree/main/packages/share_plus/share_plus#ipad
final box = context.findRenderObject() as RenderBox?;
await Share.shareFiles(
[path],
await Share.shareXFiles(
[XFile.fromData(bytes)],
sharePositionOrigin:
box == null ? null : box.localToGlobal(Offset.zero) & box.size,
);

View file

@ -19,7 +19,7 @@ class MatrixLocals extends MatrixLocalizations {
@override
String answeredTheCall(String senderName) {
return l10n.answeredTheCall(senderName);
return l10n.answeredTheCall(senderName, senderName);
}
@override
@ -245,7 +245,7 @@ class MatrixLocals extends MatrixLocalizations {
@override
String unknownEvent(String typeKey) {
return l10n.unknownEvent(typeKey);
return l10n.unknownEvent(typeKey, typeKey);
}
@override