Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update latest lints and cleanup #361

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include: package:lints/recommended.yaml
include: package:dart_flutter_team_lints/analysis_options.yaml

analyzer:
language:
Expand All @@ -17,6 +17,8 @@ analyzer:
# Does not seem to work correctly with null-safety
cancel_subscriptions: ignore

# too many to cleanup now
lines_longer_than_80_chars: ignore
# Enable for StageXL 2.0
avoid_positional_boolean_parameters: ignore
constant_identifier_names: ignore
Expand All @@ -26,57 +28,41 @@ linter:
- always_put_required_named_parameters_first
- avoid_annotating_with_dynamic
- avoid_bool_literals_in_conditional_expressions
- avoid_catching_errors
- avoid_double_and_int_checks
- avoid_dynamic_calls
- avoid_escaping_inner_quotes
- avoid_field_initializers_in_const_classes
- avoid_js_rounded_ints
- avoid_positional_boolean_parameters
- avoid_private_typedef_functions
- avoid_redundant_argument_values
- avoid_returning_null_for_future
- avoid_returning_this
- avoid_type_to_string
- avoid_types_on_closure_parameters
- avoid_unused_constructor_parameters
- avoid_void_async
- cancel_subscriptions
- close_sinks
- comment_references
- join_return_with_assignment
- leading_newlines_in_multiline_strings
- literal_only_boolean_expressions
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
- no_runtimeType_toString
- noop_primitive_operations
- omit_local_variable_types
- only_throw_errors
- prefer_asserts_in_initializer_lists
- prefer_asserts_with_message
- prefer_const_constructors
- prefer_const_constructors_in_immutables
- prefer_const_declarations
- prefer_constructors_over_static_methods
- prefer_expression_function_bodies
- prefer_if_elements_to_conditional_expressions
- prefer_int_literals
- prefer_mixin
- prefer_single_quotes
- sort_unnamed_constructors_first
- throw_in_finally
- tighten_type_of_initializing_formals
- unawaited_futures
- unnecessary_await_in_return
- unnecessary_lambdas
- unnecessary_null_checks
- unnecessary_parenthesis
- unnecessary_raw_strings
- unnecessary_statements
- use_is_even_rather_than_modulo
- use_named_constants
- use_raw_strings
- use_setters_to_change_properties
- use_string_buffers
- use_super_parameters
2 changes: 1 addition & 1 deletion lib/src/animation.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// Built in transition function (easing functions) can be viewed here:
/// [Transition Functions](http://www.stagexl.org/docs/transitions.html)
///
library stagexl.animation;
library;

import 'dart:async';
import 'dart:math';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/animation/animatable.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.animation;
part of '../animation.dart';

/// This abstract [Animatable] class declares a common interface
/// for other classes that can be added to the [Juggler].
Expand Down
2 changes: 1 addition & 1 deletion lib/src/animation/animation_chain.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.animation;
part of '../animation.dart';

/// The [AnimationChain] class is used to animate multiple [Animatable]s.
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/animation/animation_group.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.animation;
part of '../animation.dart';

/// The [AnimationGroup] class is used to animate multiple Animatables.
/// Those Animatables are animated in parallel and the onComplete
Expand Down
2 changes: 1 addition & 1 deletion lib/src/animation/delayed_call.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.animation;
part of '../animation.dart';

/// The [DelayedCall] class is used to delay the invocation of
/// a function by a given time.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/animation/juggler.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.animation;
part of '../animation.dart';

