You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pinball/lib/leaderboard/bloc/leaderboard_event.dart

37 lines
965 B

feat: leaderboard bloc (#57) * feat: added bloc for request ranking * feat: added empty repository * test: tests for bloc * refactor: adapt bloc events and models to what leaderboard repository has * feat: extension to convert between CharacterTheme and CharacterType * doc: documented leaderboard bloc * refactor: merge with leaderboard_repository * doc: completed doc * chore: unused import, trailing comma * chore: removed ios files * Update lib/leaderboard/bloc/leaderboard_bloc.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update lib/leaderboard/bloc/leaderboard_bloc.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * refactor: remove props from abstract event class to force childs to implement it * Update lib/leaderboard/bloc/leaderboard_bloc.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_event.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_event.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_event.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * chore: ignore doc for file * chore: wrong reference at doc * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * refactor: leaderboard state initial method Co-authored-by: Erick <erickzanardoo@gmail.com> Co-authored-by: Alejandro Santiago <dev@alestiago.com>
3 years ago
part of 'leaderboard_bloc.dart';
/// {@template leaderboard_event}
/// Represents the events available for [LeaderboardBloc].
/// {endtemplate}
abstract class LeaderboardEvent extends Equatable {
/// {@macro leaderboard_event}
const LeaderboardEvent();
}
/// {@template top_10_fetched}
/// Request the top 10 [LeaderboardEntryData]s.
feat: leaderboard bloc (#57) * feat: added bloc for request ranking * feat: added empty repository * test: tests for bloc * refactor: adapt bloc events and models to what leaderboard repository has * feat: extension to convert between CharacterTheme and CharacterType * doc: documented leaderboard bloc * refactor: merge with leaderboard_repository * doc: completed doc * chore: unused import, trailing comma * chore: removed ios files * Update lib/leaderboard/bloc/leaderboard_bloc.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update lib/leaderboard/bloc/leaderboard_bloc.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * refactor: remove props from abstract event class to force childs to implement it * Update lib/leaderboard/bloc/leaderboard_bloc.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_event.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_event.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_event.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * chore: ignore doc for file * chore: wrong reference at doc * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * refactor: leaderboard state initial method Co-authored-by: Erick <erickzanardoo@gmail.com> Co-authored-by: Alejandro Santiago <dev@alestiago.com>
3 years ago
/// {endtemplate}
class Top10Fetched extends LeaderboardEvent {
/// {@macro top_10_fetched}
const Top10Fetched();
@override
List<Object?> get props => [];
}
/// {@template leaderboard_entry_added}
/// Writes a new [LeaderboardEntryData].
feat: leaderboard bloc (#57) * feat: added bloc for request ranking * feat: added empty repository * test: tests for bloc * refactor: adapt bloc events and models to what leaderboard repository has * feat: extension to convert between CharacterTheme and CharacterType * doc: documented leaderboard bloc * refactor: merge with leaderboard_repository * doc: completed doc * chore: unused import, trailing comma * chore: removed ios files * Update lib/leaderboard/bloc/leaderboard_bloc.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update lib/leaderboard/bloc/leaderboard_bloc.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * refactor: remove props from abstract event class to force childs to implement it * Update lib/leaderboard/bloc/leaderboard_bloc.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_event.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_event.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_event.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * chore: ignore doc for file * chore: wrong reference at doc * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * refactor: leaderboard state initial method Co-authored-by: Erick <erickzanardoo@gmail.com> Co-authored-by: Alejandro Santiago <dev@alestiago.com>
3 years ago
///
/// Should be added when a player finishes a game.
/// {endtemplate}
class LeaderboardEntryAdded extends LeaderboardEvent {
/// {@macro leaderboard_entry_added}
const LeaderboardEntryAdded({required this.entry});
/// [LeaderboardEntryData] to be written to the remote storage.
final LeaderboardEntryData entry;
feat: leaderboard bloc (#57) * feat: added bloc for request ranking * feat: added empty repository * test: tests for bloc * refactor: adapt bloc events and models to what leaderboard repository has * feat: extension to convert between CharacterTheme and CharacterType * doc: documented leaderboard bloc * refactor: merge with leaderboard_repository * doc: completed doc * chore: unused import, trailing comma * chore: removed ios files * Update lib/leaderboard/bloc/leaderboard_bloc.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * Update lib/leaderboard/bloc/leaderboard_bloc.dart Co-authored-by: Erick <erickzanardoo@gmail.com> * refactor: remove props from abstract event class to force childs to implement it * Update lib/leaderboard/bloc/leaderboard_bloc.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_event.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_event.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_event.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * chore: ignore doc for file * chore: wrong reference at doc * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * Update lib/leaderboard/bloc/leaderboard_state.dart Co-authored-by: Alejandro Santiago <dev@alestiago.com> * refactor: leaderboard state initial method Co-authored-by: Erick <erickzanardoo@gmail.com> Co-authored-by: Alejandro Santiago <dev@alestiago.com>
3 years ago
@override
List<Object?> get props => [entry];
}