Skip to content

Commit c80d4ee

Browse files
committed
rename <animation> to <apply-animation>
1 parent 6f1b3d1 commit c80d4ee

7 files changed

Lines changed: 24 additions & 19 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2+
## [0.0.27] - 2020-10-4
3+
Breaking changes:
4+
- rename the custom property `<animation>` to `<apply-animation>`.
5+
16
## [0.0.25] - 2020-06-18
27
- Add item data type for builder, itemBuilder, childBuilder and repeat.
38

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ dependencies:
7171
flutter_localizations:
7272
sdk: flutter
7373
provider: ^3.0.0+1
74-
flutter_xmllayout_helpers: ^0.0.7
74+
flutter_xmllayout_helpers: ^0.0.8
7575
```
7676
4. Apply one of the following steps:
7777
* Clear all `main.dart` content then use `fxml_app` snippet to create the app.

docs/custom-properties.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,8 @@ Then add the controls in the controller class:
533533
```
534534

535535
### 10. animation
536-
`animation` can be applied on any widget easily, it uses a modified version of the [animator](https://github.com/GIfatahTH/animator) but without the usage of the [states_rebuilder](https://pub.dev/packages/states_rebuilder).
537-
`animation` has these properties:
536+
`apply-animation` can be applied on any widget easily, it uses a modified version of the [animator](https://github.com/GIfatahTH/animator) but without the usage of the [states_rebuilder](https://pub.dev/packages/states_rebuilder).
537+
`apply-animation` has these properties:
538538
- `curve`: animation curve.
539539
- `duration`: the duration of the animation.
540540
- `autoTrigger`: to determine whether to start the animation at the begining or not.
@@ -544,9 +544,9 @@ Then add the controls in the controller class:
544544
Example:
545545
```XML
546546
<Transform :use="translate">
547-
<animation curve="easeOut" duration="milliseconds: 300" autoTrigger>
547+
<apply-animation curve="easeOut" duration="milliseconds: 300" autoTrigger>
548548
<offset type="Offset" begin="Offset(0, 0)" end="Offset(50, 200)" />
549-
</animation>
549+
</apply-animation>
550550
<Container color="red" width="200" height="200" />
551551
</Transform>
552552
```
@@ -572,14 +572,14 @@ AnimationBuilder(
572572
);
573573
```
574574

575-
`animation` can be applied on multiple properties as well:
575+
`apply-animation` can be applied on multiple properties as well:
576576
```XML
577577
<Container>
578-
<animation duration="milliseconds: 1000" autoTrigger cycles="5">
578+
<apply-animation duration="milliseconds: 1000" autoTrigger cycles="5">
579579
<color type="color" begin="Colors.blue" end="Colors.red" />
580580
<width type="double" begin="100" end="200" />
581581
<height type="double" begin="100" end="300" />
582-
</animation>
582+
</apply-animation>
583583
</Container>
584584
```
585585
Result:
@@ -606,9 +606,9 @@ AnimationBuilder(
606606
You also can access the `AnimationBuilderState` to trigger the animation manually by specifying the `name` property:
607607
```XML
608608
<Container>
609-
<animation name="myAnimation" duration="milliseconds: 1000" cycles="5">
609+
<apply-animation name="myAnimation" duration="milliseconds: 1000" cycles="5">
610610
<color type="color" begin="Colors.transparent" end="Colors.red" />
611-
</animation>
611+
</apply-animation>
612612
</Container>
613613
```
614614
Then access the variable in the controller class:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "XML Layout for Flutter",
44
"description": "XML Layout for Flutter. Brings Angular's style to Flutter!",
55
"publisher": "WaseemDev",
6-
"version": "0.0.26",
6+
"version": "0.0.27",
77
"icon": "images/logo.png",
88
"repository": {
99
"type": "github",

src/builtin-handlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function registerBuiltInPropertyHandlers(provider: PropertyHandlerProvide
7474
provider.register(':consumer', new WrapperConsumerPropertyHandler(propertyResolver));
7575
provider.register(':stream', new WrapperStreamPropertyHandler(propertyResolver));
7676
provider.register(':disable', new WrapperDisablePropertyHandler(propertyResolver));
77-
provider.register('animation', new WrapperAnimationHandler(propertyResolver));
77+
provider.register('apply-animation', new WrapperAnimationHandler(propertyResolver));
7878

7979
//
8080
// wrapper events

src/property-handlers/wrapper-animation.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ suite("Wrapper Animation Property Tests", function () {
55
test("test 1", function() {
66
const xml = `
77
<Transform :use="translate">
8-
<animation curve="easeOut" duration="milliseconds: 300" autoTrigger>
8+
<apply-animation curve="easeOut" duration="milliseconds: 300" autoTrigger>
99
<offset type="Offset" begin="Offset(-10, 0)" end="Offset(0, 0)" />
10-
</animation>
10+
</apply-animation>
1111
<Container color="red" width="200" height="200" />
1212
</Transform>
1313
`;
@@ -40,11 +40,11 @@ suite("Wrapper Animation Property Tests", function () {
4040
test("test 2", function() {
4141
const xml = `
4242
<Container>
43-
<animation duration="milliseconds: 1000" autoTrigger cycles="5">
43+
<apply-animation duration="milliseconds: 1000" autoTrigger cycles="5">
4444
<color type="color" begin="Colors.transparent" end="Colors.white" />
4545
<width type="int" begin="100" end="200" />
4646
<height type="int" begin="100" end="300" />
47-
</animation>
47+
</apply-animation>
4848
</Container>
4949
`;
5050

@@ -75,11 +75,11 @@ suite("Wrapper Animation Property Tests", function () {
7575
test("test 3", function() {
7676
const xml = `
7777
<Container>
78-
<animation name="myAnimation" duration="seconds: 1" >
78+
<apply-animation name="myAnimation" duration="seconds: 1" >
7979
<color type="color" begin="Colors.blue" end="Colors.red" />
8080
<width type="double" begin="100" end="200" />
8181
<height type="double" begin="100" end="300" />
82-
</animation>
82+
</apply-animation>
8383
</Container>
8484
`;
8585

src/property-handlers/wrapper-animation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class WrapperAnimationHandler extends WrapperPropertyHandler {
1515
];
1616

1717
constructor(propertyResolver: PropertyResolver) {
18-
super(propertyResolver, [{ handler: 'animation', targetProperty: 'animation' }], 'AnimationBuilder');
18+
super(propertyResolver, [{ handler: 'apply-animation', targetProperty: 'animation' }], 'AnimationBuilder');
1919
}
2020

2121
protected createWrapperWidget(widget: WidgetModel, targetProperty: string, value: string, onWrapped: ((wrapper: WidgetModel) => void)[]): { wrapperWidget: WidgetModel, propertyToUpdateAfterBinding: PropertyModel | null } {

0 commit comments

Comments
 (0)