class _AnimatableLink {
Animatable? animatable;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/animation/transition.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.animation;
part of '../animation.dart';

/// The [TransitionFunction] is the function signature for transitions used
/// in the [Tween] and [Translation] classes. The function takes the ratio
Expand Down
2 changes: 1 addition & 1 deletion lib/src/animation/translation.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.animation;
part of '../animation.dart';

/// The [Translation] class animates a value by continuously calling
/// the [onUpdate] function.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/animation/tween.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.animation;
part of '../animation.dart';

/// Use the [Tween] class to animate the properties of a display object like
/// x, y, scaleX, scaleY, alpha, rotation etc. The animation starts with the
Expand Down
2 changes: 1 addition & 1 deletion lib/src/animation/tween_object.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.animation;
part of '../animation.dart';

/// The abstract base class for [TweenObject2D] and [TweenObject3D].

Expand Down
2 changes: 1 addition & 1 deletion lib/src/animation/tween_property.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.animation;
part of '../animation.dart';

/// The [TweenProperty] class controls the value of a property while
/// the tween is running. This class is returned by the getters of
Expand Down
2 changes: 1 addition & 1 deletion lib/src/animation/tween_property_accessor.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.animation;
part of '../animation.dart';

/// The abstract base class for [TweenPropertyAccessor2D] and
/// [TweenPropertyAccessor3D]. Those accessors are returned by
Expand Down
6 changes: 3 additions & 3 deletions lib/src/display.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
/// please read the wiki article about the basics of StageXL here:
/// [Introducing StageXL](http://www.stagexl.org/docs/wiki-articles.html?article=introduction)
///
library stagexl.display;
library;

import 'dart:async';
import 'dart:collection';
import 'dart:html' as html;
import 'dart:html' show CanvasElement, ImageElement, VideoElement, ImageBitmap;
import 'dart:html' show CanvasElement, ImageBitmap, ImageElement, VideoElement;
import 'dart:math' hide Point, Rectangle;
import 'dart:typed_data';

Expand All @@ -25,8 +25,8 @@ import 'drawing.dart';
import 'engine.dart';
import 'events.dart';
import 'geom.dart';
import 'internal/image_bitmap_loader.dart';
import 'internal/environment.dart' as env;
import 'internal/image_bitmap_loader.dart';
import 'internal/image_loader.dart';
import 'internal/tools.dart';
import 'ui.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/bitmap.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// The Bitmap class represents display objects that represent bitmap images.
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/bitmap_container.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// A fast container for Bitmap instances.
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/bitmap_data.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// The BitmapData class lets you load or create arbitrarily sized transparent
/// or opaque bitmap images and manipulate them in various ways at runtime.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/bitmap_data_channel.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

class BitmapDataChannel {
static const int RED = 1;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/bitmap_data_load_info.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// The BitmapDataLoadInfo creates information about the best matching image
/// file based on the specified image url, the pixelRatios and the current
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/bitmap_data_load_options.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// The BitmapDataLoadOptions class contains different options to configure
/// how BitmapDatas are loaded from the server.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/bitmap_data_update_batch.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// The [BitmapDataUpdateBatch] class provides all the [BitmapData] update
/// methods, but does not automatically update the underlying WebGL texture.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/bitmap_drawable.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

abstract class BitmapDrawable {
void render(RenderState renderState);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/bitmap_filter.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

abstract class BitmapFilter extends RenderFilter {
BitmapFilter clone();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/color_transform.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

class ColorTransform {
final Float32List multipliers = Float32List(4);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/display_object.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// The base class for all objects that can be placed on the display list.
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/display_object_cache.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

class _DisplayObjectCache {
final DisplayObject displayObject;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/display_object_children.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// This class is returned by the [DisplayObjectParent.children] getter.
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/display_object_container.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// The base class for all objects that can serve as display object containers
/// on the display list.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/display_object_container_3d.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// The abstract [DisplayObjectContainer3D] class enables 3D transformations
/// of 2D display objects.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/display_object_parent.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// An abstract class implemented by containers for display objects.
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/interactive_object.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// The [InteractiveObject] class is the abstract base class for all display
/// objects with which the user can interact, using the mouse, keyboard, or
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/mask.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// A [Mask] describes a geometric shape to show only a portion of a
/// [DisplayObject]. Pixels inside of the shape are visible and pixels
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/render_loop.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

class RenderLoop extends RenderLoopBase {
final Juggler _juggler = Juggler();
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/shape.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// This class is used to create lightweight shapes.
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/simple_button.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

enum SimpleButtonState { Up, Over, Down }

Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/sprite.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// The Sprite class is a basic display list building block.
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/sprite_3d.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// The [Sprite3D] class enables 3D transformations of 2D display objects.
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/stage.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// The StageRenderMode defines how often the Stage is rendered by
/// the [RenderLoop] where the Stage is attached to.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/stage_console.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

class StageConsole extends DisplayObject {
final String _fontImage =
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/stage_options.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

/// The options used by the [Stage] constructor to setup the stage.

Expand Down
2 changes: 1 addition & 1 deletion lib/src/display/stage_tools.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display;
part of '../display.dart';

class _MouseButton {
final String mouseDownEventType;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display_ex.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// More advanced display objects for special use cases built on top of
/// the basic display objects.
///
library stagexl.display_ex;
library;

import 'dart:async';
import 'dart:html' show CssStyleDeclaration, Element;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display_ex/canvas_shadow_wrapper.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display_ex;
part of '../display_ex.dart';

/// This class is a replacement for the deprecated shadow property of the
/// DisplayObject class. Please consider to use the DropShadowFilter class
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display_ex/flip_book.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display_ex;
part of '../display_ex.dart';

/// A display object to play sprite sheet animations.
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display_ex/gauge.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display_ex;
part of '../display_ex.dart';

/// A display object to show a section of a [BitmapData] according
/// to the [ratio] property.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display_ex/glass_plate.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display_ex;
part of '../display_ex.dart';

/// An invisible and rectangular display object to catch input events.
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display_ex/html_object.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display_ex;
part of '../display_ex.dart';

/// The HtmlObject adds a regular HTML element to the display list.
/// You can set all the well known DisplayObject properties like x, y, scaleX,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display_ex/mesh.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display_ex;
part of '../display_ex.dart';

/// The [Mesh] class allows free form deformations of a [BitmapData] instance
/// by using triangles to form an arbitrary shape.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display_ex/scale9_bitmap.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display_ex;
part of '../display_ex.dart';

/// The Scale9Bitmap display object divides it's BitmapData into a 3x3 grid
/// defined by the [grid] rectangle. The corners of the grid are rendered
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display_ex/time_gauge.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display_ex;
part of '../display_ex.dart';

/// A [Gauge] specially designed to work in combination with the [Juggler].
///
Expand Down
2 changes: 1 addition & 1 deletion lib/src/display_ex/video_object.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of stagexl.display_ex;
part of '../display_ex.dart';

/// The VideoObject class is a display object to show and control videos.
///
Expand Down
Loading
Loading