Skip to content

Commit daee393

Browse files
committed
Improve importing in editor
1 parent 4bb1429 commit daee393

File tree

7 files changed

+31
-38
lines changed

7 files changed

+31
-38
lines changed

api/lib/src/models/data.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'dart:convert';
22
import 'dart:typed_data';
33

4-
import 'package:archive/archive.dart';
54
import 'package:crypto/crypto.dart';
65
import 'package:lw_file_system_api/lw_file_system_api.dart';
76
import 'background.dart';
@@ -205,10 +204,6 @@ class SetonixData extends ArchiveData<SetonixData> {
205204
return MapEntry(e, translation);
206205
}).nonNulls;
207206

208-
@override
209-
Uint8List exportAsBytes() => ZipEncoder(password: state.password)
210-
.encodeBytes(export(), autoClose: true);
211-
212207
PackTranslation? getTranslation([String id = kFallbackLocale]) {
213208
final data = getAsset('$kPackTranslationsPath/$id.json');
214209
if (data == null) return null;

api/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@ packages:
310310
dependency: "direct main"
311311
description:
312312
path: "packages/lw_file_system_api"
313-
ref: "2ddfa39ade2cbea314eb51f95b50ecb6bd5469bf"
314-
resolved-ref: "2ddfa39ade2cbea314eb51f95b50ecb6bd5469bf"
313+
ref: fcac45caf2dc178a1d81c0f0b633fbe8210a81a5
314+
resolved-ref: fcac45caf2dc178a1d81c0f0b633fbe8210a81a5
315315
url: "https://github.com/LinwoodDev/dart_pkgs.git"
316316
source: git
317317
version: "1.0.0"

api/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ dependencies:
1414
lw_file_system_api:
1515
git:
1616
url: https://github.com/LinwoodDev/dart_pkgs.git
17-
ref: 2ddfa39ade2cbea314eb51f95b50ecb6bd5469bf
17+
ref: fcac45caf2dc178a1d81c0f0b633fbe8210a81a5
1818
path: packages/lw_file_system_api
1919
networker:
2020
git:

app/lib/pages/packs/editor.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,12 @@ class _EditorPacksViewState extends State<_EditorPacksView> {
131131
onPressed: () => showLeapBottomSheet(
132132
context: context,
133133
titleBuilder: (context) => Text(AppLocalizations.of(context).add),
134-
childrenBuilder: (context) => [
134+
childrenBuilder: (ctx) => [
135135
ListTile(
136-
title: Text(LeapLocalizations.of(context).create),
136+
title: Text(LeapLocalizations.of(ctx).create),
137137
leading: const Icon(PhosphorIconsLight.plusCircle),
138138
onTap: () async {
139+
Navigator.of(ctx).pop();
139140
final name = await showDialog(
140141
context: context, builder: (context) => NameDialog());
141142
if (name == null) return;
@@ -156,6 +157,7 @@ class _EditorPacksViewState extends State<_EditorPacksView> {
156157
if (packs.isEmpty || !context.mounted) {
157158
return;
158159
}
160+
Navigator.of(ctx).pop();
159161
showDialog(
160162
context: context,
161163
builder: (context) => AlertDialog(
@@ -171,9 +173,9 @@ class _EditorPacksViewState extends State<_EditorPacksView> {
171173
title: Text(metadata.name),
172174
subtitle: Text(pack.identifier),
173175
onTap: () async {
174-
await _fileSystem.editorSystem.createFile(
175-
metadata.name,
176-
SetonixData.fromData(data.exportAsBytes()));
176+
Navigator.of(context).pop();
177+
await _fileSystem.editorSystem
178+
.createFile(metadata.name, data);
177179
_reloadPacks();
178180
},
179181
);
@@ -193,6 +195,7 @@ class _EditorPacksViewState extends State<_EditorPacksView> {
193195
title: Text(AppLocalizations.of(context).import),
194196
leading: const Icon(PhosphorIconsLight.arrowSquareIn),
195197
onTap: () async {
198+
Navigator.of(ctx).pop();
196199
final result = await fs.openFile(
197200
acceptedTypeGroups: [
198201
fs.XTypeGroup(

app/pubspec.lock

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ packages:
254254
dependency: "direct main"
255255
description:
256256
name: device_info_plus
257-
sha256: c3093ce936028bf4b35d0dd54948ee62ed1cf95f6ae4447c7abed07c7cbee38b
257+
sha256: "72d146c6d7098689ff5c5f66bcf593ac11efc530095385356e131070333e64da"
258258
url: "https://pub.dev"
259259
source: hosted
260-
version: "11.3.1"
260+
version: "11.3.0"
261261
device_info_plus_platform_interface:
262262
dependency: transitive
263263
description:
@@ -381,12 +381,11 @@ packages:
381381
flame_bloc:
382382
dependency: "direct main"
383383
description:
384-
path: "packages/flame_bloc"
385-
ref: "2d76592b9d40007ede2dc0cb9c87858e1ec50bb5"
386-
resolved-ref: "2d76592b9d40007ede2dc0cb9c87858e1ec50bb5"
387-
url: "https://github.com/CodeDoctorDE/flame.git"
388-
source: git
389-
version: "1.12.5"
384+
name: flame_bloc
385+
sha256: "18d174cc4ab5a3f320b6a54bad1388cc63fc696651d76f227fb1fee1aac62dfd"
386+
url: "https://pub.dev"
387+
source: hosted
388+
version: "1.12.7"
390389
flame_tiled:
391390
dependency: "direct main"
392391
description:
@@ -682,17 +681,17 @@ packages:
682681
dependency: "direct main"
683682
description:
684683
path: "packages/lw_file_system"
685-
ref: "835828f9e377da7311d28f3f09c26cecc1256e7c"
686-
resolved-ref: "835828f9e377da7311d28f3f09c26cecc1256e7c"
684+
ref: ec1b82c9fe4d1bf3bd18d7fed311b8ae1301b9d7
685+
resolved-ref: ec1b82c9fe4d1bf3bd18d7fed311b8ae1301b9d7
687686
url: "https://github.com/LinwoodDev/dart_pkgs.git"
688687
source: git
689688
version: "1.0.0"
690689
lw_file_system_api:
691690
dependency: transitive
692691
description:
693692
path: "packages/lw_file_system_api"
694-
ref: "2ddfa39ade2cbea314eb51f95b50ecb6bd5469bf"
695-
resolved-ref: "2ddfa39ade2cbea314eb51f95b50ecb6bd5469bf"
693+
ref: fcac45caf2dc178a1d81c0f0b633fbe8210a81a5
694+
resolved-ref: fcac45caf2dc178a1d81c0f0b633fbe8210a81a5
696695
url: "https://github.com/LinwoodDev/dart_pkgs.git"
697696
source: git
698697
version: "1.0.0"
@@ -733,8 +732,8 @@ packages:
733732
dependency: "direct main"
734733
description:
735734
path: "packages/material_leap"
736-
ref: "835828f9e377da7311d28f3f09c26cecc1256e7c"
737-
resolved-ref: "835828f9e377da7311d28f3f09c26cecc1256e7c"
735+
ref: ec1b82c9fe4d1bf3bd18d7fed311b8ae1301b9d7
736+
resolved-ref: ec1b82c9fe4d1bf3bd18d7fed311b8ae1301b9d7
738737
url: "https://github.com/LinwoodDev/dart_pkgs.git"
739738
source: git
740739
version: "0.0.1"
@@ -1418,10 +1417,10 @@ packages:
14181417
dependency: transitive
14191418
description:
14201419
name: win32_registry
1421-
sha256: "6f1b564492d0147b330dd794fee8f512cec4977957f310f9951b5f9d83618dae"
1420+
sha256: "21ec76dfc731550fd3e2ce7a33a9ea90b828fdf19a5c3bcf556fa992cfa99852"
14221421
url: "https://pub.dev"
14231422
source: hosted
1424-
version: "2.1.0"
1423+
version: "1.1.5"
14251424
window_manager:
14261425
dependency: "direct main"
14271426
description:

app/pubspec.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies:
3232
material_leap:
3333
git:
3434
url: https://github.com/LinwoodDev/dart_pkgs.git
35-
ref: 835828f9e377da7311d28f3f09c26cecc1256e7c
35+
ref: ec1b82c9fe4d1bf3bd18d7fed311b8ae1301b9d7
3636
path: packages/material_leap
3737
flex_color_scheme: ^8.1.0
3838
flutter_svg: ^2.0.10+1
@@ -46,11 +46,7 @@ dependencies:
4646
flutter_bloc: ^9.0.0
4747
rxdart: ^0.28.0
4848
collection: ^1.18.0
49-
flame_bloc:
50-
git:
51-
url: https://github.com/CodeDoctorDE/flame.git
52-
ref: 2d76592b9d40007ede2dc0cb9c87858e1ec50bb5
53-
path: packages/flame_bloc
49+
flame_bloc: ^1.12.7
5450
flame: ">=1.25.0 <1.26.0"
5551
flame_tiled: ">=2.0.1 <2.1.0"
5652
# Networking
@@ -68,7 +64,7 @@ dependencies:
6864
path: packages/networker/networker_socket
6965
# System Information
7066
dynamic_color: ^1.7.0
71-
device_info_plus: ^11.0.0
67+
device_info_plus: ^11.3.0
7268
package_info_plus: ^8.0.0
7369
path_provider: ^2.1.4
7470
url_launcher: ^6.2.6
@@ -77,7 +73,7 @@ dependencies:
7773
lw_file_system:
7874
git:
7975
url: https://github.com/LinwoodDev/dart_pkgs.git
80-
ref: 835828f9e377da7311d28f3f09c26cecc1256e7c
76+
ref: ec1b82c9fe4d1bf3bd18d7fed311b8ae1301b9d7
8177
path: packages/lw_file_system
8278
lw_sysapi:
8379
git:

plugin/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
edition = "2021"
55

66
[lib]
7-
crate-type = ["cdylib"]
7+
crate-type = ["cdylib", "staticlib"]
88

99
[dependencies]
1010
anyhow = { version = "1", features = ["backtrace"] }

0 commit comments

Comments
 (0)