fix: Import sticker packs
This commit is contained in:
parent
31b3758622
commit
1a38777cea
1 changed files with 7 additions and 17 deletions
|
|
@ -276,26 +276,16 @@ class EmotesSettingsController extends State<EmotesSettings> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> importEmojiZip() async {
|
Future<void> importEmojiZip() async {
|
||||||
final result = await showFutureLoadingDialog<Archive?>(
|
final result = await selectFiles(
|
||||||
context: context,
|
context,
|
||||||
future: () async {
|
type: FileSelectorType.zip,
|
||||||
final result = await selectFiles(
|
|
||||||
context,
|
|
||||||
type: FileSelectorType.zip,
|
|
||||||
);
|
|
||||||
|
|
||||||
if (result.isEmpty) return null;
|
|
||||||
|
|
||||||
final buffer = InputMemoryStream(await result.first.readAsBytes());
|
|
||||||
|
|
||||||
final archive = ZipDecoder().decodeStream(buffer);
|
|
||||||
|
|
||||||
return archive;
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
final archive = result.result;
|
if (result.isEmpty) return;
|
||||||
if (archive == null) return;
|
|
||||||
|
final buffer = InputMemoryStream(await result.single.readAsBytes());
|
||||||
|
|
||||||
|
final archive = ZipDecoder().decodeStream(buffer);
|
||||||
|
|
||||||
await showDialog(
|
await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue