added trailing commas wherever necessary.

This commit is contained in:
Faris Armoush
2025-04-15 15:05:06 +03:00
parent 7d0e50fb1d
commit 7945cefe53

View File

@ -24,23 +24,24 @@ class TagChipDisplay extends StatelessWidget {
final List<Tag> projectTags; final List<Tag> projectTags;
const TagChipDisplay({ const TagChipDisplay({
required this.screenWidth, required this.screenWidth,
required this.spaceModel, required this.spaceModel,
required this.products, required this.products,
required this.subspaces, required this.subspaces,
required this.allTags, required this.allTags,
required this.spaceNameController, required this.spaceNameController,
required this.projectTags, required this.projectTags,
this.pageContext, this.pageContext,
this.otherSpaceModels, this.otherSpaceModels,
this.allSpaceModels, this.allSpaceModels,
super.key, super.key,
}); });
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return (spaceModel?.tags?.isNotEmpty == true || return (spaceModel?.tags?.isNotEmpty == true ||
spaceModel?.subspaceModels?.any((subspace) => subspace.tags?.isNotEmpty == true) == spaceModel?.subspaceModels
?.any((subspace) => subspace.tags?.isNotEmpty == true) ==
true) true)
? SizedBox( ? SizedBox(
width: screenWidth * 0.25, width: screenWidth * 0.25,
@ -60,7 +61,7 @@ class TagChipDisplay extends StatelessWidget {
children: [ children: [
...TagHelper.groupTags([ ...TagHelper.groupTags([
...?spaceModel?.tags, ...?spaceModel?.tags,
...?spaceModel?.subspaceModels?.expand((subspace) => subspace.tags ?? []) ...?spaceModel?.subspaceModels?.expand((e) => e.tags ?? [])
]).entries.map( ]).entries.map(
(entry) => Chip( (entry) => Chip(
avatar: SizedBox( avatar: SizedBox(
@ -73,10 +74,9 @@ class TagChipDisplay extends StatelessWidget {
), ),
label: Text( label: Text(
'x${entry.value}', 'x${entry.value}',
style: Theme.of(context) style: Theme.of(context).textTheme.bodySmall!.copyWith(
.textTheme color: ColorsManager.spaceColor,
.bodySmall! ),
.copyWith(color: ColorsManager.spaceColor),
), ),
backgroundColor: ColorsManager.whiteColors, backgroundColor: ColorsManager.whiteColors,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
@ -87,24 +87,30 @@ class TagChipDisplay extends StatelessWidget {
), ),
), ),
), ),
EditChip(onTap: () => showDialog<bool>( EditChip(
context: context, onTap: () => showDialog<bool>(
builder: (context) => AssignTagModelsDialog( context: context,
products: products, builder: (context) => AssignTagModelsDialog(
allSpaceModels: allSpaceModels, products: products,
subspaces: subspaces, allSpaceModels: allSpaceModels,
pageContext: pageContext, subspaces: subspaces,
allTags: allTags, pageContext: pageContext,
spaceModel: spaceModel, allTags: allTags,
otherSpaceModels: otherSpaceModels, spaceModel: spaceModel,
initialTags: TagHelper.generateInitialTags( otherSpaceModels: otherSpaceModels,
subspaces: subspaces, spaceTagModels: spaceModel?.tags ?? []), initialTags: TagHelper.generateInitialTags(
title: 'Edit Device', subspaces: subspaces,
addedProducts: TagHelper.createInitialSelectedProducts( spaceTagModels: spaceModel?.tags ?? []),
spaceModel?.tags ?? [], subspaces), title: 'Edit Device',
spaceName: spaceModel?.modelName ?? '', addedProducts: TagHelper.createInitialSelectedProducts(
projectTags: projectTags, spaceModel?.tags ?? [],
))) subspaces,
),
spaceName: spaceModel?.modelName ?? '',
projectTags: projectTags,
),
),
),
], ],
), ),
), ),