Skip to content

Commit

Permalink
refactor!: use Fleet as the prefix for Flutter drop-in replacements (
Browse files Browse the repository at this point in the history
  • Loading branch information
blaugold committed May 29, 2023
1 parent 12daa15 commit fe20ceb
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 111 deletions.
22 changes: 11 additions & 11 deletions packages/fleet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ extensions on `int`, e.g `250.ms` is equivalent to
The following drop-in replacements for Flutter framework widgets are provided
for animating with Fleet:

- AAlign
- AColoredBox
- AContainer
- AOpacity
- APadding
- APositioned
- APositionedDirectional
- ASizedBox
- ASliverOpacity
- ASliverPadding
- ATransform
- FleetAlign
- FleetColoredBox
- FleetContainer
- FleetOpacity
- FleetPadding
- FleetPositioned
- FleetPositionedDirectional
- FleetSizedBox
- FleetSliverOpacity
- FleetSliverPadding
- FleetTransform

The following provided widgets are specific to Fleet:

Expand Down
6 changes: 3 additions & 3 deletions packages/fleet/dartdoc_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ dartdoc:
categories:
'Animation':
markdown: doc/Animation.md
'Animatable Flutter widget':
markdown: doc/Animatable_Flutter_widget.md
'Flutter drop-in replacement':
markdown: doc/Flutter_drop-in_replacement.md
categoryOrder:
- 'Animation'
- 'Animatable Flutter widget'
- 'Flutter drop-in replacement'
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 @@ -130,7 +130,7 @@ class GraphCapsule extends StatelessWidget {
@override
Widget build(BuildContext context) {
final relativeRange = range.relativeTo(overallRange);
return AContainer(
return FleetContainer(
height: height * relativeRange.magnitude,
width: 24,
decoration: ShapeDecoration(
Expand Down
22 changes: 11 additions & 11 deletions packages/fleet/lib/fleet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ export 'src/common.dart' show Block;
export 'src/environment.dart' show EnvironmentKey, EnvironmentValueModifiers;
export 'src/widgets/basic_flutter_widgets.dart'
show
AAlign,
AColoredBox,
AContainer,
AOpacity,
APadding,
APositioned,
APositionedDirectional,
ASizedBox,
ASliverOpacity,
ASliverPadding,
ATransform;
FleetAlign,
FleetColoredBox,
FleetContainer,
FleetOpacity,
FleetPadding,
FleetPositioned,
FleetPositionedDirectional,
FleetSizedBox,
FleetSliverOpacity,
FleetSliverPadding,
FleetTransform;
export 'src/widgets/uniform_padding.dart'
show Edge, Edges, UniformPadding, defaultUniformPadding;
26 changes: 13 additions & 13 deletions packages/fleet/lib/modifiers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extension BasicModifiers on Widget {
double? widthFactor,
double? heightFactor,
}) {
return AAlign(
return FleetAlign(
alignment: alignment,
widthFactor: widthFactor,
heightFactor: heightFactor,
Expand All @@ -50,7 +50,7 @@ extension BasicModifiers on Widget {
double? widthFactor,
double? heightFactor,
}) {
return AAlign(
return FleetAlign(
widthFactor: widthFactor,
heightFactor: heightFactor,
child: this,
Expand All @@ -60,7 +60,7 @@ extension BasicModifiers on Widget {
/// Sizes this widget to the given [width] and [height].
@widgetFactory
Widget size({double? width, double? height}) {
return ASizedBox(
return FleetSizedBox(
width: width,
height: height,
child: this,
Expand All @@ -70,7 +70,7 @@ extension BasicModifiers on Widget {
/// Sizes this widget to the given [Size].
@widgetFactory
Widget sizeWith(Size size) {
return ASizedBox.fromSize(
return FleetSizedBox.fromSize(
size: size,
child: this,
);
Expand All @@ -79,7 +79,7 @@ extension BasicModifiers on Widget {
/// Sizes this widget to a square with the given [dimension].
@widgetFactory
Widget square(double dimension) {
return ASizedBox.square(
return FleetSizedBox.square(
dimension: dimension,
child: this,
);
Expand All @@ -88,7 +88,7 @@ extension BasicModifiers on Widget {
/// Adds [padding] around this widget.
@widgetFactory
Widget padding(EdgeInsetsGeometry padding) {
return APadding(
return FleetPadding(
padding: padding,
child: this,
);
Expand All @@ -97,7 +97,7 @@ extension BasicModifiers on Widget {
/// Applies opacity to this widget.
@widgetFactory
Widget opacity(double opacity, {bool alwaysIncludeSemantics = false}) {
return AOpacity(
return FleetOpacity(
opacity: opacity,
alwaysIncludeSemantics: alwaysIncludeSemantics,
child: this,
Expand All @@ -107,7 +107,7 @@ extension BasicModifiers on Widget {
/// Paints the area of this widget.
@widgetFactory
Widget boxColor(Color color) {
return AColoredBox(
return FleetColoredBox(
color: color,
child: this,
);
Expand All @@ -122,7 +122,7 @@ extension BasicModifiers on Widget {
bool transformHitTests = true,
FilterQuality? filterQuality,
}) {
return ATransform(
return FleetTransform(
transform: transform,
origin: origin,
alignment: alignment,
Expand All @@ -141,7 +141,7 @@ extension BasicModifiers on Widget {
bool transformHitTests = true,
FilterQuality? filterQuality,
}) {
return ATransform.rotate(
return FleetTransform.rotate(
angle: angle,
origin: origin,
alignment: alignment,
Expand All @@ -158,7 +158,7 @@ extension BasicModifiers on Widget {
bool transformHitTests = true,
FilterQuality? filterQuality,
}) {
return ATransform.translate(
return FleetTransform.translate(
offset: offset,
transformHitTests: transformHitTests,
filterQuality: filterQuality,
Expand All @@ -175,7 +175,7 @@ extension BasicModifiers on Widget {
bool transformHitTests = true,
FilterQuality? filterQuality,
}) {
return ATransform.scale(
return FleetTransform.scale(
scale: scale,
origin: origin,
alignment: alignment,
Expand All @@ -195,7 +195,7 @@ extension BasicModifiers on Widget {
bool transformHitTests = true,
FilterQuality? filterQuality,
}) {
return ATransform.scale(
return FleetTransform.scale(
scaleX: x,
scaleY: y,
origin: origin,
Expand Down
28 changes: 14 additions & 14 deletions packages/fleet/lib/src/animation/animate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import 'transaction.dart';
/// child: ValueListenableBuilder<bool>(
/// valueListenable: active,
/// builder: (context, active, _) {
/// return AColoredBox(color: active ? Colors.blue : Colors.grey);
/// return FleetColoredBox(color: active ? Colors.blue : Colors.grey);
/// },
/// ),
/// );
Expand Down Expand Up @@ -117,7 +117,7 @@ mixin AnimatingStateMixin<T extends StatefulWidget> on State<T> {
/// _active = !_active;
/// });
/// },
/// child: AColoredBox(color: _active ? Colors.blue : Colors.grey),
/// child: FleetColoredBox(color: _active ? Colors.blue : Colors.grey),
/// );
/// }
/// }
Expand Down Expand Up @@ -149,17 +149,17 @@ mixin AnimatingStateMixin<T extends StatefulWidget> on State<T> {
///
/// The following provided widgets support animating with Fleet:
///
/// - [AAlign]
/// - [AColoredBox]
/// - [AContainer]
/// - [AOpacity]
/// - [APadding]
/// - [APositioned]
/// - [APositionedDirectional]
/// - [ASizedBox]
/// - [ASliverOpacity]
/// - [ASliverPadding]
/// - [ATransform]
/// - [FleetAlign]
/// - [FleetColoredBox]
/// - [FleetContainer]
/// - [FleetOpacity]
/// - [FleetPadding]
/// - [FleetPositioned]
/// - [FleetPositionedDirectional]
/// - [FleetSizedBox]
/// - [FleetSliverOpacity]
/// - [FleetSliverPadding]
/// - [FleetTransform]
///
/// The following provided widgets are specific to Fleet:
///
Expand Down Expand Up @@ -200,7 +200,7 @@ mixin AnimatingStateMixin<T extends StatefulWidget> on State<T> {
/// child: Animated(
/// animation: Curves.ease.animation(250.ms),
/// value: _active,
/// child: AColoredBox(color: _active ? Colors.blue : Colors.grey),
/// child: FleetColoredBox(color: _active ? Colors.blue : Colors.grey),
/// ),
/// );
/// }
Expand Down

0 comments on commit fe20ceb

Please sign in to comment.