added load new space models

This commit is contained in:
hannathkadher
2025-01-09 00:07:51 +04:00
parent 48c064c711
commit 339a242e74
12 changed files with 249 additions and 74 deletions

View File

@ -17,10 +17,15 @@ class CreateSpaceModelDialog extends StatelessWidget {
final List<ProductModel>? products;
final List<String>? allTags;
final SpaceTemplateModel? spaceModel;
final void Function(SpaceTemplateModel newModel)? onLoad;
const CreateSpaceModelDialog(
{Key? key, this.products, this.allTags, this.spaceModel})
: super(key: key);
const CreateSpaceModelDialog({
Key? key,
this.products,
this.allTags,
this.spaceModel,
this.onLoad,
}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -142,11 +147,15 @@ class CreateSpaceModelDialog extends StatelessWidget {
);
context.read<CreateSpaceModelBloc>().add(
CreateSpaceTemplate(
spaceTemplate:
updatedSpaceTemplate),
spaceTemplate:
updatedSpaceTemplate,
onCreate: (newModel) {
onLoad!(newModel);
Navigator.of(context)
.pop(); // Close the dialog
},
),
);
Navigator.of(context).pop();
}
: null,
backgroundColor: ColorsManager.secondaryColor,