mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
added create
This commit is contained in:
@ -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);
|
||||||
|
@ -145,6 +145,8 @@ class CreateSpaceModelDialog extends StatelessWidget {
|
|||||||
spaceTemplate:
|
spaceTemplate:
|
||||||
updatedSpaceTemplate),
|
updatedSpaceTemplate),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
backgroundColor: ColorsManager.secondaryColor,
|
backgroundColor: ColorsManager.secondaryColor,
|
||||||
|
Reference in New Issue
Block a user