update archive
This commit is contained in:
parent
451c05b98e
commit
d3d75252ee
|
|
@ -136,6 +136,7 @@ class ChatController extends State<ChatPageWithRoom>
|
||||||
builder: (c) => SendFileDialog(
|
builder: (c) => SendFileDialog(
|
||||||
files: details.files,
|
files: details.files,
|
||||||
room: room,
|
room: room,
|
||||||
|
replyEvent: replyEvent,
|
||||||
outerContext: context,
|
outerContext: context,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -273,10 +274,11 @@ class ChatController extends State<ChatPageWithRoom>
|
||||||
showAdaptiveDialog(
|
showAdaptiveDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (c) => SendFileDialog(
|
builder: (c) => SendFileDialog(
|
||||||
files: files,
|
files: files,
|
||||||
room: room,
|
room: room,
|
||||||
outerContext: context,
|
outerContext: context,
|
||||||
replyEvent: replyEvent),
|
replyEvent: replyEvent,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -554,7 +556,10 @@ class ChatController extends State<ChatPageWithRoom>
|
||||||
allowMultiple: true,
|
allowMultiple: true,
|
||||||
type: type,
|
type: type,
|
||||||
);
|
);
|
||||||
if (files.isEmpty) return;
|
if (files.isEmpty) {
|
||||||
|
Logs().v("Returning in sendFileAction, bc files.isEmpty==true");
|
||||||
|
return;
|
||||||
|
}
|
||||||
await showAdaptiveDialog(
|
await showAdaptiveDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (c) => SendFileDialog(
|
builder: (c) => SendFileDialog(
|
||||||
|
|
@ -764,9 +769,10 @@ class ChatController extends State<ChatPageWithRoom>
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var content = {...event.content};
|
var content = {...event.content};
|
||||||
try {
|
try {
|
||||||
text = await Translator.translate(text, PlatformDispatcher.instance.locale.languageCode);
|
text = await Translator.translate(
|
||||||
|
text, PlatformDispatcher.instance.locale.languageCode);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(content: Text(L10n.of(context).errorTranslatingMessage)),
|
SnackBar(content: Text(L10n.of(context).errorTranslatingMessage)),
|
||||||
|
|
@ -782,7 +788,14 @@ class ChatController extends State<ChatPageWithRoom>
|
||||||
Navigator.of(context).push(new MaterialPageRoute(
|
Navigator.of(context).push(new MaterialPageRoute(
|
||||||
builder: (BuildContext ctx) {
|
builder: (BuildContext ctx) {
|
||||||
return TranslatedEventDialog(
|
return TranslatedEventDialog(
|
||||||
event: new Event(content: content, type: 'm.room.message', eventId: event.eventId, senderId: event.senderId, originServerTs: event.originServerTs, room: room), timeline: timeline!);
|
event: new Event(
|
||||||
|
content: content,
|
||||||
|
type: 'm.room.message',
|
||||||
|
eventId: event.eventId,
|
||||||
|
senderId: event.senderId,
|
||||||
|
originServerTs: event.originServerTs,
|
||||||
|
room: room),
|
||||||
|
timeline: timeline!);
|
||||||
},
|
},
|
||||||
fullscreenDialog: true));
|
fullscreenDialog: true));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -243,82 +243,82 @@ class SendFileDialogState extends State<SendFileDialog> {
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
if (uniqueFileType == 'image')
|
// if (uniqueFileType == 'image')
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 16.0),
|
// padding: const EdgeInsets.only(bottom: 16.0),
|
||||||
child: SizedBox(
|
// child: SizedBox(
|
||||||
height: 256,
|
// height: 256,
|
||||||
child: Center(
|
// child: Center(
|
||||||
child: ListView.builder(
|
// child: ListView.builder(
|
||||||
shrinkWrap: true,
|
// shrinkWrap: true,
|
||||||
itemCount: widget.files.length,
|
// itemCount: widget.files.length,
|
||||||
scrollDirection: Axis.horizontal,
|
// scrollDirection: Axis.horizontal,
|
||||||
itemBuilder: (context, i) => Padding(
|
// itemBuilder: (context, i) => Padding(
|
||||||
padding: const EdgeInsets.only(right: 8.0),
|
// padding: const EdgeInsets.only(right: 8.0),
|
||||||
child: Material(
|
// child: Material(
|
||||||
borderRadius: BorderRadius.circular(
|
// borderRadius: BorderRadius.circular(
|
||||||
AppConfig.borderRadius / 2,
|
// AppConfig.borderRadius / 2,
|
||||||
),
|
// ),
|
||||||
color: Colors.black,
|
// color: Colors.black,
|
||||||
clipBehavior: Clip.hardEdge,
|
// clipBehavior: Clip.hardEdge,
|
||||||
child: FutureBuilder(
|
// child: FutureBuilder(
|
||||||
future: widget.files[i].readAsBytes(),
|
// future: widget.files[i].readAsBytes(),
|
||||||
builder: (context, snapshot) {
|
// builder: (context, snapshot) {
|
||||||
final bytes = snapshot.data;
|
// final bytes = snapshot.data;
|
||||||
if (bytes == null) {
|
// if (bytes == null) {
|
||||||
return const Center(
|
// return const Center(
|
||||||
child: CircularProgressIndicator
|
// child: CircularProgressIndicator
|
||||||
.adaptive(),
|
// .adaptive(),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
if (snapshot.error != null) {
|
// if (snapshot.error != null) {
|
||||||
Logs().w(
|
// Logs().w(
|
||||||
'Unable to preview image',
|
// 'Unable to preview image',
|
||||||
snapshot.error,
|
// snapshot.error,
|
||||||
snapshot.stackTrace,
|
// snapshot.stackTrace,
|
||||||
);
|
// );
|
||||||
return const Center(
|
// return const Center(
|
||||||
child: SizedBox(
|
// child: SizedBox(
|
||||||
width: 256,
|
// width: 256,
|
||||||
height: 256,
|
// height: 256,
|
||||||
child: Icon(
|
// child: Icon(
|
||||||
Icons.broken_image_outlined,
|
// Icons.broken_image_outlined,
|
||||||
size: 64,
|
// size: 64,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
return Image.memory(
|
// return Image.memory(
|
||||||
bytes,
|
// bytes,
|
||||||
height: 256,
|
// height: 256,
|
||||||
width: widget.files.length == 1
|
// width: widget.files.length == 1
|
||||||
? 256 - 36
|
// ? 256 - 36
|
||||||
: null,
|
// : null,
|
||||||
fit: BoxFit.contain,
|
// fit: BoxFit.contain,
|
||||||
errorBuilder: (context, e, s) {
|
// errorBuilder: (context, e, s) {
|
||||||
Logs()
|
// Logs()
|
||||||
.w('Unable to preview image', e, s);
|
// .w('Unable to preview image', e, s);
|
||||||
return const Center(
|
// return const Center(
|
||||||
child: SizedBox(
|
// child: SizedBox(
|
||||||
width: 256,
|
// width: 256,
|
||||||
height: 256,
|
// height: 256,
|
||||||
child: Icon(
|
// child: Icon(
|
||||||
Icons.broken_image_outlined,
|
// Icons.broken_image_outlined,
|
||||||
size: 64,
|
// size: 64,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
if (uniqueFileType != 'image')
|
// if (uniqueFileType != 'image')
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 16.0),
|
padding: const EdgeInsets.only(bottom: 16.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|
|
||||||
|
|
@ -286,9 +286,9 @@ class EmotesSettingsController extends State<EmotesSettings> {
|
||||||
|
|
||||||
if (result.isEmpty) return null;
|
if (result.isEmpty) return null;
|
||||||
|
|
||||||
final buffer = InputStream(await result.first.readAsBytes());
|
final buffer = await result.first.readAsBytes();
|
||||||
|
|
||||||
final archive = ZipDecoder().decodeBuffer(buffer);
|
final archive = ZipDecoder().decodeBytes(buffer);
|
||||||
|
|
||||||
return archive;
|
return archive;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ abstract class ClientManager {
|
||||||
},
|
},
|
||||||
logLevel: kReleaseMode ? Level.warning : Level.verbose,
|
logLevel: kReleaseMode ? Level.warning : Level.verbose,
|
||||||
//database: flutterMatrixSdkDatabaseBuilder(client),
|
//database: flutterMatrixSdkDatabaseBuilder(client),
|
||||||
legacyDatabaseBuilder: flutterMatrixSdkDatabaseBuilder,
|
databaseBuilder: flutterMatrixSdkDatabaseBuilder,
|
||||||
supportedLoginTypes: {
|
supportedLoginTypes: {
|
||||||
AuthenticationTypes.password,
|
AuthenticationTypes.password,
|
||||||
AuthenticationTypes.sso,
|
AuthenticationTypes.sso,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ extension LocalizedBody on Event {
|
||||||
|
|
||||||
void saveFile(BuildContext context) async {
|
void saveFile(BuildContext context) async {
|
||||||
final matrixFile = await _getFile(context);
|
final matrixFile = await _getFile(context);
|
||||||
|
|
||||||
matrixFile.result?.save(context);
|
matrixFile.result?.save(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
16
pubspec.lock
16
pubspec.lock
|
|
@ -69,10 +69,10 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: archive
|
name: archive
|
||||||
sha256: cb6a278ef2dbb298455e1a713bda08524a175630ec643a242c399c932a0a1f7d
|
sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.6.1"
|
version: "4.0.7"
|
||||||
args:
|
args:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -901,10 +901,10 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: image
|
name: image
|
||||||
sha256: f31d52537dc417fdcde36088fdf11d191026fd5e4fae742491ebd40e5a8bea7d
|
sha256: "4e973fcf4caae1a4be2fa0a13157aa38a8f9cb049db6529aa00b4d71abc4d928"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.3.0"
|
version: "4.5.4"
|
||||||
image_picker:
|
image_picker:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
@ -1445,6 +1445,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.5.1"
|
version: "1.5.1"
|
||||||
|
posix:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: posix
|
||||||
|
sha256: f0d7856b6ca1887cfa6d1d394056a296ae33489db914e365e2044fdada449e62
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.0.2"
|
||||||
pretty_qr_code:
|
pretty_qr_code:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ environment:
|
||||||
dependencies:
|
dependencies:
|
||||||
animations: ^2.0.11
|
animations: ^2.0.11
|
||||||
app_links: ^6.3.3
|
app_links: ^6.3.3
|
||||||
archive: ^3.4.10
|
archive: ^4.0.7
|
||||||
async: ^2.11.0
|
async: ^2.11.0
|
||||||
badges: ^3.1.2
|
badges: ^3.1.2
|
||||||
blurhash_dart: ^1.2.1
|
blurhash_dart: ^1.2.1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue