Skip to content

Commit 52fcbb1

Browse files
committed
Add convenience getter to RowColumnType.
1 parent b8233cf commit 52fcbb1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/src/api/mixins.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,12 @@ enum RowColumnType {
881881

882882
/// Whether this is a column.
883883
bool get isColumn => this == RowColumnType.column;
884+
885+
/// Returns the opposite of this [RowColumnType].
886+
RowColumnType get opposite => switch (this) {
887+
RowColumnType.row => RowColumnType.column,
888+
RowColumnType.column => RowColumnType.row,
889+
};
884890
}
885891

886892
/// A mixin that allows node to have sequential children layout like row and

0 commit comments

Comments
 (0)