added create

This commit is contained in:
hannathkadher
2025-01-08 21:06:31 +04:00
parent 17e025b69f
commit 48c064c711
2 changed files with 5 additions and 4 deletions

View File

@ -37,9 +37,9 @@ class CreateSpaceModelBloc
tags: tagBodyModels, tags: tagBodyModels,
subspaceModels: subspaceTemplateBodyModels); subspaceModels: subspaceTemplateBodyModels);
final success = await _api.createSpaceModel(spaceModelBody); await _api.createSpaceModel(spaceModelBody);
} catch (e) { } catch (e) {
print(e); emit(CreateSpaceModelError('Error creating space model'));
} }
}); });
@ -86,8 +86,7 @@ class CreateSpaceModelBloc
currentState.space, currentState.space,
errorMessage: "Model name cannot be empty", errorMessage: "Model name cannot be empty",
)); ));
print('State emitted: CreateSpaceModelLoaded with updated model:'); print('State emitted: CreateSpaceModelLoaded with updated model:');
} else { } else {
final updatedSpaceModel = final updatedSpaceModel =
currentState.space.copyWith(modelName: event.name); currentState.space.copyWith(modelName: event.name);

View File

@ -145,6 +145,8 @@ class CreateSpaceModelDialog extends StatelessWidget {
spaceTemplate: spaceTemplate:
updatedSpaceTemplate), updatedSpaceTemplate),
); );
Navigator.of(context).pop();
} }
: null, : null,
backgroundColor: ColorsManager.secondaryColor, backgroundColor: ColorsManager.secondaryColor,