Apply suggestions from code review

Co-authored-by: Allison Ryan <77211884+allisonryan0002@users.noreply.github.com>
pull/187/head
Erick 3 years ago committed by GitHub
parent 5ea0c126ad
commit 5dfb171130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -55,7 +55,7 @@ class Backboard extends PositionComponent with HasGameRef {
/// Puts the Backboard in waiting mode, where the scoreboard is shown. /// Puts the Backboard in waiting mode, where the scoreboard is shown.
Future<void> waitingMode() async { Future<void> waitingMode() async {
children.removeWhere((element) => true); children.removeWhere((_) => true);
await add(BackboardWaiting()); await add(BackboardWaiting());
} }
@ -64,7 +64,7 @@ class Backboard extends PositionComponent with HasGameRef {
required int score, required int score,
BackboardOnSubmit? onSubmit, BackboardOnSubmit? onSubmit,
}) async { }) async {
children.removeWhere((element) => true); children.removeWhere((_) => true);
await add( await add(
BackboardGameOver( BackboardGameOver(
score: score, score: score,

@ -5,7 +5,7 @@ import 'package:flutter/services.dart';
typedef KeyHandlerCallback = bool Function(); typedef KeyHandlerCallback = bool Function();
/// {@template keyboard_input_controller} /// {@template keyboard_input_controller}
/// A that receives keyboard input and execute registered methods /// A [Component] that receives keyboard input and executes registered methods.
/// {@endtemplate} /// {@endtemplate}
class KeyboardInputController extends Component with KeyboardHandler { class KeyboardInputController extends Component with KeyboardHandler {
/// {@macro keyboard_input_controller} /// {@macro keyboard_input_controller}

@ -101,7 +101,7 @@ void main() {
String? submitedInitials; String? submitedInitials;
tester.testGameWidget( tester.testGameWidget(
'submits the initial', 'submits the initials',
setUp: (game, tester) async { setUp: (game, tester) async {
final backboard = Backboard.gameOver( final backboard = Backboard.gameOver(
position: Vector2(0, 15), position: Vector2(0, 15),
@ -147,7 +147,7 @@ void main() {
); );
tester.testGameWidget( tester.testGameWidget(
"does nothing when don't have focus", "does nothing when it doesn't have focus",
setUp: (game, tester) async { setUp: (game, tester) async {
await game.ensureAdd( await game.ensureAdd(
BackboardLetterPrompt(position: Vector2.zero()), BackboardLetterPrompt(position: Vector2.zero()),
@ -162,7 +162,7 @@ void main() {
); );
tester.testGameWidget( tester.testGameWidget(
'blinks the promp when have focus', 'blinks the prompt when it has the focus',
setUp: (game, tester) async { setUp: (game, tester) async {
await game.ensureAdd( await game.ensureAdd(
BackboardLetterPrompt(position: Vector2.zero(), hasFocus: true), BackboardLetterPrompt(position: Vector2.zero(), hasFocus: true),

Loading…
Cancel
Save