chore: cleanup public api docs annotations (#382)

pull/383/head
Jorge Coca 3 years ago committed by GitHub
parent b8f26b81de
commit 4a3e9f7abc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,3 +2,6 @@ include: package:very_good_analysis/analysis_options.2.4.0.yaml
analyzer:
exclude:
- lib/**/*.gen.dart
linter:
rules:
public_member_api_docs: false

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:authentication_repository/authentication_repository.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'dart:async';
import 'dart:developer';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_audio/pinball_audio.dart';
import 'package:pinball_flame/pinball_flame.dart';

@ -1,4 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'dart:math' as math;
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'game_bloc.dart';
@immutable

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'game_bloc.dart';
/// Defines bonuses that a player can gain during a PinballGame.

@ -1,4 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'dart:async';
import 'package:flame/components.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame/game.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'dart:async';
import 'package:flutter/material.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flutter/widgets.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:pinball_theme/pinball_theme.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'character_theme_cubit.dart';
class CharacterThemeState extends Equatable {

@ -2,3 +2,6 @@ include: package:very_good_analysis/analysis_options.2.4.0.yaml
analyzer:
exclude:
- lib/**/*.gen.dart
linter:
rules:
public_member_api_docs: false

@ -103,7 +103,6 @@ class AndroidBumper extends BodyComponent with InitialPosition, ZIndex {
final double _minorRadius;
// ignore: public_member_api_docs
final AndroidBumperCubit bloc;
@override

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
part 'android_bumper_state.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'android_bumper_cubit.dart';
enum AndroidBumperState {

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'dart:async';
import 'dart:math' as math;

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
part 'android_spaceship_state.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'android_spaceship_cubit.dart';
enum AndroidSpaceshipState {

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:pinball_theme/pinball_theme.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'ball_cubit.dart';
class BallState extends Equatable {

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame/components.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';

@ -43,7 +43,6 @@ class ChromeDino extends BodyComponent
required this.bloc,
});
// ignore: public_member_api_docs
final ChromeDinoCubit bloc;
/// Angle to rotate the dino up or down from the starting horizontal position.

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:pinball_components/pinball_components.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'chrome_dino_cubit.dart';
enum ChromeDinoStatus {

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
part 'dash_nest_bumper_state.dart';

@ -98,7 +98,6 @@ class DashNestBumper extends BodyComponent with InitialPosition {
final double _majorRadius;
final double _minorRadius;
// ignore: public_member_api_docs
final DashNestBumperCubit bloc;
@override

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame/components.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
part 'google_letter_state.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'google_letter_cubit.dart';
enum GoogleLetterState {

@ -73,7 +73,6 @@ class GoogleLetter extends BodyComponent with InitialPosition {
required this.bloc,
});
// ignore: public_member_api_docs
final GoogleLetterCubit bloc;
@override

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
part 'kicker_state.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'kicker_cubit.dart';
enum KickerState {

@ -57,7 +57,6 @@ class Kicker extends BodyComponent with InitialPosition {
required BoardSide side,
}) : _side = side;
// ignore: public_member_api_docs
final KickerCubit bloc;
@override
@ -172,7 +171,6 @@ class _KickerSpriteGroupComponent extends SpriteGroupComponent<KickerState>
@override
Future<void> onLoad() async {
await super.onLoad();
// ignore: public_member_api_docs
parent.bloc.stream.listen((state) => current = state);
final sprites = {

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';

@ -1,5 +1,3 @@
// ignore_for_file: avoid_renaming_method_parameters, public_member_api_docs
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_components/src/components/layer_sensor/behaviors/layer_filtering_behavior.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';

@ -1,8 +1,5 @@
// ignore_for_file: comment_references, public_member_api_docs
part of 'multiball_cubit.dart';
/// Indicates the different sprite states for [MultiballSpriteGroupComponent].
enum MultiballLightState {
lit,
dimmed,

@ -80,7 +80,6 @@ class Multiball extends Component {
required this.bloc,
});
// ignore: public_member_api_docs
final MultiballCubit bloc;
@override

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:pinball_components/pinball_components.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'multiplier_cubit.dart';
enum MultiplierSpriteState {

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame/components.dart';
import 'package:flutter/material.dart';
import 'package:pinball_components/gen/assets.gen.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'dart:async';
import 'package:flame/components.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:geometry/geometry.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame/extensions.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:geometry/geometry.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame/extensions.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:geometry/geometry.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
part 'signpost_state.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'signpost_cubit.dart';
enum SignpostState {

@ -41,7 +41,6 @@ class Signpost extends BodyComponent with InitialPosition {
required this.bloc,
});
// ignore: public_member_api_docs
final SignpostCubit bloc;
@override

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame/components.dart';
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'skill_shot_cubit.dart';
enum SkillShotSpriteState {

@ -43,7 +43,6 @@ class SkillShot extends BodyComponent with ZIndex {
required this.bloc,
});
// ignore: public_member_api_docs
final SkillShotCubit bloc;
@override

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'spaceship_ramp_cubit.dart';
class SpaceshipRampState extends Equatable {

@ -66,7 +66,6 @@ class SpaceshipRamp extends Component {
required this.bloc,
}) : super();
// ignore: public_member_api_docs
final SpaceshipRampCubit bloc;
@override

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
part 'sparky_bumper_state.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'sparky_bumper_cubit.dart';
enum SparkyBumperState {

@ -102,7 +102,6 @@ class SparkyBumper extends BodyComponent with InitialPosition, ZIndex {
final double _majorRadius;
final double _minorRadius;
// ignore: public_member_api_docs
final SparkyBumperCubit bloc;
@override
@ -148,7 +147,6 @@ class _SparkyBumperSpriteGroupComponent
@override
Future<void> onLoad() async {
await super.onLoad();
// ignore: public_member_api_docs
parent.bloc.stream.listen((state) => current = state);
final sprites = {

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
part 'sparky_computer_state.dart';

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
part of 'sparky_computer_cubit.dart';
enum SparkyComputerState {

@ -37,7 +37,6 @@ class SparkyComputer extends BodyComponent {
Iterable<Component>? children,
}) : super(children: children);
// ignore: public_member_api_docs
final SparkyComputerCubit bloc;
@override

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
/// Z-Indexes for the component rendering order in the pinball game.
abstract class ZIndexes {
static const _base = 0;

@ -44,7 +44,6 @@ void main() {
expect(game.contains(androidBumper), isTrue);
});
// ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockAndroidBumperCubit();
whenListen(

@ -70,7 +70,6 @@ void main() {
},
);
// ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockAndroidSpaceshipCubit();
whenListen(

@ -71,7 +71,6 @@ void main() {
},
);
// ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockChromeDinoCubit();
whenListen(

@ -46,7 +46,6 @@ void main() {
expect(game.contains(bumper), isTrue);
});
// ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockDashNestBumperCubit();
whenListen(

@ -102,7 +102,6 @@ void main() {
expect(() => GoogleLetter(6), throwsA(isA<RangeError>()));
});
// ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockGoogleLetterCubit();
whenListen(

@ -61,7 +61,6 @@ void main() {
},
);
// ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockKickerCubit();
whenListen(

@ -29,7 +29,6 @@ void main() {
expect(game.contains(skillShot), isTrue);
});
// ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockSkillShotCubit();
whenListen(

@ -44,7 +44,6 @@ void main() {
expect(game.contains(sparkyBumper), isTrue);
});
// ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockSparkyBumperCubit();
whenListen(

@ -47,7 +47,6 @@ void main() {
},
);
// ignore: public_member_api_docs
flameTester.test('closes bloc when removed', (game) async {
final bloc = _MockSparkyComputerCubit();
whenListen(

@ -1,9 +1,11 @@
// ignore_for_file: public_member_api_docs
import 'dart:typed_data';
import 'dart:ui';
/// {@template canvas_wrapper}
/// Custom [Canvas] implementation for Pinball
/// {@endtemplate}
class CanvasWrapper implements Canvas {
/// [Canvas] used for painting operations
late Canvas canvas;
@override

@ -1,21 +1,28 @@
// ignore_for_file: public_member_api_docs
import 'package:bloc/bloc.dart';
import 'package:flame/components.dart';
import 'package:flame_bloc/flame_bloc.dart';
/// {@template flame_provider}
/// Provider-style component, similar to Provider in Flutter, but used to
/// retrieve [Component] objects previously provided
/// {@endtemplate}
class FlameProvider<T> extends Component {
//// {@macro flame_provider}
FlameProvider.value(
this.provider, {
Iterable<Component>? children,
}) : super(
children: children,
);
}) : super(children: children);
/// The object that needs to be provided
final T provider;
}
//// {@template multi_flame_provider}
/// MultiProvider-style component, similar to MultiProvider in Flutter,
/// but used to retrieve more than one [Component] object previously provided
/// {@endtemplate}
class MultiFlameProvider extends Component {
/// {@macro multi_flame_provider}
MultiFlameProvider({
required List<FlameProvider<dynamic>> providers,
Iterable<Component>? children,
@ -54,7 +61,9 @@ class MultiFlameProvider extends Component {
}
}
/// Extended API on [Component]
extension ReadFlameProvider on Component {
/// Retrieve an object of type [T] that was previously provided
T readProvider<T>() {
final providers = ancestors().whereType<FlameProvider<T>>();
assert(
@ -64,9 +73,8 @@ extension ReadFlameProvider on Component {
return providers.first.provider;
}
}
extension ReadFlameBlocProvider on Component {
/// Retrieve a bloc [B] with state [S] previously provided
B readBloc<B extends BlocBase<S>, S>() {
final providers = ancestors().whereType<FlameBlocProvider<B, S>>();
assert(

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'dart:math';
import 'package:flame/components.dart';
@ -20,6 +18,7 @@ class SpriteAnimationWidget extends StatelessWidget {
/// The positioning [Anchor].
final Anchor anchor;
/// Controller in charge of the sprite animations
final SpriteAnimationController controller;
@override
@ -38,7 +37,11 @@ class SpriteAnimationWidget extends StatelessWidget {
}
}
/// {@template sprite_animation_controller}
/// Custom [AnimationController] that manages sprite assets
/// {@endtemplate}
class SpriteAnimationController extends AnimationController {
/// {@macro sprite_animation_controller}
SpriteAnimationController({
required TickerProvider vsync,
required this.animation,
@ -46,6 +49,7 @@ class SpriteAnimationController extends AnimationController {
duration = Duration(seconds: animation.totalDuration().ceil());
}
/// [SpriteAnimation] associated to this controller
final SpriteAnimation animation;
double? _lastUpdated;
@ -61,7 +65,11 @@ class SpriteAnimationController extends AnimationController {
}
}
/// {@template sprite_painter}
/// [CustomPainter] specialized in [Sprite] assets.
/// {@endtemplate}
class SpritePainter extends CustomPainter {
/// {@macro sprite_painter}
SpritePainter(
this._sprite,
this._anchor, {

@ -1,17 +1,40 @@
// ignore_for_file: public_member_api_docs
import 'package:flutter/material.dart';
/// Colors used in the application
abstract class PinballColors {
/// Color: 0xFFFFFFFF
static const Color white = Color(0xFFFFFFFF);
/// Color: 0xFF0C32A4
static const Color darkBlue = Color(0xFF0C32A4);
/// Color: 0xFFFFEE02
static const Color yellow = Color(0xFFFFEE02);
/// Color: 0xFFE5AB05
static const Color orange = Color(0xFFE5AB05);
/// Color: 0xFFF03939
static const Color red = Color(0xFFF03939);
/// Color: 0xFF4B94F6
static const Color blue = Color(0xFF4B94F6);
/// Color: 0x00000000
static const Color transparent = Color(0x00000000);
/// Color: 0xFFE33B2D
static const Color loadingDarkRed = Color(0xFFE33B2D);
/// Color: 0xFFEC5E2B
static const Color loadingLightRed = Color(0xFFEC5E2B);
/// Color: 0xFF4087F8
static const Color loadingDarkBlue = Color(0xFF4087F8);
/// Color: 0xFF6CCAE4
static const Color loadingLightBlue = Color(0xFF6CCAE4);
/// Color: 0xFF274E54
static const Color crtBackground = Color(0xFF274E54);
}

@ -1,5 +1,3 @@
// ignore_for_file: public_member_api_docs
import 'package:flutter/widgets.dart';
import 'package:pinball_ui/gen/fonts.gen.dart';
import 'package:pinball_ui/pinball_ui.dart';
@ -7,7 +5,9 @@ import 'package:pinball_ui/pinball_ui.dart';
const _fontPackage = 'pinball_components';
const _primaryFontFamily = FontFamily.pixeloidSans;
/// Different [TextStyle] used in the game
abstract class PinballTextStyle {
/// Font size: 28 | Color: white
static const headline1 = TextStyle(
fontSize: 28,
package: _fontPackage,
@ -15,6 +15,7 @@ abstract class PinballTextStyle {
color: PinballColors.white,
);
/// Font size: 24 | Color: white
static const headline2 = TextStyle(
fontSize: 24,
package: _fontPackage,
@ -22,6 +23,7 @@ abstract class PinballTextStyle {
color: PinballColors.white,
);
/// Font size: 20 | Color: darkBlue
static const headline3 = TextStyle(
color: PinballColors.darkBlue,
fontSize: 20,
@ -30,6 +32,7 @@ abstract class PinballTextStyle {
fontWeight: FontWeight.bold,
);
/// Font size: 16 | Color: white
static const headline4 = TextStyle(
color: PinballColors.white,
fontSize: 16,
@ -37,6 +40,7 @@ abstract class PinballTextStyle {
fontFamily: _primaryFontFamily,
);
/// Font size: 214| Color: white
static const headline5 = TextStyle(
color: PinballColors.white,
fontSize: 14,
@ -44,13 +48,7 @@ abstract class PinballTextStyle {
fontFamily: _primaryFontFamily,
);
static const subtitle2 = TextStyle(
color: PinballColors.white,
fontSize: 16,
package: _fontPackage,
fontFamily: _primaryFontFamily,
);
/// Font size: 12 | Color: white
static const subtitle1 = TextStyle(
fontSize: 12,
fontFamily: _primaryFontFamily,

@ -18,7 +18,6 @@ class PinballTheme {
headline4: PinballTextStyle.headline4,
headline5: PinballTextStyle.headline5,
subtitle1: PinballTextStyle.subtitle1,
subtitle2: PinballTextStyle.subtitle2,
);
}
}

@ -31,11 +31,5 @@ void main() {
expect(style.fontSize, 12);
expect(style.color, PinballColors.yellow);
});
test('subtitle2 has fontSize 16 and white color', () {
const style = PinballTextStyle.subtitle2;
expect(style.fontSize, 16);
expect(style.color, PinballColors.white);
});
});
}

@ -78,21 +78,6 @@ void main() {
PinballTextStyle.subtitle1.fontFamily,
);
});
test('subtitle2 matches PinballTextStyle#subtitle2', () {
expect(
PinballTheme.standard.textTheme.subtitle2!.fontSize,
PinballTextStyle.subtitle2.fontSize,
);
expect(
PinballTheme.standard.textTheme.subtitle2!.color,
PinballTextStyle.subtitle2.color,
);
expect(
PinballTheme.standard.textTheme.subtitle2!.fontFamily,
PinballTextStyle.subtitle2.fontFamily,
);
});
});
});
}

Loading…
Cancel
Save