formatted all files.

This commit is contained in:
Faris Armoush
2025-06-12 15:33:32 +03:00
parent 29959f567e
commit 04250ebc98
474 changed files with 5425 additions and 4338 deletions

View File

@ -26,27 +26,27 @@ class LinkSpaceToModelBloc
Future<void> _getSpaceIds(LinkSpaceModelSelectedIdsEvent event,
Emitter<LinkSpaceToModelState> emit) async {
try {
BuildContext context = NavigationService.navigatorKey.currentContext!;
var spaceBloc = context.read<SpaceTreeBloc>();
spacesListIds.clear();
for (var communityId in spaceBloc.state.selectedCommunities) {
List<String> spacesList =
final context = NavigationService.navigatorKey.currentContext!;
final spaceBloc = context.read<SpaceTreeBloc>();
spacesListIds.clear();
for (final communityId in spaceBloc.state.selectedCommunities) {
final spacesList =
spaceBloc.state.selectedCommunityAndSpaces[communityId] ?? [];
spacesListIds.addAll(spacesList);
spacesListIds.addAll(spacesList);
}
hasSelectedSpaces =
spaceBloc.state.selectedCommunities.any((communityId) {
List<String> spacesList =
final spacesList =
spaceBloc.state.selectedCommunityAndSpaces[communityId] ?? [];
return spacesList.isNotEmpty;
});
if (hasSelectedSpaces) {
debugPrint("At least one space is selected.");
debugPrint('At least one space is selected.');
} else {
debugPrint("No spaces selected.");
debugPrint('No spaces selected.');
}
} catch (e) {
debugPrint("Error in _getSpaceIds: $e");
debugPrint('Error in _getSpaceIds: $e');
}
}

View File

@ -5,8 +5,8 @@ abstract class LinkSpaceToModelState {
class SpaceModelInitial extends LinkSpaceToModelState {}
class SpaceModelLoading extends LinkSpaceToModelState {}
class LinkSpaceModelLoading extends LinkSpaceToModelState {}
class LinkSpaceModelLoading extends LinkSpaceToModelState {}
class SpaceModelSelectedState extends LinkSpaceToModelState {
final int selectedIndex;

View File

@ -15,11 +15,11 @@ class LinkSpaceModelDialog extends StatelessWidget {
final List<SpaceTemplateModel> spaceModels;
const LinkSpaceModelDialog({
Key? key,
super.key,
this.onSave,
this.initialSelectedIndex,
required this.spaceModels,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {
@ -39,9 +39,10 @@ class LinkSpaceModelDialog extends StatelessWidget {
color: ColorsManager.textFieldGreyColor,
width: MediaQuery.of(context).size.width * 0.7,
height: MediaQuery.of(context).size.height * 0.6,
child: BlocBuilder<LinkSpaceToModelBloc, LinkSpaceToModelState>(
child: BlocBuilder<LinkSpaceToModelBloc,
LinkSpaceToModelState>(
builder: (context, state) {
int selectedIndex = -1;
var selectedIndex = -1;
if (state is SpaceModelSelectedState) {
selectedIndex = state.selectedIndex;
}
@ -72,7 +73,9 @@ class LinkSpaceModelDialog extends StatelessWidget {
),
borderRadius: BorderRadius.circular(8.0),
),
child: SpaceModelCardWidget(model: model,),
child: SpaceModelCardWidget(
model: model,
),
),
);
},