Shared improved with rules

This commit is contained in:
mr 2024-11-19 16:16:53 +01:00
parent 06b13853db
commit d522a44029
2 changed files with 18 additions and 2 deletions

View File

@ -55,7 +55,7 @@ class CollaborativeArea extends SerializerDeserializer<CollaborativeArea> {
List<Workspace> workspaces = [];
List<Workflow> workflows = [];
List<Peer> peers = [];
List<Rule> rules = [];
List<dynamic> rules = [];
CollaborativeAreaRule? rule;
CollaborativeArea(
@ -85,7 +85,7 @@ class CollaborativeArea extends SerializerDeserializer<CollaborativeArea> {
workspaces: json.containsKey("shared_workspaces") ? fromListJson(json["shared_workspaces"], Workspace()) : [],
workflows: json.containsKey("shared_workflows") ? fromListJson(json["shared_workflows"], Workflow()) : [],
peers: json.containsKey("shared_peers") ? fromListJson(json["shared_peers"], Peer()) : [],
rules: json.containsKey("shared_rules") ? fromListJson(json["shared_rules"], Rule()) : [],
rules: json.containsKey("rules") ? json["rules"] : [],
);
}
@override

View File

@ -425,6 +425,7 @@ class WorkspaceSharedPageWidgetState extends State<WorkspaceSharedPageWidget> {
],
)
),
Row( children: [
Text("COLLABORATIVE AREA PEERS", textAlign: TextAlign.start,
style: TextStyle(color: darkColor, fontSize: 20, fontWeight: FontWeight.bold), overflow: TextOverflow.clip),
@ -466,6 +467,21 @@ class WorkspaceSharedPageWidgetState extends State<WorkspaceSharedPageWidget> {
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 50),
child: Wrap( alignment: WrapAlignment.center, children: getCardItems(space.peers)),
),
space.rules.isNotEmpty ? Text("RULES", textAlign: TextAlign.start,
style: TextStyle(color: darkColor, fontSize: 20, fontWeight: FontWeight.bold), overflow: TextOverflow.clip) : Container(),
space.rules.isNotEmpty ? Container(
width: getMainWidth(context) - 50,
margin: EdgeInsets.symmetric(vertical: 20),
color: Colors.white,
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 50),
child: Column( children: space.rules.map( (e) {
return Row( children: [
Padding( padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
child:Text("-", style: TextStyle(color: Colors.black, fontSize: 15, fontWeight: FontWeight.bold), overflow: TextOverflow.clip)),
Text(e ?? "", style: TextStyle(color: Colors.grey, fontSize: 15), overflow: TextOverflow.clip)
]);
}).toList() )
) : Container(),
Row( children: [
Text("WORKSPACES / RESOURCES", textAlign: TextAlign.start,
style: TextStyle(color: darkColor, fontSize: 20, fontWeight: FontWeight.bold), overflow: TextOverflow.clip),