34 Commits

Author SHA1 Message Date
10e4109c81 refactor: Fix lint issues across the codebase - Part 2 (#2677)
Fix a handful of lint issues across the codebase, identified using DCM.
Nothing controversial, I expect; slowly getting these out of the way so
we can focus on discussing bigger things.
2023-08-25 18:15:17 +00:00
9887892493 chore: Update to Flutter 3.13 (#2656)
Updates the pipeline to use Flutter 3.13 and does all the analyze fixes.
2023-08-18 20:13:17 +02:00
2d45d2be39 chore: Remove 1.8.0 deprecations (#2538)
Removes all the deprecated methods before 1.8.0 release.
2023-05-22 19:01:55 +02: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
5d1a6fd167 feat: Spine bridge package (#2530)
This PR introduces a bridge package for Spine.

https://user-images.githubusercontent.com/744771/236058480-75c8212b-98e6-4e3b-834a-c1a9d4de31a8.mp4
2023-05-05 23:17:15 +02:00
472356df31 docs: WeldJoint docs and example (#2525)
WeldJoint docs and example
2023-05-01 20:22:28 +02:00
0991c3bf67 docs: RopeJoint documentation and example (#2520)
RopeJoint documentation and example
2023-04-25 10:37:31 +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
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
78b585fe8e docs: Added GearJoint docs and example (#2487)
GearJoint docs and example
2023-04-13 21:09:26 +02:00
47372087f2 feat!: Update AudioPlayers to ^4.0.0 (#2482)
This updates flame_audio to use the recently released audioplayers 4.0.0

Migration instructions:

AudioPool has moved to AudioPlayers, but we still export it from
flame_audio, so the only thing you have to do if you import AudioPool
directly is to change the import to:
import 'package:flame_audio/flame_audio.dart';
2023-04-11 21:51:43 +02:00
e4f741ef23 docs: PrismaticJoint docs and example (#2470)
PrismaticJoint example and documentation
2023-04-07 12:17:05 +00: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
b83c50737c docs: Added RevoluteJoint documentation (#2451)
Added RevoluteJoint documentation section
Moved the related example to the joints subfolder, and renamed the second example to avoid confusion.
2023-03-31 21:23:31 +02:00
83c718fd50 docs: Update source code urls of forge2d joints in Flame Examples (#2437)
Update source code urls of forge2d joints in Flame Examples
2023-03-29 15:55:52 +00:00
e1049470fa docs: PulleyJoint documentation and example (#2425)
PulleyJoint documentation and example
2023-03-24 16:50:34 +01:00
277bd5d55c docs: MouseJoint documentation (#2417)
MouseJoint documentation, mostly copied from box2d docs. Moved the
existing example to joints subfolder
2023-03-18 15:21:30 +01:00
cb52f5a58a docs: MotorJoint doc and example (#2394)
Documentation covering MotorJoint and a usage example.
2023-03-12 22:31:20 +00:00
0ea612d73a docs: FrictionJoint documentation and example (#2383)
Added documentation and example for FrictionJoint.
Also modified main.dart to be able to run individual examples by providing page param.
2023-03-06 23:34:45 +01:00
5b07bd58f3 docs: DistanceJoint documentation and example (#2369)
DistanceJoint documentation and example
2023-02-27 22:29:07 +01:00
957ad2402a docs: Added a page for Joints documentation + ConstantVolumeJoint doc and example (#2362)
Added a page for Forge2D joints documentation.
Added a `ConstantVolumeJoint` documentation and example.

Will add other joint types in the next PRs.
2023-02-26 13:33:22 +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
3a73d1456c feat: Lottie bridge package (#2157)
This PR adds support for Lottie animations to flame
2022-11-22 21:42:15 +00:00
9870eadaad docs: Fix bad links in docs as well as minor updates (#2170)
Closes: #2169

As discussed, a quick fix to some bad links and while I was in Flame Isolate, fixed some bad grammar.
2022-11-16 16:11:36 +01:00
cbfa789e75 chore: Fix some spelling mistakes (#2148)
Fix all* typos reported by CSpell, and add some more words into the dictionaries.

(Except for two in the flame_isolate/example package).
2022-11-06 14:06:44 +00:00
b25b935644 feat: FlameIsolate - a neat way of handling threads (#1909)
Adding a bridge library for integral_isolates adding support for components to run CPU intensive code with a function similar to Flutter's compute function, but with a long lived isolate. Lifecycle is handled by the game loop, where the isolate would live between onMount and onRemove.
2022-10-31 21:06:27 +01:00
dfb94d1a34 fix: Audio Fixed for live examples (#2044) 2022-10-08 12:59:13 +02:00
475b226911 docs: Fixed broken example links (#2030) 2022-10-06 10:15:32 +02:00
deccb4349d feat: Add avoid_final_parameters, depend_on_referenced_packages, unnecessary_to_list_in_spreads (#1927)
Adds these three sensible rules:

avoid_final_parameters

depend_on_referenced_package

unnecessary_to_list_in_spreads
2022-09-20 21:23:43 +02:00
d6bf920d28 feat!: Update flame_audio to AP 1.0.0 (#1724) 2022-06-14 00:12:47 -04: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
a448ec7dab fix: Broken links for flame_forge2d examples (#1631) 2022-05-16 16:12:56 +02:00
843ddc3624 refactor: Move to package imports (#1625)
* refactor: Move to package imports

* Fix local imports

* Removed unused imports
2022-05-15 15:04:35 +00:00
6dd0a970e6 docs: Move flame_forge2d examples to main examples (#1588) 2022-05-01 13:00:48 +00:00