Skip to content

Commit c7cc04a

Browse files
committed
optimize code
1 parent ee35295 commit c7cc04a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/src/constraint_layout.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -921,8 +921,8 @@ class ConstraintDefine {
921921
class Constraint extends ConstraintDefine {
922922
/// 'wrap_content'、'match_parent'、'match_constraint'、'48, etc'
923923
/// 'match_parent' will be converted to the base constraints
924-
double width;
925-
double height;
924+
final double width;
925+
final double height;
926926

927927
/// When size is non-null, both width and height are set to size
928928
final double? size;
@@ -934,8 +934,8 @@ class Constraint extends ConstraintDefine {
934934

935935
/// Both margin and goneMargin can be negative
936936
final bool percentageMargin;
937-
EdgeInsets margin;
938-
EdgeInsets goneMargin;
937+
final EdgeInsets margin;
938+
final EdgeInsets goneMargin;
939939

940940
/// These are the base constraints constraint on sibling id or parent
941941
/// The essence of constraints is alignment
@@ -1317,6 +1317,8 @@ class Constraint extends ConstraintDefine {
13171317
_Align? bottom = this.bottom;
13181318
_Align? baseline = this.baseline;
13191319

1320+
double width = this.width;
1321+
double height = this.height;
13201322
if (size != null) {
13211323
width = size!;
13221324
height = size!;

0 commit comments

Comments
 (0)