mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
fix LinkingSuccessful
This commit is contained in:
@ -80,7 +80,7 @@ class _LoadedSpaceViewState extends State<LoadedSpaceView> {
|
|||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
children: [
|
children: [
|
||||||
widget.shouldNavigateToSpaceModelPage
|
widget.shouldNavigateToSpaceModelPage
|
||||||
// ? _spaceModels.isNotEmpty
|
? _spaceModels.isNotEmpty
|
||||||
? Row(
|
? Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(width: 300, child: SpaceTreeView(onSelect: () {})),
|
SizedBox(width: 300, child: SpaceTreeView(onSelect: () {})),
|
||||||
@ -99,7 +99,7 @@ class _LoadedSpaceViewState extends State<LoadedSpaceView> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
// : const Center(child: CircularProgressIndicator())
|
: const Center(child: CircularProgressIndicator())
|
||||||
: Row(
|
: Row(
|
||||||
children: [
|
children: [
|
||||||
SidebarWidget(
|
SidebarWidget(
|
||||||
|
@ -5,6 +5,8 @@ abstract class LinkSpaceToModelState {
|
|||||||
class SpaceModelInitial extends LinkSpaceToModelState {}
|
class SpaceModelInitial extends LinkSpaceToModelState {}
|
||||||
|
|
||||||
class SpaceModelLoading extends LinkSpaceToModelState {}
|
class SpaceModelLoading extends LinkSpaceToModelState {}
|
||||||
|
class LinkSpaceModelLoading extends LinkSpaceToModelState {}
|
||||||
|
|
||||||
|
|
||||||
class SpaceModelSelectedState extends LinkSpaceToModelState {
|
class SpaceModelSelectedState extends LinkSpaceToModelState {
|
||||||
final int selectedIndex;
|
final int selectedIndex;
|
||||||
|
@ -97,6 +97,9 @@ class SpaceModelCardWidget extends StatelessWidget {
|
|||||||
create: (_) => LinkSpaceToModelBloc(),
|
create: (_) => LinkSpaceToModelBloc(),
|
||||||
child: BlocListener<LinkSpaceToModelBloc,
|
child: BlocListener<LinkSpaceToModelBloc,
|
||||||
LinkSpaceToModelState>(
|
LinkSpaceToModelState>(
|
||||||
|
listenWhen: (previous, current) {
|
||||||
|
return previous != current;
|
||||||
|
},
|
||||||
listener: (context, state) {
|
listener: (context, state) {
|
||||||
final _bloc =
|
final _bloc =
|
||||||
BlocProvider.of<LinkSpaceToModelBloc>(
|
BlocProvider.of<LinkSpaceToModelBloc>(
|
||||||
@ -165,8 +168,15 @@ class SpaceModelCardWidget extends StatelessWidget {
|
|||||||
Navigator.of(dialogContext).pop();
|
Navigator.of(dialogContext).pop();
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder:
|
barrierDismissible: false,
|
||||||
(BuildContext dialogContext) {
|
builder: (BuildContext
|
||||||
|
successDialogContext) {
|
||||||
|
Future.delayed(
|
||||||
|
const Duration(seconds: 2), () {
|
||||||
|
Navigator.of(successDialogContext)
|
||||||
|
.pop();
|
||||||
|
});
|
||||||
|
|
||||||
return const LinkingSuccessful();
|
return const LinkingSuccessful();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user