Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/apptive_grid_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.1.6

- **FEAT**: Add plan to Space

## 2.1.5

- **FEAT**: use displayValue for Resource Type
Expand Down
16 changes: 13 additions & 3 deletions packages/apptive_grid_core/lib/src/model/space/space.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Space {
this.color,
this.icon,
this.iconSet,
this.plan,
});

/// Deserializes [json] into a [Space] Object
Expand All @@ -42,6 +43,7 @@ class Space {
: null,
icon: json['icon'],
iconSet: json['iconset'],
plan: json['plan'],
);
}
}
Expand Down Expand Up @@ -73,6 +75,9 @@ class Space {
/// IconSet that [icon] is from
final String? iconSet;

/// Plan of this space
final String? plan;

/// Serializes this [Space] into a json Map
Map<String, dynamic> toJson() {
final jsonMap = {
Expand All @@ -87,6 +92,7 @@ class Space {
'#${color!.red.toRadixString(16)}${color!.green.toRadixString(16)}${color!.blue.toRadixString(16)}',
if (icon != null) 'icon': icon,
if (iconSet != null) 'iconset': iconSet,
if (plan != null) 'plan': plan,
};

if (embeddedGrids != null) {
Expand All @@ -102,7 +108,7 @@ class Space {

@override
String toString() {
return 'Space(name: $name, id: $id, key: $key, category: $category, color: $color, icon: $icon, iconSet: $iconSet, links: $links, embeddedGrids: $embeddedGrids)';
return 'Space(name: $name, id: $id, key: $key, category: $category, color: $color, icon: $icon, iconSet: $iconSet, plan: $plan, links: $links, embeddedGrids: $embeddedGrids)';
}

@override
Expand All @@ -116,7 +122,8 @@ class Space {
f.listEquals(embeddedGrids, other.embeddedGrids) &&
color == other.color &&
iconSet == other.iconSet &&
icon == other.icon;
icon == other.icon &&
plan == other.plan;
}

@override
Expand All @@ -130,6 +137,7 @@ class Space {
color,
iconSet,
icon,
plan,
);
}

Expand All @@ -149,6 +157,7 @@ class SharedSpace extends Space {
super.color,
super.icon,
super.iconSet,
super.plan,
});

/// Deserializes [json] into a [Space] Object
Expand All @@ -170,6 +179,7 @@ class SharedSpace extends Space {
: null,
icon: json['icon'],
iconSet: json['iconset'],
plan: json['plan'],
);
}

Expand All @@ -186,7 +196,7 @@ class SharedSpace extends Space {

@override
String toString() {
return 'SharedSpace(name: $name, id: $id, key: $key, category: $category, realSpace: ${realSpace.toString()}, color: $color, icon: $icon, iconSet: $iconSet, links: $links, embeddedGrids: $embeddedGrids)';
return 'SharedSpace(name: $name, id: $id, key: $key, category: $category, realSpace: ${realSpace.toString()}, color: $color, icon: $icon, iconSet: $iconSet, plan: $plan, links: $links, embeddedGrids: $embeddedGrids)';
}

@override
Expand Down
2 changes: 1 addition & 1 deletion packages/apptive_grid_core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: apptive_grid_core
description: Core Library for ApptiveGrid used to provide general ApptiveGrid functionality to other Packages or Apps
version: 2.1.5
version: 2.1.6
homepage: https://www.apptivegrid.de
repository: https://github.com/ApptiveGrid/apptive_grid_flutter/tree/main/packages/apptive_grid_core

Expand Down
5 changes: 3 additions & 2 deletions packages/apptive_grid_core/test/space_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ void main() {
null,
null,
null,
null,
),
),
);
Expand All @@ -239,7 +240,7 @@ void main() {
expect(
space.toString(),
equals(
'Space(name: name, id: id, key: null, category: null, color: null, icon: null, iconSet: null, links: {}, embeddedGrids: null)',
'Space(name: name, id: id, key: null, category: null, color: null, icon: null, iconSet: null, plan: null, links: {}, embeddedGrids: null)',
),
);
});
Expand Down Expand Up @@ -428,7 +429,7 @@ void main() {
expect(
space.toString(),
equals(
'SharedSpace(name: name, id: id, key: null, category: null, realSpace: realSpace, color: null, icon: null, iconSet: null, links: {}, embeddedGrids: null)',
'SharedSpace(name: name, id: id, key: null, category: null, realSpace: realSpace, color: null, icon: null, iconSet: null, plan: null, links: {}, embeddedGrids: null)',
),
);
});
Expand Down