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
1 change: 1 addition & 0 deletions lib/src/api/node_json_converter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class NodeJsonConverter implements JsonConverter<BaseNode?, Map> {
'progressBar': ProgressBarNode.fromJson,
'variance': VarianceNode.fromJson,
'listView': ListViewNode.fromJson,
'pageView': PageViewNode.fromJson,
};
}

Expand Down
73 changes: 43 additions & 30 deletions lib/src/api/nodes/accordion_node.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 37 additions & 24 deletions lib/src/api/nodes/app_bar_node.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 54 additions & 41 deletions lib/src/api/nodes/auto_placeholder_node.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions lib/src/api/nodes/base_node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,23 @@ abstract class BaseNode with SerializableMixin, EquatableMixin {
@JsonKey(includeFromJson: false, includeToJson: false)
bool get supportsPadding => false;

/// Width of the node in fraction of the parent's width. widthFactor of 0.5
/// means that the node will be half the width of the parent.
double? widthFactor;

/// Height of the node in fraction of the parent's height. heightFactor of 0.5
/// means that the node will be half the height of the parent.
double? heightFactor;

/// Whether the node is sized in fraction of the parent's size.
bool get isFractionallySized => widthFactor != null || heightFactor != null;

/// Whether the node's width is sized in fraction of the parent's width.
bool get isFractionallySizedHorizontally => widthFactor != null;

/// Whether the node's height is sized in fraction of the parent's height.
bool get isFractionallySizedVertically => heightFactor != null;

/// Default constructor of this class.
BaseNode({
required this.id,
Expand All @@ -398,6 +415,8 @@ abstract class BaseNode with SerializableMixin, EquatableMixin {
this.aspectRatioLock = false,
this.positioningMode = PositioningMode.align,
this.parentID = '',
this.widthFactor,
this.heightFactor,
}) : _basicBoxLocal = basicBoxLocal,
_rotationDegrees = rotationDegrees,
globalRotationDegrees = rotationDegrees,
Expand Down
66 changes: 40 additions & 26 deletions lib/src/api/nodes/button_node.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading