Skip to content

Commit

Permalink
feat!: streamline modifier API by overloading modifier methods (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
blaugold committed Jun 17, 2023
1 parent a4aa443 commit 42a676f
Show file tree
Hide file tree
Showing 7 changed files with 242 additions and 167 deletions.
2 changes: 2 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@ linter:
prefer_final_parameters: false

diagnostic_describe_all_properties: false

parameter_assignments: false
2 changes: 1 addition & 1 deletion packages/fleet/example/lib/hike_graph.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class _PageState extends State<Page> {
HikeGraph(hike: hike, observation: _observation) //
.size(width: 400, height: 200)
]) //
.center(),
.centered(),
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/fleet/example/lib/interactive_box_fleet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ class _PageState extends State<Page> with AnimatingStateMixin {
});
},
child: const Text('Drag me!', style: TextStyle(color: Colors.white))
.center()
.centered()
.boxColor(_color)
.squareDimension(400)
.alignmentFrom(_alignment),
.size(square: 400)
.alignment(alignment: _alignment),
),
);
}
Expand Down
6 changes: 3 additions & 3 deletions packages/fleet/example/lib/simple_declarative_animation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ class _PageState extends State<Page> {
.uniformPadding(Edges.all, _expanded ? null : 32)
.animation(Curves.easeInOutCubic.animation(1.s))
.boxColor(Colors.orange)
.center()
.centered()
.boxColor(_expanded ? Colors.green : Colors.blue)
.squareDimension(_expanded ? 400 : 200)
.size(square: _expanded ? 400 : 200)
.animation(Curves.ease.animation(1.s))
.center(),
.centered(),
);
}
}
6 changes: 3 additions & 3 deletions packages/fleet/example/lib/simple_imperative_animation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ class _PageState extends State<Page> with AnimatingStateMixin {
child: const Text('Expanded'),
),
]) //
.center()
.centered()
.boxColor(_color)
.sizeFrom(_size)
.center(),
.size(size: _size)
.centered(),
);
}
}
6 changes: 3 additions & 3 deletions packages/fleet/example/lib/stack.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ class StackElement extends StatelessWidget {
color: _buildColor(),
borderRadius: BorderRadius.circular(size / 20),
)
.squareDimension(size)
.center()
.squareDimension(_stackSize)
.size(square: size)
.centered()
.size(square: _stackSize)
.alignment(x: left ? -.5 : .5)
.animation(_buildAnimation(), value: left);
}
Expand Down
Loading

0 comments on commit 42a676f

Please sign in to comment.