subspace model and view

This commit is contained in:
hannathkadher
2025-01-05 14:06:46 +04:00
parent 691beb2e86
commit d2d5e76102

View File

@ -128,6 +128,8 @@ class CreateSpaceModelDialog extends StatelessWidget {
Widget _buildSubspacesSection(
BuildContext context, List<SubspaceTemplateModel> subspaces) {
final screenWidth = MediaQuery.of(context).size.width;
return Container(
child: subspaces.isEmpty
? TextButton(
@ -162,27 +164,43 @@ class CreateSpaceModelDialog extends StatelessWidget {
label: 'Create Sub Space',
),
)
: Row(
: SizedBox(
width: screenWidth * 0.25, // Set the desired width
child: Container(
padding: const EdgeInsets.all(
8.0), // Add padding around the content
decoration: BoxDecoration(
color: ColorsManager.textFieldGreyColor, // Background color
borderRadius: BorderRadius.circular(15), // Rounded corners
border: Border.all(
color: ColorsManager.textFieldGreyColor, // Border color
width: 3.0, // Border width
),
),
child: Wrap(
spacing: 8.0, // Spacing between chips
runSpacing: 8.0, // Spacing between rows of chips
children: [
Expanded(
child: TextField(
readOnly: true,
decoration: InputDecoration(
filled: true,
fillColor: ColorsManager.whiteColors,
hintText: subspaces.map((e) => e.subspaceName).join(", "),
hintStyle:
const TextStyle(color: ColorsManager.spaceColor),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10),
borderSide: BorderSide.none,
...subspaces.map(
(subspace) => Chip(
label: Text(
subspace.subspaceName,
style: const TextStyle(
color: ColorsManager.spaceColor), // Text color
),
backgroundColor:
Colors.white, // Chip background color
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(16), // Rounded chip
side: const BorderSide(
color:
ColorsManager.spaceColor), // Border color
),
),
),
),
const SizedBox(width: 10),
TextButton(
onPressed: () async {
GestureDetector(
onTap: () async {
final result =
await showDialog<List<SubspaceTemplateModel>>(
barrierDismissible: false,
@ -204,20 +222,27 @@ class CreateSpaceModelDialog extends StatelessWidget {
.add(AddSubspacesToSpaceTemplate(subspaces));
}
},
style: TextButton.styleFrom(
backgroundColor: ColorsManager.whiteColors,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(color: ColorsManager.spaceColor),
),
),
child: const Text(
child: Chip(
label: const Text(
'Edit',
style: TextStyle(color: ColorsManager.spaceColor),
style: TextStyle(
color: ColorsManager
.spaceColor), // Text color for "Edit"
),
backgroundColor:
Colors.white, // Background color for "Edit"
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(16), // Rounded chip
side: const BorderSide(
color:
ColorsManager.spaceColor), // Border color
),
),
),
],
),
);
),
));
}
}