refactor: Migrate to Flutter 3.7.0
This commit is contained in:
parent
23438b7a42
commit
35174cb859
54 changed files with 876 additions and 2124 deletions
|
|
@ -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,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue