diff --git a/lib/pages/spaces_management/space_model/view/space_model_page.dart b/lib/pages/spaces_management/space_model/view/space_model_page.dart index eab43e08..d0b5a300 100644 --- a/lib/pages/spaces_management/space_model/view/space_model_page.dart +++ b/lib/pages/spaces_management/space_model/view/space_model_page.dart @@ -67,10 +67,24 @@ class SpaceModelPage extends StatelessWidget { } // Render existing space model final model = spaceModels[index]; - return Container( - margin: const EdgeInsets.all(8.0), - child: SpaceModelCardWidget(model:model), - ); + return GestureDetector( + onTap: () { + showDialog( + context: context, + builder: (BuildContext dialogContext) { + return CreateSpaceModelDialog( + products: products, + allTags: allTagValues, + spaceModel: model, + onLoad: (newModel) {}, + ); + }, + ); + }, + child: Container( + margin: const EdgeInsets.all(8.0), + child: SpaceModelCardWidget(model: model), + )); }, ), ), @@ -94,14 +108,14 @@ class SpaceModelPage extends StatelessWidget { double _calculateChildAspectRatio(BuildContext context) { double screenWidth = MediaQuery.of(context).size.width; if (screenWidth > 1600) { - return 2; + return 2; } if (screenWidth > 1200) { - return 3; + return 3; } else if (screenWidth > 800) { - return 3.5; + return 3.5; } else { - return 4.0; + return 4.0; } } diff --git a/lib/pages/spaces_management/space_model/widgets/dialog/create_space_model_dialog.dart b/lib/pages/spaces_management/space_model/widgets/dialog/create_space_model_dialog.dart index 1e2fc517..e5dea2b9 100644 --- a/lib/pages/spaces_management/space_model/widgets/dialog/create_space_model_dialog.dart +++ b/lib/pages/spaces_management/space_model/widgets/dialog/create_space_model_dialog.dart @@ -72,7 +72,7 @@ class CreateSpaceModelDialog extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Text( - 'Create New Space Model', + spaceModel?.uuid == null ? 'Create New Space Model': 'Edit Space Model', style: Theme.of(context) .textTheme .headlineLarge