39 Commits

Author SHA1 Message Date
27a8fd61cb refactor: Enable DCM linting (#2667)
This is a first step towards enabling DCM for Flame. Though I have tested with all rules, and am working on selecting, assessing, and fixing violations, as a first step, we can merge the infrastructural changes to flame_lint to and GitHub actions.
As a proof of concept, I am enabling two rules for which we have no violations.
I will followup with enabling more rules, adding discussions for controversial changes, and fixing non-controversial violations.
2023-08-24 13:09:26 +02:00
b26700df7e chore(release): Publish Flame 1.8.2 (#2643)
- flame@1.8.2
 - flame_lint@1.1.0
 - flame_rive@1.9.1
 - flame_tiled@1.13.0
 - flame_isolate@0.4.0+2
 - flame_audio@2.0.5
 - flame_spine@0.1.1+1
 - flame_svg@1.8.1
 - flame_test@1.12.1
 - flame_oxygen@0.1.8+5
 - flame_bloc@1.10.1
 - flame_fire_atlas@1.3.8
 - flame_forge2d@0.14.1+1
 - flame_noise@0.1.1+4
 - flame_network_assets@0.2.0+4
 - flame_lottie@0.2.1+1
2023-08-08 22:17:03 +02:00
c11fdb9940 chore(release): Publish flame v1.8.1 et. al (#2599)
- flame@1.8.1
 - flame_test@1.12.0
 - flame_audio@2.0.4
 - flame_bloc@1.10.0
 - flame_fire_atlas@1.3.7
 - flame_forge2d@0.14.1
 - flame_isolate@0.4.0+1
 - flame_lottie@0.2.1
 - flame_noise@0.1.1+3
 - flame_oxygen@0.1.8+4
 - flame_rive@1.9.0
 - flame_spine@0.1.1
 - flame_svg@1.8.0
 - flame_tiled@1.12.0
 - jenny@1.0.4
 - flame_network_assets@0.2.0+3
2023-07-02 13:40:15 +00:00
973b5808dd chore(publish): Publish Flame v1.8.0 and bridge packages (#2557)
flame@1.8.0
flame_rive@1.8.0
flame_test@1.11.0
flame_audio@2.0.3
flame_bloc@1.9.0
flame_fire_atlas@1.3.6
flame_forge2d@0.14.0
flame_isolate@0.4.0
flame_lint@1.0.0
flame_lottie@0.2.0+3
flame_network_assets@0.2.0+2
flame_noise@0.1.1+2
flame_oxygen@0.1.8+3
flame_spine@0.1.0+1
flame_svg@1.7.4
flame_tiled@1.10.2
jenny@1.0.3
2023-05-28 18:55:47 +00:00
a54f19a405 chore(release): Publish packages (#2555)
- flame@1.8.0
 - flame_rive@1.8.0
 - flame_test@1.11.0
 - flame_audio@2.0.3
 - flame_bloc@1.9.0
 - flame_fire_atlas@1.3.6
 - flame_forge2d@0.14.0
 - flame_isolate@0.4.0
 - flame_lint@0.2.0+3
 - flame_lottie@0.2.0+3
 - flame_network_assets@0.2.0+2
 - flame_noise@0.1.1+2
 - flame_oxygen@0.1.8+3
 - flame_spine@0.1.0+1
 - flame_svg@1.7.4
 - flame_tiled@1.10.2
 - jenny@1.0.3
2023-05-28 18:24:36 +00:00
2f71e06eb8 fix: Update sdk constraints to >=3.0.0 (#2554)
Update the SDK constraint to use >= 3.0.0
2023-05-28 20:09:45 +02:00
52b35fbf56 fix: Avoid creation of unnecessary objects for RiveComponent (#2553)
Avoid creation of unnecessary objects for RiveComponent and simplifies
the example.
2023-05-25 17:04:42 +00:00
b41622db8f fix: Solve warnings from 3.10.0 analyzer (#2532)
Just solves the warnings that the new Flutter version complains about (which makes us lose 10 points on pub).
2023-05-14 16:25:23 +02:00
87b8a067f3 refactor!: Move CameraComponent and events out of experimental (#2505)
This moves the CameraComponent and the new event system out of experimental since this now is the recommended way of handling things.
2023-04-19 09:55:32 +02:00
9591e28541 chore(release): Publish packages (#2504)
- flame@1.7.3
 - flame_audio@2.0.1
 - flame_bloc@1.8.4
 - flame_fire_atlas@1.3.5
 - flame_flare@1.5.4
 - flame_forge2d@0.13.0+1
 - flame_isolate@0.3.0+1
 - flame_lint@0.2.0+2
 - flame_oxygen@0.1.8+2
 - flame_rive@1.7.1
 - flame_svg@1.7.3
 - flame_test@1.10.1
 - flame_tiled@1.10.1
 - jenny@1.0.2
 - flame_noise@0.1.1+1
 - flame_network_assets@0.2.0+1
 - flame_lottie@0.2.0+2
2023-04-16 01:18:03 +02:00
dbda37b81a refactor: Add new lint rules (#2477)
This PR adds the following lint rules to our list:

```
always_put_required_named_parameters_first
avoid_multiple_declarations_per_line
avoid_positional_boolean_parameters
avoid_returning_null_for_void
avoid_returning_this
avoid_unnecessary_containers
enable_null_safety
library_private_types_in_public_api
no_leading_underscores_for_library_prefixes
no_leading_underscores_for_local_identifiers
prefer_null_aware_method_calls
tighten_type_of_initializing_formals
unnecessary_late
use_setters_to_change_properties
```

And these rules were considered, and some changes were made according to
them as a clean-up, but in many places they didn't make sense
(`prefer_asserts_with_message` I would have included, but there were too
many places that needed to be changes):

```
collection_methods_unrelated_type
prefer_asserts_with_message
avoid_renaming_method_parameters
```
2023-04-13 19:42:00 +00:00
ac878d8edf chore(release): Publish packages (#2462) 2023-04-02 20:06:47 +02:00
b5bdf4ec17 feat!: The HasTappableComponents mixin is no longer needed (#2450)
This PR is the second in a series of refactors that aim to simplify event handling in Flame. The approach is as follows:

    Added the MultiTapDispatcher component, which contains the logic that used to be within the HasTappableComponents mixin. This component is internal; it mounts to a FlameGame directly, and ensures that it is a singleton.
    Whenever any TapCallbacks component is added to a game, it automatically adds the MultiTapDispatcher component (unless there is already one), which in turn registers a tap gesture detector with GestureDetectorBuilder and rebuilds the game widget.

The end result is that now in order to make a component tappable you only need to add the TapCallbacks mixin to that component, everything else will be handled by the framework.

Consequently, the HasTappableComponents mixin is now empty and marked as deprecated.
2023-04-02 16:52:57 +00:00
7de8fe9b6a chore: Standardize and unify SDK versions across packages (#2374)
# Description

This does two things:

## Use double quotes for SDK constraints

Standardize the usage of single or double quotes to specify sdk
constraints across pubspecs
I see no reason this should not be kept consistent
I also see no reason to prefer one over the other, so I searched the
code base and there are 7 instances of single quote vs 32 of double
quotes, so I favored the later

## Update all SDK constraints to 2.18

Let me know if there are any issues with it, but I believe we should
keep this consistent across all packages.
Also there is a pubspec on root which imply all should be on 2.18
anyway.

## Checklist

- [x] I have followed the [Contributor Guide] when preparing my PR.
- [x] I have updated/added tests for ALL new/updated/fixed
functionality.
- [x] I have updated/added relevant documentation in `docs` and added
dartdoc comments with `///`.
- [x] I have updated/added relevant examples in `examples` or `docs`.

## Breaking Change?

- [ ] Yes, this PR is a breaking change.
- [x] No, this PR is not a breaking change.

<!-- Links -->
[Contributor Guide]:
https://github.com/flame-engine/flame/blob/main/CONTRIBUTING.md
[Conventional Commit]: https://conventionalcommits.org/
[CHANGELOG]:
https://github.com/flame-engine/flame/blob/main/CHANGELOG.md

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2023-03-01 18:08:13 +00:00
f993261c74 chore: Update rive package to 0.10.2 (#2349)
0.10.2:

Performance improvement: No longer drawing components with an opacity of 0.
Updated example, see "Skinning Demo".
Support for negative speeds on linear animations when played back in state machines.
Support for overriding speed on animation states.
2023-02-19 16:01:07 +01:00
7662118d14 chore(release): Publish flame_lint 0.2.0 (#2301)
- flame_lint@0.2.0
2023-01-28 00:44:29 +00:00
ce7f1110b5 chore(release): Publish packages (#2275)
- flame@1.6.0
 - flame_forge2d@0.12.5
 - flame_jenny@1.0.0
 - flame_rive@1.6.0
 - jenny@1.0.0
 - flame_oxygen@0.1.8
 - flame_bloc@1.8.2
 - flame_isolate@0.2.0
 - flame_lottie@0.2.0
 - flame_test@1.9.2
 - flame_tiled@1.9.1
 - flame_audio@1.3.5
 - flame_flare@1.5.2
 - flame_svg@1.7.1
 - flame_fire_atlas@1.3.3
2023-01-14 19:59:42 +01:00
d898b539f7 refactor!: The method onLoad() now returns FutureOr<void> (#2228)
Before this PR, the return type of onLoad() was Future<void>?, after this PR the return type is FutureOr<void> -- both for classes Component and Game.

Reasons:

The use of FutureOr is more idiomatic in Dart, this class was specifically created in order to be used in situations like ours.
This makes learning Flame easier for beginners, since you no longer need to explain what asynchronous programming is from the start (and onLoad() is one of the first methods the user encounters in Flame).
The code can be cleaner in case when onLoad doesn't need to be async.
With new approach, the onLoad() method can be overridden as either

@override
Future<void> onLoad() async { ... }
or

@override
void onLoad() { ... }
Of course, it can also be overridden as

@override
FutureOr<void> onLoad() { ... }
but this is rare, only for components that are designed to be further subclassed, or for mixins.

The documentation was updated to show the new recommended usage.
2022-12-23 20:30:40 +00:00
b003372a74 chore(release): Publish Flame v1.5.0 (and all bridge packages) (#2197)
* chore(release): publish packages

 - flame@1.5.0
 - flame_bloc@1.8.1
 - flame_forge2d@0.12.4
 - flame_lottie@0.1.1
 - flame_rive@1.5.3
 - flame_svg@1.7.0
 - flame_test@1.9.0
 - flame_tiled@1.9.0
 - flame_isolate@0.1.1
 - flame_audio@1.3.3
 - flame_flare@1.5.1
 - flame_oxygen@0.1.7
 - flame_fire_atlas@1.3.2

* Depend on version of test
2022-11-27 19:22:37 -03:00
4542966901 chore: Remove all .gitignore files but one (#2150)
The root level .gitignore file already works for all sub-repositories, so they are all actually unnecessary.
This PR leaves only the gitignore at the root of the repo, removing all others.
2022-11-06 21:22:19 +00:00
d183332902 fix: Export rive from flame_rive (#2130) 2022-10-29 09:53:44 +00:00
3b056c57c5 chore(release): publish packages
- flame@1.4.0
 - flame_test@1.8.0
 - flame_oxygen@0.1.6
 - flame_bloc@1.8.0
 - flame_flare@1.5.0
 - flame_forge2d@0.12.3
 - flame_lint@0.1.3
 - flame_svg@1.6.0
 - flame_tiled@1.8.0
 - flame_rive@1.5.2
 - flame_audio@1.3.2
 - flame_fire_atlas@1.3.1
2022-10-01 15:22:41 +02:00
b96432d002 chore(release): publish packages (#1852) 2022-08-19 23:22:21 +02:00
c7c4480d79 chore(release): publish packages (#1789)
* chore(release): publish packages

 - flame@1.2.1
 - flame_audio@1.3.0
 - flame_test@1.6.0
 - flame_bloc@1.6.0
 - flame_fire_atlas@1.2.0
 - flame_flare@1.3.0
 - flame_forge2d@0.12.1
 - flame_lint@0.1.1
 - flame_oxygen@0.1.4
 - flame_rive@1.5.0
 - flame_svg@1.4.0
 - flame_tiled@1.6.0

* Update packages/flame/CHANGELOG.md
2022-07-08 13:41:14 +02:00
3cefa95342 chore(release): publish packages (#1743)
- flame_rive@1.4.0

Co-authored-by: Erick <erickzanardoo@gmail.com>
2022-06-22 17:52:42 +00:00
82e4be96f3 fix: Flame_rive now can load Nested Artboards and update to 0.9.0 rive package (#1741)
Is a solution to Closes #1692 and updatting to rive 0.9.0 flutter package
2022-06-19 03:12:35 +02:00
2a41d0d683 feat: Move to Flutter 3.0.0 and Dart 2.17.0 (#1713)
This upgrades all packages to Flutter 3.0.0 and fixes all analyze issues that came from that.
2022-06-08 06:04:40 +00:00
ad602ff963 chore: v1.2.0 changelogs (#1712)
* chore(release): publish packages

 - flame@1.2.0
 - flame_audio@1.1.0
 - flame_bloc@1.5.0
 - flame_fire_atlas@1.1.0
 - flame_flare@1.2.0
 - flame_forge2d@0.12.0
 - flame_oxygen@0.1.3
 - flame_rive@1.3.0
 - flame_svg@1.3.0
 - flame_test@1.5.0
 - flame_tiled@1.5.0
2022-06-07 16:52:55 +02:00
49252f8ef2 feat: Add more lint rules (#1703)
Adds some more lint rules and fixes the issues those rules pointed out.
2022-06-06 19:23:25 +00:00
beac901313 feat: Bump to Flutter 2.10.0 (#1617) 2022-05-13 12:50:08 +02:00
ac3d4bf61b feat: update to Rive 0.8.4 (#1542)
Co-authored-by: norberto <normaafo@gmail>
2022-04-13 13:01:11 +02:00
062962de08 feat: update rive package to 0.8.1 (now support raster graphics) (#1343) 2022-02-01 11:35:42 +01:00
05f7a4c3d6 refactor: Remove Loadable, optional onLoads (#1333) 2022-01-24 23:23:12 +01:00
a0cf56ee0c chore: Ensure unique names for all flame sub-packages (#1214)
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-12-14 13:22:12 -03:00
5c47d7f6d7 chore: analyze issues introduced from new dart version (#1196)
* Added Component.childrenFactory

* fix some of the lint warnings

* more lint warnings

* remove changelog entry

* more analyzer warnings

* one more warning

* one more warning

* remove more unused imports

* fix more warnings

* another warning

* one more warning

* a lot more warnings

* some more warnings

* fix warnings in flame_svg

* fix warnings in flame_bloc

* Remove OrderedSet override feature

* Remove testRandom change

* Remove unnecessary type checks

* Re-remove deprecated argument in random_test

Co-authored-by: Pasha Stetsenko <stpasha@google.com>
2021-12-09 15:40:43 +01:00
795264edbf Unify mixin names (#1114) 2021-11-18 08:48:31 +01:00
cd7a0bbb65 ShapeComponent and Hitbox to take transform of parents full ancestor tree into consideration (#1076)
* `ShapeComponent` changes size, position and angle of underlying Shape

* Added description to ShapeComponent

* Fix test

* Update packages/flame/lib/src/components/shape_component.dart

Co-authored-by: Erick <erickzanardoo@gmail.com>

* Add absoluteScale and absoluteAngle to PositionComponent

* Refactor ShapeComponent

* Should be scaled by total scale, not scaled size

* Premature optimization for creation for objects in Polygon

* Use path for default Polygon constructor

* Do not sync component and hitbox shape

* Fix analyze issue

* Add example for flipping with collision detection

* Don't use absoluteScale

* Fix examples

* Fix examples

* Doesn't need super.render

* Fix Circle dartdoc

* Update changelog

* Update names of vertices caches in Polygon

* Update text docs

* Revert "Update text docs"

This reverts commit 73a68a465d76eb0eb50bb3753e57b2f4e3b5a7f4.

* Fix examples

* ShapeComponents docs

* Move example games to the top

* Fix dartdoc comment about polygon vertex relation

* Fix order of polygon vertices in dartdoc

* Fix anchor for PolygonComponent.fromPoints

* Add test with ancestors

* Update doc/components.md

Co-authored-by: Pasha Stetsenko <stpasha@google.com>

* Update doc/components.md

Co-authored-by: Erick <erickzanardoo@gmail.com>

* Rename example classes

* Fix linting issues in examples

* Don't use px

* Use isTrue and isFalse

* Update doc/components.md

Co-authored-by: Erick <erickzanardoo@gmail.com>

* Fixed comments on PR

Co-authored-by: Erick <erickzanardoo@gmail.com>
Co-authored-by: Pasha Stetsenko <stpasha@google.com>
2021-11-13 16:00:24 +01:00
32bf19b91c Add random to the Color and Paint extensions (#1081)
* Add `randomColor` to the `Color` extension

* Add flame rive package to monorepo (#1048)

Add flame rive package to monorepo

* Add random to PaintExtension

* Update examples/pubspec.yaml

Co-authored-by: Erick <erickzanardoo@gmail.com>

Co-authored-by: Renan <6718144+renancaraujo@users.noreply.github.com>
Co-authored-by: Erick <erickzanardoo@gmail.com>
2021-11-10 13:09:12 +01:00
0f209309f0 Add flame rive package to monorepo (#1048)
Add flame rive package to monorepo
2021-11-09 10:58:36 +00:00