mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-15 17:47:53 +00:00
Compare commits
5 Commits
SP-1297
...
feat/fix-u
Author | SHA1 | Date | |
---|---|---|---|
24280549ec | |||
ada19a5992 | |||
c6702d4d5f | |||
f78e2e2d36 | |||
83b9555920 |
@ -101,7 +101,7 @@ class CustomExpansionTileState extends State<CustomExpansionTile> {
|
|||||||
widget.children != null &&
|
widget.children != null &&
|
||||||
widget.children!.isNotEmpty)
|
widget.children!.isNotEmpty)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 48.0), // Indented children
|
padding: const EdgeInsets.only(left: 24.0), // Indented children
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: widget.children!,
|
children: widget.children!,
|
||||||
|
@ -83,7 +83,7 @@ class CustomExpansionTileSpaceTree extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (isExpanded && children != null && children!.isNotEmpty)
|
if (isExpanded && children != null && children!.isNotEmpty)
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(left: 48.0),
|
padding: const EdgeInsets.only(left: 24.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: children ?? [],
|
children: children ?? [],
|
||||||
),
|
),
|
||||||
|
@ -22,7 +22,7 @@ class CommunityTile extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(left: 16.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: CustomExpansionTile(
|
child: CustomExpansionTile(
|
||||||
title: title,
|
title: title,
|
||||||
initiallyExpanded: isExpanded,
|
initiallyExpanded: isExpanded,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
|
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_bloc.dart';
|
||||||
import 'package:syncrow_web/pages/space_tree/view/space_tree_view.dart';
|
import 'package:syncrow_web/pages/space_tree/view/space_tree_view.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/community_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/community_model.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/product_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/all_spaces/model/product_model.dart';
|
||||||
@ -87,6 +88,7 @@ class _LoadedSpaceViewState extends State<LoadedSpaceView> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: BlocProvider(
|
child: BlocProvider(
|
||||||
create: (context) => SpaceModelBloc(
|
create: (context) => SpaceModelBloc(
|
||||||
|
BlocProvider.of<SpaceTreeBloc>(context),
|
||||||
api: SpaceModelManagementApi(),
|
api: SpaceModelManagementApi(),
|
||||||
initialSpaceModels: _spaceModels,
|
initialSpaceModels: _spaceModels,
|
||||||
),
|
),
|
||||||
|
@ -205,30 +205,32 @@ class _SidebarWidgetState extends State<SidebarWidget> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildSpaceTile(SpaceModel space, CommunityModel community) {
|
Widget _buildSpaceTile(SpaceModel space, CommunityModel community, {int depth = 1}) {
|
||||||
bool isExpandedSpace = _isSpaceOrChildSelected(space);
|
bool isExpandedSpace = _isSpaceOrChildSelected(space);
|
||||||
return SpaceTile(
|
return Padding(
|
||||||
title: space.name,
|
padding: EdgeInsets.only(left: depth * 16.0),
|
||||||
key: ValueKey(space.uuid),
|
child: SpaceTile(
|
||||||
isSelected: _selectedId == space.uuid,
|
title: space.name,
|
||||||
initiallyExpanded: isExpandedSpace,
|
key: ValueKey(space.uuid),
|
||||||
onExpansionChanged: (bool expanded) {
|
isSelected: _selectedId == space.uuid,
|
||||||
_handleExpansionChange(space.uuid ?? '', expanded);
|
initiallyExpanded: isExpandedSpace,
|
||||||
},
|
onExpansionChanged: (bool expanded) {
|
||||||
onItemSelected: () {
|
_handleExpansionChange(space.uuid ?? '', expanded);
|
||||||
setState(() {
|
},
|
||||||
_selectedId = space.uuid;
|
onItemSelected: () {
|
||||||
_selectedSpaceUuid = space.uuid;
|
setState(() {
|
||||||
});
|
_selectedId = space.uuid;
|
||||||
|
_selectedSpaceUuid = space.uuid;
|
||||||
|
});
|
||||||
|
|
||||||
context.read<SpaceManagementBloc>().add(
|
context.read<SpaceManagementBloc>().add(
|
||||||
SelectSpaceEvent(selectedCommunity: community, selectedSpace: space),
|
SelectSpaceEvent(selectedCommunity: community, selectedSpace: space),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
children: space.children.isNotEmpty
|
children: space.children.isNotEmpty
|
||||||
? space.children.map((childSpace) => _buildSpaceTile(childSpace, community)).toList()
|
? space.children.map((childSpace) => _buildSpaceTile(childSpace, community)).toList()
|
||||||
: [], // Recursively render child spaces if available
|
: [], // Recursively render child spaces if available
|
||||||
);
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
void _handleExpansionChange(String uuid, bool expanded) {}
|
void _handleExpansionChange(String uuid, bool expanded) {}
|
||||||
|
@ -35,18 +35,20 @@ class _SpaceTileState extends State<SpaceTile> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return CustomExpansionTile(
|
return Padding(
|
||||||
isSelected: widget.isSelected,
|
padding: const EdgeInsets.only(left: 8.0, right: 8.0, top: 8.0),
|
||||||
title: widget.title,
|
child: CustomExpansionTile(
|
||||||
initiallyExpanded: _isExpanded,
|
isSelected: widget.isSelected,
|
||||||
onItemSelected: widget.onItemSelected,
|
title: widget.title,
|
||||||
onExpansionChanged: (bool expanded) {
|
initiallyExpanded: _isExpanded,
|
||||||
setState(() {
|
onItemSelected: widget.onItemSelected,
|
||||||
_isExpanded = expanded;
|
onExpansionChanged: (bool expanded) {
|
||||||
});
|
setState(() {
|
||||||
widget.onExpansionChanged(expanded);
|
_isExpanded = expanded;
|
||||||
},
|
});
|
||||||
children: widget.children ?? [],
|
widget.onExpansionChanged(expanded);
|
||||||
);
|
},
|
||||||
|
children: widget.children ?? [],
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,6 @@ 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;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:syncrow_web/pages/common/bloc/project_manager.dart';
|
import 'package:syncrow_web/pages/common/bloc/project_manager.dart';
|
||||||
|
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_bloc.dart';
|
||||||
|
import 'package:syncrow_web/pages/space_tree/bloc/space_tree_event.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/space_model/bloc/space_model_event.dart';
|
import 'package:syncrow_web/pages/spaces_management/space_model/bloc/space_model_event.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/space_model/bloc/space_model_state.dart';
|
import 'package:syncrow_web/pages/spaces_management/space_model/bloc/space_model_state.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/space_model/models/space_template_model.dart';
|
import 'package:syncrow_web/pages/spaces_management/space_model/models/space_template_model.dart';
|
||||||
@ -9,8 +9,10 @@ import 'package:syncrow_web/services/space_model_mang_api.dart';
|
|||||||
|
|
||||||
class SpaceModelBloc extends Bloc<SpaceModelEvent, SpaceModelState> {
|
class SpaceModelBloc extends Bloc<SpaceModelEvent, SpaceModelState> {
|
||||||
final SpaceModelManagementApi api;
|
final SpaceModelManagementApi api;
|
||||||
|
final SpaceTreeBloc _spaceTreeBloc;
|
||||||
|
|
||||||
SpaceModelBloc({
|
SpaceModelBloc(
|
||||||
|
this._spaceTreeBloc, {
|
||||||
required this.api,
|
required this.api,
|
||||||
required List<SpaceTemplateModel> initialSpaceModels,
|
required List<SpaceTemplateModel> initialSpaceModels,
|
||||||
}) : super(SpaceModelLoaded(spaceModels: initialSpaceModels)) {
|
}) : super(SpaceModelLoaded(spaceModels: initialSpaceModels)) {
|
||||||
@ -50,6 +52,7 @@ class SpaceModelBloc extends Bloc<SpaceModelEvent, SpaceModelState> {
|
|||||||
final updatedSpaceModels = currentState.spaceModels.map((model) {
|
final updatedSpaceModels = currentState.spaceModels.map((model) {
|
||||||
return model.uuid == event.spaceModelUuid ? newSpaceModel : model;
|
return model.uuid == event.spaceModelUuid ? newSpaceModel : model;
|
||||||
}).toList();
|
}).toList();
|
||||||
|
_spaceTreeBloc.add(InitialEvent());
|
||||||
emit(SpaceModelLoaded(spaceModels: updatedSpaceModels));
|
emit(SpaceModelLoaded(spaceModels: updatedSpaceModels));
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@ -71,7 +74,7 @@ class SpaceModelBloc extends Bloc<SpaceModelEvent, SpaceModelState> {
|
|||||||
final updatedSpaceModels = currentState.spaceModels
|
final updatedSpaceModels = currentState.spaceModels
|
||||||
.where((model) => model.uuid != event.spaceModelUuid)
|
.where((model) => model.uuid != event.spaceModelUuid)
|
||||||
.toList();
|
.toList();
|
||||||
|
_spaceTreeBloc.add(InitialEvent());
|
||||||
emit(SpaceModelLoaded(spaceModels: updatedSpaceModels));
|
emit(SpaceModelLoaded(spaceModels: updatedSpaceModels));
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -11,7 +11,7 @@ class SpaceTemplateModel extends Equatable {
|
|||||||
List<SubspaceTemplateModel>? subspaceModels;
|
List<SubspaceTemplateModel>? subspaceModels;
|
||||||
final List<Tag>? tags;
|
final List<Tag>? tags;
|
||||||
String internalId;
|
String internalId;
|
||||||
DateTime? createdAt;
|
String? createdAt;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Object?> get props => [modelName, subspaceModels, tags];
|
List<Object?> get props => [modelName, subspaceModels, tags];
|
||||||
@ -24,18 +24,17 @@ class SpaceTemplateModel extends Equatable {
|
|||||||
this.tags,
|
this.tags,
|
||||||
this.createdAt,
|
this.createdAt,
|
||||||
}) : internalId = internalId ?? const Uuid().v4();
|
}) : internalId = internalId ?? const Uuid().v4();
|
||||||
|
|
||||||
factory SpaceTemplateModel.fromJson(Map<String, dynamic> json) {
|
factory SpaceTemplateModel.fromJson(Map<String, dynamic> json) {
|
||||||
final String internalId = json['internalId'] ?? const Uuid().v4();
|
final String internalId = json['internalId'] ?? const Uuid().v4();
|
||||||
|
|
||||||
return SpaceTemplateModel(
|
return SpaceTemplateModel(
|
||||||
uuid: json['uuid'] ?? '',
|
uuid: json['uuid'] ?? '',
|
||||||
createdAt: json['createdAt'] != null
|
createdAt: json['createdAt'] ?? '',
|
||||||
? DateTime.tryParse(json['createdAt'])
|
|
||||||
: null,
|
|
||||||
internalId: internalId,
|
internalId: internalId,
|
||||||
modelName: json['modelName'] ?? '',
|
modelName: json['modelName'] ?? '',
|
||||||
subspaceModels: (json['subspaceModels'] as List<dynamic>?)
|
subspaceModels: (json['subspaceModels'] as List<dynamic>?)
|
||||||
?.where((e) => e is Map<String, dynamic>)
|
?.where((e) => e is Map<String, dynamic>) // Validate type
|
||||||
.map((e) =>
|
.map((e) =>
|
||||||
SubspaceTemplateModel.fromJson(e as Map<String, dynamic>))
|
SubspaceTemplateModel.fromJson(e as Map<String, dynamic>))
|
||||||
.toList() ??
|
.toList() ??
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:intl/intl.dart';
|
|
||||||
import 'package:syncrow_web/pages/space_tree/view/space_tree_view.dart';
|
import 'package:syncrow_web/pages/space_tree/view/space_tree_view.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/link_space_model/bloc/link_space_to_model_bloc.dart';
|
import 'package:syncrow_web/pages/spaces_management/link_space_model/bloc/link_space_to_model_bloc.dart';
|
||||||
import 'package:syncrow_web/pages/spaces_management/link_space_model/bloc/link_space_to_model_event.dart';
|
import 'package:syncrow_web/pages/spaces_management/link_space_model/bloc/link_space_to_model_event.dart';
|
||||||
@ -46,12 +45,6 @@ class _LinkSpaceModelSpacesDialogState
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildDialogContent() {
|
Widget _buildDialogContent() {
|
||||||
widget.spaceModel.createdAt.toString();
|
|
||||||
String formattedDate =
|
|
||||||
DateFormat('yyyy-MM-dd').format(widget.spaceModel.createdAt!);
|
|
||||||
String formattedTime =
|
|
||||||
DateFormat('HH:mm:ss').format(widget.spaceModel.createdAt!);
|
|
||||||
|
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(15.0),
|
padding: const EdgeInsets.all(15.0),
|
||||||
@ -82,31 +75,8 @@ class _LinkSpaceModelSpacesDialogState
|
|||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
_buildDetailRow(
|
_buildDetailRow(
|
||||||
"Space model name:", widget.spaceModel.modelName),
|
"Space model name:", widget.spaceModel.modelName),
|
||||||
Padding(
|
_buildDetailRow("Creation date and time:",
|
||||||
padding: const EdgeInsets.symmetric(vertical: 4),
|
widget.spaceModel.createdAt.toString()),
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
const Expanded(
|
|
||||||
child: Text(
|
|
||||||
"Creation date and time:",
|
|
||||||
style: const TextStyle(
|
|
||||||
fontWeight: FontWeight.bold),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
Expanded(
|
|
||||||
child: Text(
|
|
||||||
"$formattedDate $formattedTime",
|
|
||||||
style: const TextStyle(
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
color: Colors.black),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
// _buildDetailRow("Creation date and time:",
|
|
||||||
// widget.spaceModel.createdAt.toString()),
|
|
||||||
_buildDetailRow("Created by:", "Admin"),
|
_buildDetailRow("Created by:", "Admin"),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
const Text(
|
const Text(
|
||||||
|
@ -85,116 +85,111 @@ class SpaceModelCardWidget extends StatelessWidget {
|
|||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
if (!topActionsDisabled)
|
Row(
|
||||||
Row(
|
children: [
|
||||||
children: [
|
InkWell(
|
||||||
InkWell(
|
onTap: () {
|
||||||
onTap: () {
|
showDialog(
|
||||||
showDialog(
|
context: context,
|
||||||
context: context,
|
builder: (BuildContext dialogContext) {
|
||||||
builder: (BuildContext dialogContext) {
|
return BlocProvider<LinkSpaceToModelBloc>(
|
||||||
return BlocProvider<LinkSpaceToModelBloc>(
|
create: (_) => LinkSpaceToModelBloc(),
|
||||||
create: (_) => LinkSpaceToModelBloc(),
|
child: BlocListener<LinkSpaceToModelBloc,
|
||||||
child: BlocListener<LinkSpaceToModelBloc,
|
LinkSpaceToModelState>(
|
||||||
LinkSpaceToModelState>(
|
listener: (context, state) {
|
||||||
listenWhen: (previous, current) {
|
final _bloc =
|
||||||
return previous != current;
|
BlocProvider.of<LinkSpaceToModelBloc>(
|
||||||
},
|
context);
|
||||||
listener: (context, state) {
|
if (state is SpaceModelLoading) {
|
||||||
final _bloc =
|
showDialog(
|
||||||
BlocProvider.of<LinkSpaceToModelBloc>(
|
context: context,
|
||||||
context);
|
barrierDismissible: false,
|
||||||
if (state is SpaceModelLoading) {
|
builder: (BuildContext context) {
|
||||||
showDialog(
|
return Dialog(
|
||||||
context: context,
|
shape: RoundedRectangleBorder(
|
||||||
barrierDismissible: false,
|
borderRadius:
|
||||||
builder: (BuildContext context) {
|
BorderRadius.circular(20)),
|
||||||
return Dialog(
|
elevation: 10,
|
||||||
shape: RoundedRectangleBorder(
|
backgroundColor: Colors.white,
|
||||||
borderRadius:
|
child: Padding(
|
||||||
BorderRadius.circular(
|
padding:
|
||||||
20)),
|
const EdgeInsets.symmetric(
|
||||||
elevation: 10,
|
vertical: 30,
|
||||||
backgroundColor: Colors.white,
|
horizontal: 50),
|
||||||
child: Padding(
|
child: Column(
|
||||||
padding:
|
mainAxisSize: MainAxisSize.min,
|
||||||
const EdgeInsets.symmetric(
|
children: [
|
||||||
vertical: 30,
|
CustomLoadingIndicator(),
|
||||||
horizontal: 50),
|
const SizedBox(height: 20),
|
||||||
child: Column(
|
const Text(
|
||||||
mainAxisSize:
|
"Linking in progress",
|
||||||
MainAxisSize.min,
|
style: TextStyle(
|
||||||
children: [
|
fontSize: 16,
|
||||||
CustomLoadingIndicator(),
|
fontWeight:
|
||||||
],
|
FontWeight.w500,
|
||||||
),
|
color: Colors.black87,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
},
|
);
|
||||||
);
|
},
|
||||||
} else if (state
|
);
|
||||||
is AlreadyHaveLinkedState) {
|
} else if (state
|
||||||
Navigator.of(dialogContext).pop();
|
is AlreadyHaveLinkedState) {
|
||||||
showOverwriteDialog(
|
Navigator.of(dialogContext).pop();
|
||||||
context, _bloc, model);
|
showOverwriteDialog(
|
||||||
} else if (state
|
context, _bloc, model);
|
||||||
is SpaceValidationSuccess) {
|
} else if (state
|
||||||
_bloc.add(LinkSpaceModelEvent(
|
is SpaceValidationSuccess) {
|
||||||
isOverWrite: false,
|
_bloc.add(LinkSpaceModelEvent(
|
||||||
selectedSpaceMode: model.uuid));
|
isOverWrite: false,
|
||||||
|
selectedSpaceMode: model.uuid));
|
||||||
|
|
||||||
|
Future.delayed(const Duration(seconds: 1),
|
||||||
|
() {
|
||||||
|
Navigator.of(dialogContext).pop();
|
||||||
|
Navigator.of(dialogContext).pop();
|
||||||
|
Navigator.of(dialogContext).pop();
|
||||||
|
});
|
||||||
|
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext dialogContext) {
|
||||||
|
return const LinkingSuccessful();
|
||||||
|
},
|
||||||
|
).then((v) {
|
||||||
Future.delayed(
|
Future.delayed(
|
||||||
const Duration(seconds: 1), () {
|
const Duration(seconds: 2), () {
|
||||||
Navigator.of(dialogContext).pop();
|
|
||||||
Navigator.of(dialogContext).pop();
|
|
||||||
Navigator.of(dialogContext).pop();
|
Navigator.of(dialogContext).pop();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
showDialog(
|
} else if (state is SpaceModelLinkSuccess) {
|
||||||
context: context,
|
Navigator.of(dialogContext).pop();
|
||||||
builder:
|
Navigator.of(dialogContext).pop();
|
||||||
(BuildContext dialogContext) {
|
showDialog(
|
||||||
return const LinkingSuccessful();
|
context: context,
|
||||||
},
|
builder: (BuildContext dialogContext) {
|
||||||
).then((v) {
|
return const LinkingSuccessful();
|
||||||
Future.delayed(
|
},
|
||||||
const Duration(seconds: 2), () {
|
);
|
||||||
Navigator.of(dialogContext).pop();
|
}
|
||||||
});
|
},
|
||||||
});
|
child: LinkSpaceModelSpacesDialog(
|
||||||
} else if (state
|
spaceModel: model,
|
||||||
is SpaceModelLinkSuccess) {
|
|
||||||
Navigator.of(dialogContext).pop();
|
|
||||||
Navigator.of(dialogContext).pop();
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
barrierDismissible: false,
|
|
||||||
builder: (BuildContext
|
|
||||||
successDialogContext) {
|
|
||||||
Future.delayed(
|
|
||||||
const Duration(seconds: 2), () {
|
|
||||||
Navigator.of(successDialogContext)
|
|
||||||
.pop();
|
|
||||||
});
|
|
||||||
|
|
||||||
return const LinkingSuccessful();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: LinkSpaceModelSpacesDialog(
|
|
||||||
spaceModel: model,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
),
|
||||||
},
|
);
|
||||||
);
|
},
|
||||||
},
|
);
|
||||||
child: SvgPicture.asset(
|
},
|
||||||
Assets.spaceLinkIcon,
|
child: SvgPicture.asset(
|
||||||
fit: BoxFit.contain,
|
Assets.spaceLinkIcon,
|
||||||
),
|
fit: BoxFit.contain,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
if (!topActionsDisabled)
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
_showDeleteDialog(context);
|
_showDeleteDialog(context);
|
||||||
@ -204,8 +199,49 @@ class SpaceModelCardWidget extends StatelessWidget {
|
|||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
// Expanded(
|
||||||
|
// child: Text(
|
||||||
|
// model.modelName,
|
||||||
|
// style:
|
||||||
|
// Theme.of(context).textTheme.headlineMedium?.copyWith(
|
||||||
|
// color: Colors.black,
|
||||||
|
// fontWeight: FontWeight.bold,
|
||||||
|
// ),
|
||||||
|
// maxLines: 1,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// if (!topActionsDisabled)
|
||||||
|
// GestureDetector(
|
||||||
|
// onTap: () => _showDeleteDialog(context),
|
||||||
|
// child: Container(
|
||||||
|
// width: 36, // Adjust size as needed
|
||||||
|
// height: 36,
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// shape: BoxShape.circle,
|
||||||
|
// color: Colors.white,
|
||||||
|
// boxShadow: [
|
||||||
|
// BoxShadow(
|
||||||
|
// color: Colors.black.withOpacity(0.1),
|
||||||
|
// spreadRadius: 2,
|
||||||
|
// blurRadius: 5,
|
||||||
|
// offset: const Offset(0, 2),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// child: Center(
|
||||||
|
// child: SvgPicture.asset(
|
||||||
|
// Assets.deleteSpaceModel, // Your actual SVG path
|
||||||
|
// width: 20,
|
||||||
|
// height: 20,
|
||||||
|
// colorFilter: const ColorFilter.mode(
|
||||||
|
// Colors.grey, BlendMode.srcIn),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (!showOnlyName) ...[
|
if (!showOnlyName) ...[
|
||||||
|
@ -52,7 +52,7 @@ abstract class ColorsManager {
|
|||||||
static const Color semiTransparentBlackColor = Color(0x3F000000);
|
static const Color semiTransparentBlackColor = Color(0x3F000000);
|
||||||
static const Color transparentColor = Color(0x00000000);
|
static const Color transparentColor = Color(0x00000000);
|
||||||
static const Color spaceColor = Color(0xB2023DFE);
|
static const Color spaceColor = Color(0xB2023DFE);
|
||||||
static const Color counterBackgroundColor = Color.fromARGB(204, 105, 2, 2);
|
static const Color counterBackgroundColor = Color(0xCCF4F4F4);
|
||||||
static const Color neutralGray = Color(0xFFE5E5E5);
|
static const Color neutralGray = Color(0xFFE5E5E5);
|
||||||
static const Color warningRed = Color(0xFFFF6465);
|
static const Color warningRed = Color(0xFFFF6465);
|
||||||
static const Color borderColor = Color(0xFFE5E5E5);
|
static const Color borderColor = Color(0xFFE5E5E5);
|
||||||
|
Reference in New Issue
Block a user