chore: analysis errors

pull/296/head
RuiAlonso 3 years ago
parent fb0d08ffff
commit 2e2c5ad23a

@ -19,7 +19,7 @@ class AppBlocObserver extends BlocObserver {
@override @override
void onChange(BlocBase bloc, Change change) { void onChange(BlocBase bloc, Change change) {
super.onChange(bloc, change); super.onChange(bloc, change);
//log('onChange(${bloc.runtimeType}, $change)'); log('onChange(${bloc.runtimeType}, $change)');
} }
@override @override

@ -21,11 +21,9 @@ class RampBonusBehavior extends Component
super.onMount(); super.onMount();
parent.bloc.stream.listen((state) { parent.bloc.stream.listen((state) {
print("state.hits ${state.hits}");
final achievedOneMillionPoints = state.hits % 10 == 0; final achievedOneMillionPoints = state.hits % 10 == 0;
if (achievedOneMillionPoints) { if (achievedOneMillionPoints) {
print("achievedOneMillionPoints");
gameRef.read<GameBloc>().add(Scored(points: _points.value)); gameRef.read<GameBloc>().add(Scored(points: _points.value));
gameRef.add( gameRef.add(
ScoreComponent( ScoreComponent(

@ -6,7 +6,7 @@ import 'package:equatable/equatable.dart';
part 'spaceship_ramp_state.dart'; part 'spaceship_ramp_state.dart';
class SpaceshipRampCubit extends Cubit<SpaceshipRampState> { class SpaceshipRampCubit extends Cubit<SpaceshipRampState> {
SpaceshipRampCubit() : super(SpaceshipRampState.initial()); SpaceshipRampCubit() : super(const SpaceshipRampState.initial());
void onInside() { void onInside() {
emit( emit(

@ -7,7 +7,7 @@ class SpaceshipRampState extends Equatable {
required this.hits, required this.hits,
}) : assert(hits >= 0, "Hits can't be negative"); }) : assert(hits >= 0, "Hits can't be negative");
SpaceshipRampState.initial() : this(hits: 0); const SpaceshipRampState.initial() : this(hits: 0);
final int hits; final int hits;

@ -64,7 +64,7 @@ void main() {
whenListen( whenListen(
bloc, bloc,
const Stream<SpaceshipRampState>.empty(), const Stream<SpaceshipRampState>.empty(),
initialState: SpaceshipRampState.initial(), initialState: const SpaceshipRampState.initial(),
); );
final rampSensor = RampScoringSensor.test(); final rampSensor = RampScoringSensor.test();
@ -92,7 +92,7 @@ void main() {
whenListen( whenListen(
bloc, bloc,
const Stream<SpaceshipRampState>.empty(), const Stream<SpaceshipRampState>.empty(),
initialState: SpaceshipRampState.initial(), initialState: const SpaceshipRampState.initial(),
); );
final rampSensor = RampScoringSensor.test(); final rampSensor = RampScoringSensor.test();

@ -1,6 +1,5 @@
// ignore_for_file: prefer_const_constructors // ignore_for_file: prefer_const_constructors
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:pinball_components/src/components/components.dart'; import 'package:pinball_components/src/components/components.dart';
@ -76,8 +75,6 @@ void main() {
'copies correctly ' 'copies correctly '
'when all arguments specified', 'when all arguments specified',
() { () {
final ball = Ball(baseColor: Colors.black);
const rampState = SpaceshipRampState( const rampState = SpaceshipRampState(
hits: 0, hits: 0,
); );

@ -27,7 +27,7 @@ void main() {
whenListen( whenListen(
bloc, bloc,
const Stream<SpaceshipRampState>.empty(), const Stream<SpaceshipRampState>.empty(),
initialState: SpaceshipRampState.initial(), initialState: const SpaceshipRampState.initial(),
); );
when(bloc.close).thenAnswer((_) async {}); when(bloc.close).thenAnswer((_) async {});

@ -214,7 +214,7 @@ void main() {
whenListen( whenListen(
bloc, bloc,
const Stream<SpaceshipRampState>.empty(), const Stream<SpaceshipRampState>.empty(),
initialState: SpaceshipRampState.initial(), initialState: const SpaceshipRampState.initial(),
); );
when(bloc.close).thenAnswer((_) async {}); when(bloc.close).thenAnswer((_) async {});

Loading…
Cancel
Save