edit and create

This commit is contained in:
hannathkadher
2025-01-20 10:28:46 +04:00
parent 440263e2f9
commit fe680d15f2
2 changed files with 23 additions and 9 deletions

View File

@ -67,10 +67,24 @@ class SpaceModelPage extends StatelessWidget {
} }
// Render existing space model // Render existing space model
final model = spaceModels[index]; final model = spaceModels[index];
return Container( return GestureDetector(
margin: const EdgeInsets.all(8.0), onTap: () {
child: SpaceModelCardWidget(model:model), 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 _calculateChildAspectRatio(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width; double screenWidth = MediaQuery.of(context).size.width;
if (screenWidth > 1600) { if (screenWidth > 1600) {
return 2; return 2;
} }
if (screenWidth > 1200) { if (screenWidth > 1200) {
return 3; return 3;
} else if (screenWidth > 800) { } else if (screenWidth > 800) {
return 3.5; return 3.5;
} else { } else {
return 4.0; return 4.0;
} }
} }

View File

@ -72,7 +72,7 @@ class CreateSpaceModelDialog extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text( Text(
'Create New Space Model', spaceModel?.uuid == null ? 'Create New Space Model': 'Edit Space Model',
style: Theme.of(context) style: Theme.of(context)
.textTheme .textTheme
.headlineLarge .headlineLarge