diff --git a/api/lib/src/models/meta.dart b/api/lib/src/models/meta.dart index 9a5a43d..83fb5b1 100644 --- a/api/lib/src/models/meta.dart +++ b/api/lib/src/models/meta.dart @@ -14,7 +14,7 @@ enum FileType { @MappableClass() final class FileMetadata with FileMetadataMappable { final FileType type; - final String namespace; + final String id; final String name; final String description; final String author; @@ -24,7 +24,7 @@ final class FileMetadata with FileMetadataMappable { const FileMetadata({ this.type = FileType.pack, - this.namespace = '', + this.id = '', this.name = '', this.description = '', this.author = '', diff --git a/api/lib/src/models/meta.mapper.dart b/api/lib/src/models/meta.mapper.dart index eac0b7f..1bd701b 100644 --- a/api/lib/src/models/meta.mapper.dart +++ b/api/lib/src/models/meta.mapper.dart @@ -74,9 +74,9 @@ class FileMetadataMapper extends ClassMapperBase { static FileType _$type(FileMetadata v) => v.type; static const Field _f$type = Field('type', _$type, opt: true, def: FileType.pack); - static String _$namespace(FileMetadata v) => v.namespace; - static const Field _f$namespace = - Field('namespace', _$namespace, opt: true, def: ''); + static String _$id(FileMetadata v) => v.id; + static const Field _f$id = + Field('id', _$id, opt: true, def: ''); static String _$name(FileMetadata v) => v.name; static const Field _f$name = Field('name', _$name, opt: true, def: ''); @@ -99,7 +99,7 @@ class FileMetadataMapper extends ClassMapperBase { @override final MappableFields fields = const { #type: _f$type, - #namespace: _f$namespace, + #id: _f$id, #name: _f$name, #description: _f$description, #author: _f$author, @@ -111,7 +111,7 @@ class FileMetadataMapper extends ClassMapperBase { static FileMetadata _instantiate(DecodingData data) { return FileMetadata( type: data.dec(_f$type), - namespace: data.dec(_f$namespace), + id: data.dec(_f$id), name: data.dec(_f$name), description: data.dec(_f$description), author: data.dec(_f$author), @@ -174,7 +174,7 @@ abstract class FileMetadataCopyWith<$R, $In extends FileMetadata, $Out> implements ClassCopyWith<$R, $In, $Out> { $R call( {FileType? type, - String? namespace, + String? id, String? name, String? description, String? author, @@ -195,7 +195,7 @@ class _FileMetadataCopyWithImpl<$R, $Out> @override $R call( {FileType? type, - String? namespace, + String? id, String? name, String? description, String? author, @@ -204,7 +204,7 @@ class _FileMetadataCopyWithImpl<$R, $Out> int? fileVersion}) => $apply(FieldCopyWithData({ if (type != null) #type: type, - if (namespace != null) #namespace: namespace, + if (id != null) #id: id, if (name != null) #name: name, if (description != null) #description: description, if (author != null) #author: author, @@ -215,7 +215,7 @@ class _FileMetadataCopyWithImpl<$R, $Out> @override FileMetadata $make(CopyWithData data) => FileMetadata( type: data.get(#type, or: $value.type), - namespace: data.get(#namespace, or: $value.namespace), + id: data.get(#id, or: $value.id), name: data.get(#name, or: $value.name), description: data.get(#description, or: $value.description), author: data.get(#author, or: $value.author), diff --git a/app/lib/api/open.dart b/app/lib/api/open.dart index 2b35154..1f56735 100644 --- a/app/lib/api/open.dart +++ b/app/lib/api/open.dart @@ -81,7 +81,7 @@ Future importFileData(BuildContext context, SetonixFileSystem fileSystem, ), ); if (!(result ?? false)) return; - final namespace = metadata.namespace; + final namespace = metadata.id; switch (type) { case FileType.pack: await fileSystem.packSystem.updateFile(namespace, data); diff --git a/app/lib/pages/game/drawer.dart b/app/lib/pages/game/drawer.dart index c2f918b..7743032 100644 --- a/app/lib/pages/game/drawer.dart +++ b/app/lib/pages/game/drawer.dart @@ -80,8 +80,9 @@ class GameDrawer extends StatelessWidget { )); if (newInfo == null) return; bloc.process(MetadataChanged(newInfo.copyWith( - type: metadata.type, - namespace: metadata.namespace))); + type: metadata.type, + id: metadata.id, + ))); }, ), ],