fix LinkingSuccessful

This commit is contained in:
mohammad
2025-03-09 16:01:04 +03:00
parent e8e5e9bcb7
commit dee07ebb06
3 changed files with 16 additions and 4 deletions

View File

@ -80,7 +80,7 @@ class _LoadedSpaceViewState extends State<LoadedSpaceView> {
clipBehavior: Clip.none,
children: [
widget.shouldNavigateToSpaceModelPage
// ? _spaceModels.isNotEmpty
? _spaceModels.isNotEmpty
? Row(
children: [
SizedBox(width: 300, child: SpaceTreeView(onSelect: () {})),
@ -99,7 +99,7 @@ class _LoadedSpaceViewState extends State<LoadedSpaceView> {
),
],
)
// : const Center(child: CircularProgressIndicator())
: const Center(child: CircularProgressIndicator())
: Row(
children: [
SidebarWidget(

View File

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

View File

@ -97,6 +97,9 @@ class SpaceModelCardWidget extends StatelessWidget {
create: (_) => LinkSpaceToModelBloc(),
child: BlocListener<LinkSpaceToModelBloc,
LinkSpaceToModelState>(
listenWhen: (previous, current) {
return previous != current;
},
listener: (context, state) {
final _bloc =
BlocProvider.of<LinkSpaceToModelBloc>(
@ -165,8 +168,15 @@ class SpaceModelCardWidget extends StatelessWidget {
Navigator.of(dialogContext).pop();
showDialog(
context: context,
builder:
(BuildContext dialogContext) {
barrierDismissible: false,
builder: (BuildContext
successDialogContext) {
Future.delayed(
const Duration(seconds: 2), () {
Navigator.of(successDialogContext)
.pop();
});
return const LinkingSuccessful();
},
);