chore: remove TODO comments form the codebase (#373)

Co-authored-by: Tom Arra <tarra3@gmail.com>
pull/382/head
Jorge Coca 3 years ago committed by GitHub
parent 698085a79c
commit b8f26b81de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,13 +25,10 @@ class BonusNoiseBehavior extends Component {
audioPlayer.play(PinballAudio.sparky); audioPlayer.play(PinballAudio.sparky);
break; break;
case GameBonus.dinoChomp: case GameBonus.dinoChomp:
// TODO(erickzanardo): Add sound
break; break;
case GameBonus.androidSpaceship: case GameBonus.androidSpaceship:
// TODO(erickzanardo): Add sound
break; break;
case GameBonus.dashNest: case GameBonus.dashNest:
// TODO(erickzanardo): Add sound
break; break;
} }
}, },

@ -11,10 +11,6 @@ class AndroidSpaceshipBonusBehavior extends Component
void onMount() { void onMount() {
super.onMount(); super.onMount();
final androidSpaceship = parent.firstChild<AndroidSpaceship>()!; final androidSpaceship = parent.firstChild<AndroidSpaceship>()!;
// TODO(alestiago): Refactor subscription management once the following is
// merged:
// https://github.com/flame-engine/flame/pull/1538
androidSpaceship.bloc.stream.listen((state) { androidSpaceship.bloc.stream.listen((state) {
final listenWhen = state == AndroidSpaceshipState.withBonus; final listenWhen = state == AndroidSpaceshipState.withBonus;
if (!listenWhen) return; if (!listenWhen) return;

@ -32,7 +32,6 @@ final _subtitleTextPaint = TextPaint(
/// {@template initials_input_display} /// {@template initials_input_display}
/// Display that handles the user input on the game over view. /// Display that handles the user input on the game over view.
/// {@endtemplate} /// {@endtemplate}
// TODO(allisonryan0002): add mobile input buttons.
class InitialsInputDisplay extends Component with HasGameRef { class InitialsInputDisplay extends Component with HasGameRef {
/// {@macro initials_input_display} /// {@macro initials_input_display}
InitialsInputDisplay({ InitialsInputDisplay({

@ -9,7 +9,6 @@ import 'package:pinball_flame/pinball_flame.dart';
/// ///
/// The [BottomGroup] consists of [Flipper]s, [Baseboard]s and [Kicker]s. /// The [BottomGroup] consists of [Flipper]s, [Baseboard]s and [Kicker]s.
/// {@endtemplate} /// {@endtemplate}
// TODO(allisonryan0002): Consider renaming.
class BottomGroup extends Component with ZIndex { class BottomGroup extends Component with ZIndex {
/// {@macro bottom_group} /// {@macro bottom_group}
BottomGroup() BottomGroup()

@ -11,10 +11,6 @@ class ChromeDinoBonusBehavior extends Component
void onMount() { void onMount() {
super.onMount(); super.onMount();
final chromeDino = parent.firstChild<ChromeDino>()!; final chromeDino = parent.firstChild<ChromeDino>()!;
// TODO(alestiago): Refactor subscription management once the following is
// merged:
// https://github.com/flame-engine/flame/pull/1538
chromeDino.bloc.stream.listen((state) { chromeDino.bloc.stream.listen((state) {
final listenWhen = state.status == ChromeDinoStatus.chomping; final listenWhen = state.status == ChromeDinoStatus.chomping;
if (!listenWhen) return; if (!listenWhen) return;

@ -25,9 +25,6 @@ class FlutterForestBonusBehavior extends Component
final canvas = gameRef.descendants().whereType<ZCanvasComponent>().single; final canvas = gameRef.descendants().whereType<ZCanvasComponent>().single;
for (final bumper in bumpers) { for (final bumper in bumpers) {
// TODO(alestiago): Refactor subscription management once the following is
// merged:
// https://github.com/flame-engine/flame/pull/1538
bumper.bloc.stream.listen((state) { bumper.bloc.stream.listen((state) {
final activatedAllBumpers = bumpers.every( final activatedAllBumpers = bumpers.every(
(bumper) => bumper.bloc.state == DashNestBumperState.active, (bumper) => bumper.bloc.state == DashNestBumperState.active,

@ -13,9 +13,6 @@ class GoogleWordBonusBehavior extends Component
final googleLetters = parent.children.whereType<GoogleLetter>(); final googleLetters = parent.children.whereType<GoogleLetter>();
for (final letter in googleLetters) { for (final letter in googleLetters) {
// TODO(alestiago): Refactor subscription management once the following is
// merged:
// https://github.com/flame-engine/flame/pull/1538
letter.bloc.stream.listen((_) { letter.bloc.stream.listen((_) {
final achievedBonus = googleLetters final achievedBonus = googleLetters
.every((letter) => letter.bloc.state == GoogleLetterState.lit); .every((letter) => letter.bloc.state == GoogleLetterState.lit);

@ -13,10 +13,6 @@ class SparkyComputerBonusBehavior extends Component
super.onMount(); super.onMount();
final sparkyComputer = parent.firstChild<SparkyComputer>()!; final sparkyComputer = parent.firstChild<SparkyComputer>()!;
final animatronic = parent.firstChild<SparkyAnimatronic>()!; final animatronic = parent.firstChild<SparkyAnimatronic>()!;
// TODO(alestiago): Refactor subscription management once the following is
// merged:
// https://github.com/flame-engine/flame/pull/1538
sparkyComputer.bloc.stream.listen((state) async { sparkyComputer.bloc.stream.listen((state) async {
final listenWhen = state == SparkyComputerState.withBall; final listenWhen = state == SparkyComputerState.withBall;
if (!listenWhen) return; if (!listenWhen) return;

@ -253,7 +253,6 @@ class PreviewLine extends PositionComponent with HasGameRef<DebugPinballGame> {
} }
} }
// TODO(wolfenrain): investigate this CI failure.
class _DebugInformation extends Component with HasGameRef<DebugPinballGame> { class _DebugInformation extends Component with HasGameRef<DebugPinballGame> {
@override @override
PositionType get positionType => PositionType.widget; PositionType get positionType => PositionType.widget;

@ -1,5 +1,4 @@
// ignore_for_file: public_member_api_docs // ignore_for_file: public_member_api_docs
// TODO(allisonryan0002): Document this section when the API is stable.
import 'package:bloc/bloc.dart'; import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';

@ -1,5 +1,4 @@
// ignore_for_file: public_member_api_docs // ignore_for_file: public_member_api_docs
// TODO(allisonryan0002): Document this section when the API is stable.
part of 'character_theme_cubit.dart'; part of 'character_theme_cubit.dart';

@ -93,8 +93,6 @@ class AndroidBumper extends BodyComponent with InitialPosition, ZIndex {
/// Creates an [AndroidBumper] without any children. /// Creates an [AndroidBumper] without any children.
/// ///
/// This can be used for testing [AndroidBumper]'s behaviors in isolation. /// This can be used for testing [AndroidBumper]'s behaviors in isolation.
// TODO(alestiago): Refactor injecting bloc once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
@visibleForTesting @visibleForTesting
AndroidBumper.test({ AndroidBumper.test({
required this.bloc, required this.bloc,
@ -105,8 +103,6 @@ class AndroidBumper extends BodyComponent with InitialPosition, ZIndex {
final double _minorRadius; final double _minorRadius;
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
final AndroidBumperCubit bloc; final AndroidBumperCubit bloc;

@ -38,16 +38,12 @@ class AndroidSpaceship extends Component {
/// Creates an [AndroidSpaceship] without any children. /// Creates an [AndroidSpaceship] without any children.
/// ///
/// This can be used for testing [AndroidSpaceship]'s behaviors in isolation. /// This can be used for testing [AndroidSpaceship]'s behaviors in isolation.
// TODO(alestiago): Refactor injecting bloc once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
@visibleForTesting @visibleForTesting
AndroidSpaceship.test({ AndroidSpaceship.test({
required this.bloc, required this.bloc,
Iterable<Component>? children, Iterable<Component>? children,
}) : super(children: children); }) : super(children: children);
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
final AndroidSpaceshipCubit bloc; final AndroidSpaceshipCubit bloc;
@override @override
@ -129,7 +125,6 @@ class _SpaceshipSaucerSpriteAnimationComponent extends SpriteAnimationComponent
} }
} }
// TODO(allisonryan0002): add pulsing behavior.
class _LightBeamSpriteComponent extends SpriteComponent class _LightBeamSpriteComponent extends SpriteComponent
with HasGameRef, ZIndex { with HasGameRef, ZIndex {
_LightBeamSpriteComponent() _LightBeamSpriteComponent()

@ -72,7 +72,6 @@ class Ball extends BodyComponent with Layered, InitialPosition, ZIndex {
/// ///
/// The [Ball] will no longer be affected by any forces, including it's /// The [Ball] will no longer be affected by any forces, including it's
/// weight and those emitted from collisions. /// weight and those emitted from collisions.
// TODO(allisonryan0002): prevent motion from contact with other balls.
void stop() { void stop() {
body body
..gravityScale = Vector2.zero() ..gravityScale = Vector2.zero()

@ -5,7 +5,6 @@ import 'package:flame/extensions.dart';
/// {@template board_dimensions} /// {@template board_dimensions}
/// Contains various board properties and dimensions for global use. /// Contains various board properties and dimensions for global use.
/// {@endtemplate} /// {@endtemplate}
// TODO(allisonryan0002): consider alternatives for global dimensions.
class BoardDimensions { class BoardDimensions {
/// Width and height of the board. /// Width and height of the board.
static final size = Vector2(101.6, 143.8); static final size = Vector2(101.6, 143.8);

@ -38,15 +38,11 @@ class ChromeDino extends BodyComponent
/// Creates a [ChromeDino] without any children. /// Creates a [ChromeDino] without any children.
/// ///
/// This can be used for testing [ChromeDino]'s behaviors in isolation. /// This can be used for testing [ChromeDino]'s behaviors in isolation.
// TODO(alestiago): Refactor injecting bloc once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
@visibleForTesting @visibleForTesting
ChromeDino.test({ ChromeDino.test({
required this.bloc, required this.bloc,
}); });
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
final ChromeDinoCubit bloc; final ChromeDinoCubit bloc;

@ -90,8 +90,6 @@ class DashNestBumper extends BodyComponent with InitialPosition {
/// Creates an [DashNestBumper] without any children. /// Creates an [DashNestBumper] without any children.
/// ///
/// This can be used for testing [DashNestBumper]'s behaviors in isolation. /// This can be used for testing [DashNestBumper]'s behaviors in isolation.
// TODO(alestiago): Refactor injecting bloc once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
@visibleForTesting @visibleForTesting
DashNestBumper.test({required this.bloc}) DashNestBumper.test({required this.bloc})
: _majorRadius = 3, : _majorRadius = 3,
@ -100,8 +98,6 @@ class DashNestBumper extends BodyComponent with InitialPosition {
final double _majorRadius; final double _majorRadius;
final double _minorRadius; final double _minorRadius;
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
final DashNestBumperCubit bloc; final DashNestBumperCubit bloc;

@ -8,14 +8,6 @@ import 'package:flutter/material.dart';
const _particleRadius = 0.25; const _particleRadius = 0.25;
// TODO(erickzanardo): This component could just be a ParticleComponet,
/// unfortunately there is a Particle Component is not a PositionComponent,
/// which makes it hard to be used since we have camera transformations and on
// top of that, PositionComponent has a bug inside forge 2d games
///
/// https://github.com/flame-engine/flame/issues/1484
/// https://github.com/flame-engine/flame/issues/1484
/// {@template fire_effect} /// {@template fire_effect}
/// A [BodyComponent] which creates a fire trail effect using the given /// A [BodyComponent] which creates a fire trail effect using the given
/// parameters /// parameters

@ -100,8 +100,8 @@ class Flipper extends BodyComponent with KeyboardHandler, InitialPosition {
final trapezium = PolygonShape()..set(trapeziumVertices); final trapezium = PolygonShape()..set(trapeziumVertices);
final trapeziumFixtureDef = FixtureDef( final trapeziumFixtureDef = FixtureDef(
trapezium, trapezium,
density: 50, // TODO(alestiago): Use a proper density. density: 50,
friction: .1, // TODO(alestiago): Use a proper friction. friction: .1,
); );
return [ return [

@ -68,15 +68,11 @@ class GoogleLetter extends BodyComponent with InitialPosition {
/// Creates a [GoogleLetter] without any children. /// Creates a [GoogleLetter] without any children.
/// ///
/// This can be used for testing [GoogleLetter]'s behaviors in isolation. /// This can be used for testing [GoogleLetter]'s behaviors in isolation.
// TODO(alestiago): Refactor injecting bloc once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
@visibleForTesting @visibleForTesting
GoogleLetter.test({ GoogleLetter.test({
required this.bloc, required this.bloc,
}); });
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
final GoogleLetterCubit bloc; final GoogleLetterCubit bloc;

@ -24,8 +24,6 @@ mixin InitialPosition on BodyComponent {
@override @override
Future<void> onLoad() async { Future<void> onLoad() async {
await super.onLoad(); await super.onLoad();
// TODO(alestiago): Investiagate why body.position.setFrom(initialPosition)
// works for some components and not others.
assert( assert(
body.position == initialPosition, body.position == initialPosition,
'Body position does not match initialPosition.', 'Body position does not match initialPosition.',

@ -51,16 +51,12 @@ class Kicker extends BodyComponent with InitialPosition {
/// Creates a [Kicker] without any children. /// Creates a [Kicker] without any children.
/// ///
/// This can be used for testing [Kicker]'s behaviors in isolation. /// This can be used for testing [Kicker]'s behaviors in isolation.
// TODO(alestiago): Refactor injecting bloc once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
@visibleForTesting @visibleForTesting
Kicker.test({ Kicker.test({
required this.bloc, required this.bloc,
required BoardSide side, required BoardSide side,
}) : _side = side; }) : _side = side;
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
final KickerCubit bloc; final KickerCubit bloc;
@ -129,7 +125,6 @@ class Kicker extends BodyComponent with InitialPosition {
FixtureDef(bouncyEdge, userData: 'bouncy_edge'), FixtureDef(bouncyEdge, userData: 'bouncy_edge'),
]; ];
// TODO(alestiago): Evaluate if there is value on centering the fixtures.
final centroid = geometry.centroid( final centroid = geometry.centroid(
[ [
upperCircle.position + Vector2(0, -upperCircle.radius), upperCircle.position + Vector2(0, -upperCircle.radius),
@ -177,8 +172,6 @@ class _KickerSpriteGroupComponent extends SpriteGroupComponent<KickerState>
@override @override
Future<void> onLoad() async { Future<void> onLoad() async {
await super.onLoad(); await super.onLoad();
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
parent.bloc.stream.listen((state) => current = state); parent.bloc.stream.listen((state) => current = state);
@ -203,8 +196,6 @@ class _KickerSpriteGroupComponent extends SpriteGroupComponent<KickerState>
} }
} }
// TODO(alestiago): Evaluate if there's value on generalising this to
// all shapes.
extension on Shape { extension on Shape {
void moveBy(Vector2 offset) { void moveBy(Vector2 offset) {
if (this is CircleShape) { if (this is CircleShape) {

@ -32,9 +32,6 @@ class _LaunchRampBase extends BodyComponent with Layered, ZIndex {
layer = Layer.launcher; layer = Layer.launcher;
} }
// TODO(ruimiguel): final asset differs slightly from the current shape. We
// need to fix shape with correct vertices, but right now merge them to have
// final assets at game and not be blocked.
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
final fixturesDef = <FixtureDef>[]; final fixturesDef = <FixtureDef>[];

@ -74,7 +74,6 @@ extension LayerMaskBits on Layer {
/// {@macro layer_mask_bits} /// {@macro layer_mask_bits}
@visibleForTesting @visibleForTesting
int get maskBits { int get maskBits {
// TODO(ruialonso): test bit groups once final design is implemented.
switch (this) { switch (this) {
case Layer.all: case Layer.all:
return 0xFFFF; return 0xFFFF;

@ -50,8 +50,6 @@ abstract class LayerSensor extends BodyComponent with InitialPosition, Layered {
Shape get shape; Shape get shape;
/// {@macro layer_entrance_orientation} /// {@macro layer_entrance_orientation}
// TODO(ruimiguel): Try to remove the need of [LayerEntranceOrientation] for
// collision calculations.
final LayerEntranceOrientation orientation; final LayerEntranceOrientation orientation;
@override @override

@ -75,15 +75,11 @@ class Multiball extends Component {
/// Creates an [Multiball] without any children. /// Creates an [Multiball] without any children.
/// ///
/// This can be used for testing [Multiball]'s behaviors in isolation. /// This can be used for testing [Multiball]'s behaviors in isolation.
// TODO(alestiago): Refactor injecting bloc once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
@visibleForTesting @visibleForTesting
Multiball.test({ Multiball.test({
required this.bloc, required this.bloc,
}); });
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
final MultiballCubit bloc; final MultiballCubit bloc;

@ -81,8 +81,6 @@ class Multiplier extends Component {
/// Creates a [Multiplier] without any children. /// Creates a [Multiplier] without any children.
/// ///
/// This can be used for testing [Multiplier]'s behaviors in isolation. /// This can be used for testing [Multiplier]'s behaviors in isolation.
// TODO(alestiago): Refactor injecting bloc once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
@visibleForTesting @visibleForTesting
Multiplier.test({ Multiplier.test({
required MultiplierValue value, required MultiplierValue value,
@ -91,8 +89,6 @@ class Multiplier extends Component {
_position = Vector2.zero(), _position = Vector2.zero(),
_angle = 0; _angle = 0;
// TODO(ruimiguel): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
final MultiplierCubit bloc; final MultiplierCubit bloc;
final MultiplierValue _value; final MultiplierValue _value;

@ -178,26 +178,16 @@ class _PlungerSpriteAnimationGroupComponent
@override @override
Future<void> onLoad() async { Future<void> onLoad() async {
await super.onLoad(); await super.onLoad();
// TODO(alestiago): Used cached images.
final spriteSheet = await gameRef.images.load( final spriteSheet = await gameRef.images.load(
Assets.images.plunger.plunger.keyName, Assets.images.plunger.plunger.keyName,
); );
const amountPerRow = 20; const amountPerRow = 20;
const amountPerColumn = 1; const amountPerColumn = 1;
final textureSize = Vector2( final textureSize = Vector2(
spriteSheet.width / amountPerRow, spriteSheet.width / amountPerRow,
spriteSheet.height / amountPerColumn, spriteSheet.height / amountPerColumn,
); );
size = textureSize / 10; size = textureSize / 10;
// TODO(ruimiguel): we only need plunger pull animation, and release is just
// to reverse it, so we need to divide by 2 while we don't have only half of
// the animation (but amountPerRow and amountPerColumn needs to be correct
// in order of calculate textureSize correctly).
final pullAnimation = SpriteAnimation.fromFrameData( final pullAnimation = SpriteAnimation.fromFrameData(
spriteSheet, spriteSheet,
SpriteAnimationData.sequenced( SpriteAnimationData.sequenced(
@ -209,7 +199,6 @@ class _PlungerSpriteAnimationGroupComponent
loop: false, loop: false,
), ),
); );
animations = { animations = {
_PlungerAnimationState.release: pullAnimation.reversed(), _PlungerAnimationState.release: pullAnimation.reversed(),
_PlungerAnimationState.pull: pullAnimation, _PlungerAnimationState.pull: pullAnimation,

@ -28,7 +28,6 @@ class ArcShape extends ChainShape {
final Vector2 center; final Vector2 center;
/// The radius of the arc. /// The radius of the arc.
// TODO(alestiago): Check if modifying the parent radius makes sense.
final double arcRadius; final double arcRadius;
/// Specifies the size of the arc, in radians. /// Specifies the size of the arc, in radians.

@ -26,7 +26,6 @@ class EllipseShape extends ChainShape {
/// The top left corner of the ellipse. /// The top left corner of the ellipse.
/// ///
/// Where the initial painting begins. /// Where the initial painting begins.
// TODO(ruialonso): Change to use appropiate center.
final Vector2 center; final Vector2 center;
/// Major radius is specified by [majorRadius]. /// Major radius is specified by [majorRadius].

@ -36,15 +36,11 @@ class Signpost extends BodyComponent with InitialPosition {
/// Creates a [Signpost] without any children. /// Creates a [Signpost] without any children.
/// ///
/// This can be used for testing [Signpost]'s behaviors in isolation. /// This can be used for testing [Signpost]'s behaviors in isolation.
// TODO(alestiago): Refactor injecting bloc once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
@visibleForTesting @visibleForTesting
Signpost.test({ Signpost.test({
required this.bloc, required this.bloc,
}); });
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
final SignpostCubit bloc; final SignpostCubit bloc;

@ -38,15 +38,11 @@ class SkillShot extends BodyComponent with ZIndex {
/// Creates a [SkillShot] without any children. /// Creates a [SkillShot] without any children.
/// ///
/// This can be used for testing [SkillShot]'s behaviors in isolation. /// This can be used for testing [SkillShot]'s behaviors in isolation.
// TODO(alestiago): Refactor injecting bloc once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
@visibleForTesting @visibleForTesting
SkillShot.test({ SkillShot.test({
required this.bloc, required this.bloc,
}); });
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
final SkillShotCubit bloc; final SkillShotCubit bloc;

@ -27,8 +27,6 @@ class SpaceshipRamp extends Component {
required this.bloc, required this.bloc,
}) : super( }) : super(
children: [ children: [
// TODO(ruimiguel): refactor RampScoringSensor and
// _SpaceshipRampOpening to be in only one sensor if possible.
RampScoringSensor( RampScoringSensor(
children: [ children: [
RampBallAscendingContactBehavior(), RampBallAscendingContactBehavior(),
@ -68,8 +66,6 @@ class SpaceshipRamp extends Component {
required this.bloc, required this.bloc,
}) : super(); }) : super();
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
final SpaceshipRampCubit bloc; final SpaceshipRampCubit bloc;

@ -93,8 +93,6 @@ class SparkyBumper extends BodyComponent with InitialPosition, ZIndex {
/// Creates an [SparkyBumper] without any children. /// Creates an [SparkyBumper] without any children.
/// ///
/// This can be used for testing [SparkyBumper]'s behaviors in isolation. /// This can be used for testing [SparkyBumper]'s behaviors in isolation.
// TODO(alestiago): Refactor injecting bloc once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
@visibleForTesting @visibleForTesting
SparkyBumper.test({ SparkyBumper.test({
required this.bloc, required this.bloc,
@ -104,8 +102,6 @@ class SparkyBumper extends BodyComponent with InitialPosition, ZIndex {
final double _majorRadius; final double _majorRadius;
final double _minorRadius; final double _minorRadius;
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
final SparkyBumperCubit bloc; final SparkyBumperCubit bloc;
@ -152,8 +148,6 @@ class _SparkyBumperSpriteGroupComponent
@override @override
Future<void> onLoad() async { Future<void> onLoad() async {
await super.onLoad(); await super.onLoad();
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
parent.bloc.stream.listen((state) => current = state); parent.bloc.stream.listen((state) => current = state);

@ -31,16 +31,12 @@ class SparkyComputer extends BodyComponent {
/// Creates a [SparkyComputer] without any children. /// Creates a [SparkyComputer] without any children.
/// ///
/// This can be used for testing [SparkyComputer]'s behaviors in isolation. /// This can be used for testing [SparkyComputer]'s behaviors in isolation.
// TODO(alestiago): Refactor injecting bloc once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
@visibleForTesting @visibleForTesting
SparkyComputer.test({ SparkyComputer.test({
required this.bloc, required this.bloc,
Iterable<Component>? children, Iterable<Component>? children,
}) : super(children: children); }) : super(children: children);
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
final SparkyComputerCubit bloc; final SparkyComputerCubit bloc;

@ -1,7 +1,6 @@
// ignore_for_file: public_member_api_docs // ignore_for_file: public_member_api_docs
/// Z-Indexes for the component rendering order in the pinball game. /// Z-Indexes for the component rendering order in the pinball game.
// TODO(allisonryan0002): find alternative to section comments.
abstract class ZIndexes { abstract class ZIndexes {
static const _base = 0; static const _base = 0;
static const _above = 1; static const _above = 1;
@ -21,8 +20,6 @@ abstract class ZIndexes {
// Background // Background
// TODO(allisonryan0002): fix this magic zindex. Could bump all priorities so
// there are no negatives.
static const boardBackground = 5 * _below + _base; static const boardBackground = 5 * _below + _base;
static const decal = _above + boardBackground; static const decal = _above + boardBackground;

@ -44,8 +44,6 @@ void main() {
expect(game.contains(androidBumper), isTrue); expect(game.contains(androidBumper), isTrue);
}); });
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async { flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockAndroidBumperCubit(); final bloc = _MockAndroidBumperCubit();

@ -70,8 +70,6 @@ void main() {
}, },
); );
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async { flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockAndroidSpaceshipCubit(); final bloc = _MockAndroidSpaceshipCubit();

@ -71,8 +71,6 @@ void main() {
}, },
); );
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async { flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockChromeDinoCubit(); final bloc = _MockChromeDinoCubit();

@ -46,8 +46,6 @@ void main() {
expect(game.contains(bumper), isTrue); expect(game.contains(bumper), isTrue);
}); });
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async { flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockDashNestBumperCubit(); final bloc = _MockDashNestBumperCubit();

@ -18,8 +18,6 @@ void main() {
final flameTester = FlameTester(() => TestGame(assets)); final flameTester = FlameTester(() => TestGame(assets));
group('Flipper', () { group('Flipper', () {
// TODO(alestiago): Consider testing always both left and right Flipper.
flameTester.testGameWidget( flameTester.testGameWidget(
'renders correctly', 'renders correctly',
setUp: (game, tester) async { setUp: (game, tester) async {

@ -102,8 +102,6 @@ void main() {
expect(() => GoogleLetter(6), throwsA(isA<RangeError>())); expect(() => GoogleLetter(6), throwsA(isA<RangeError>()));
}); });
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async { flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockGoogleLetterCubit(); final bloc = _MockGoogleLetterCubit();

@ -61,8 +61,6 @@ void main() {
}, },
); );
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async { flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockKickerCubit(); final bloc = _MockKickerCubit();

@ -29,8 +29,6 @@ void main() {
expect(game.contains(skillShot), isTrue); expect(game.contains(skillShot), isTrue);
}); });
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async { flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockSkillShotCubit(); final bloc = _MockSkillShotCubit();

@ -44,8 +44,6 @@ void main() {
expect(game.contains(sparkyBumper), isTrue); expect(game.contains(sparkyBumper), isTrue);
}); });
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async { flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockSparkyBumperCubit(); final bloc = _MockSparkyBumperCubit();

@ -47,8 +47,6 @@ void main() {
}, },
); );
// TODO(alestiago): Consider refactoring once the following is merged:
// https://github.com/flame-engine/flame/pull/1538
// ignore: public_member_api_docs // ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async { flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockSparkyComputerCubit(); final bloc = _MockSparkyComputerCubit();

@ -10,8 +10,6 @@ import 'package:pinball_flame/pinball_flame.dart';
/// ///
/// It does so by grouping the userData in a [_UserData], and resetting the /// It does so by grouping the userData in a [_UserData], and resetting the
/// parent's userData accordingly. /// parent's userData accordingly.
// TODO(alestiago): Make use of generics to infer the type of the contact.
// https://github.com/VGVentures/pinball/pull/234#discussion_r859182267
class ContactBehavior<T extends BodyComponent> extends Component class ContactBehavior<T extends BodyComponent> extends Component
with ContactCallbacks, ParentIsA<T> { with ContactCallbacks, ParentIsA<T> {
final _fixturesUserData = <Object>{}; final _fixturesUserData = <Object>{};

@ -1,8 +1,5 @@
import 'package:flame/components.dart'; import 'package:flame/components.dart';
// TODO(alestiago): Remove once the following is merged:
// https://github.com/flame-engine/flame/pull/1566
/// A mixin that ensures a parent is of the given type [T]. /// A mixin that ensures a parent is of the given type [T].
mixin ParentIsA<T extends Component> on Component { mixin ParentIsA<T extends Component> on Component {
@override @override

@ -9,8 +9,6 @@ import 'package:flutter/material.dart' hide Animation;
/// {@template flame.widgets.sprite_animation_widget} /// {@template flame.widgets.sprite_animation_widget}
/// A [StatelessWidget] that renders a [SpriteAnimation]. /// A [StatelessWidget] that renders a [SpriteAnimation].
/// {@endtemplate} /// {@endtemplate}
// TODO(arturplaczek): Remove when this PR will be merged.
// https://github.com/flame-engine/flame/pull/1552
class SpriteAnimationWidget extends StatelessWidget { class SpriteAnimationWidget extends StatelessWidget {
/// {@macro flame.widgets.sprite_animation_widget} /// {@macro flame.widgets.sprite_animation_widget}
const SpriteAnimationWidget({ const SpriteAnimationWidget({

@ -10,9 +10,6 @@ class _MockSpriteAnimation extends Mock implements SpriteAnimation {}
class _MockSprite extends Mock implements Sprite {} class _MockSprite extends Mock implements Sprite {}
// TODO(arturplaczek): Remove when this PR will be merged.
// https://github.com/flame-engine/flame/pull/1552
void main() { void main() {
group('PinballSpriteAnimationWidget', () { group('PinballSpriteAnimationWidget', () {
late SpriteAnimationController controller; late SpriteAnimationController controller;

@ -126,7 +126,6 @@ void main() {
await game.pump(behavior, player: player, bloc: bloc); await game.pump(behavior, player: player, bloc: bloc);
}, },
verify: (_, __) async { verify: (_, __) async {
// TODO(erickzanardo): Change when the sound is implemented
verifyNever(() => player.play(any())); verifyNever(() => player.play(any()));
}, },
); );
@ -152,7 +151,6 @@ void main() {
await game.pump(behavior, player: player, bloc: bloc); await game.pump(behavior, player: player, bloc: bloc);
}, },
verify: (_, __) async { verify: (_, __) async {
// TODO(erickzanardo): Change when the sound is implemented
verifyNever(() => player.play(any())); verifyNever(() => player.play(any()));
}, },
); );
@ -178,7 +176,6 @@ void main() {
await game.pump(behavior, player: player, bloc: bloc); await game.pump(behavior, player: player, bloc: bloc);
}, },
verify: (_, __) async { verify: (_, __) async {
// TODO(erickzanardo): Change when the sound is implemented
verifyNever(() => player.play(any())); verifyNever(() => player.play(any()));
}, },
); );

@ -68,9 +68,6 @@ void main() {
}); });
}); });
// TODO(arturplaczek): refactor this test when there is a new version of the
// flame with an onComplete callback in SpriteAnimationWidget
// https://github.com/flame-engine/flame/issues/1543
testWidgets('called onCompleted callback at the end of animation ', testWidgets('called onCompleted callback at the end of animation ',
(tester) async { (tester) async {
final callback = _MockCallback(); final callback = _MockCallback();

@ -135,13 +135,9 @@ void main() {
Stream.value(state), Stream.value(state),
initialState: initialState, initialState: initialState,
); );
await _pumpAppWithWidget(tester); await _pumpAppWithWidget(tester);
await tester.pump(); await tester.pump();
// TODO(arturplaczek): remove magic number once this is merged:
// https://github.com/flame-engine/flame/pull/1564
await Future<void>.delayed(const Duration(seconds: 6)); await Future<void>.delayed(const Duration(seconds: 6));
await expectLater(find.byType(ScoreView), findsOneWidget); await expectLater(find.byType(ScoreView), findsOneWidget);
}); });
}, },

@ -14,8 +14,6 @@ class _MockImages extends Mock implements Images {}
/// Using real images blocks the tests, for this reason we need fake image /// Using real images blocks the tests, for this reason we need fake image
/// everywhere we use [Images.fromCache] or [Images.load]. /// everywhere we use [Images.fromCache] or [Images.load].
/// {@endtemplate} /// {@endtemplate}
// TODO(arturplaczek): need to find for a better solution for loading image
// or use original images.
Future<void> mockFlameImages() async { Future<void> mockFlameImages() async {
final image = await decodeImageFromList(Uint8List.fromList(_fakeImage)); final image = await decodeImageFromList(Uint8List.fromList(_fakeImage));
final images = _MockImages(); final images = _MockImages();

Loading…
Cancel
Save