From a85c97d879540a2e1329c2e5fb55e4447ca88cd4 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Tue, 16 Jan 2024 13:22:02 -0800 Subject: [PATCH] Update latest lints and cleanup (#361) --- analysis_options.yaml | 20 +++---------------- lib/src/animation.dart | 2 +- lib/src/animation/animatable.dart | 2 +- lib/src/animation/animation_chain.dart | 2 +- lib/src/animation/animation_group.dart | 2 +- lib/src/animation/delayed_call.dart | 2 +- lib/src/animation/juggler.dart | 2 +- lib/src/animation/transition.dart | 2 +- lib/src/animation/translation.dart | 2 +- lib/src/animation/tween.dart | 2 +- lib/src/animation/tween_object.dart | 2 +- lib/src/animation/tween_property.dart | 2 +- .../animation/tween_property_accessor.dart | 2 +- lib/src/display.dart | 6 +++--- lib/src/display/bitmap.dart | 2 +- lib/src/display/bitmap_container.dart | 2 +- lib/src/display/bitmap_data.dart | 2 +- lib/src/display/bitmap_data_channel.dart | 2 +- lib/src/display/bitmap_data_load_info.dart | 2 +- lib/src/display/bitmap_data_load_options.dart | 2 +- lib/src/display/bitmap_data_update_batch.dart | 2 +- lib/src/display/bitmap_drawable.dart | 2 +- lib/src/display/bitmap_filter.dart | 2 +- lib/src/display/color_transform.dart | 2 +- lib/src/display/display_object.dart | 2 +- lib/src/display/display_object_cache.dart | 2 +- lib/src/display/display_object_children.dart | 2 +- lib/src/display/display_object_container.dart | 2 +- .../display/display_object_container_3d.dart | 2 +- lib/src/display/display_object_parent.dart | 2 +- lib/src/display/interactive_object.dart | 2 +- lib/src/display/mask.dart | 2 +- lib/src/display/render_loop.dart | 2 +- lib/src/display/shape.dart | 2 +- lib/src/display/simple_button.dart | 2 +- lib/src/display/sprite.dart | 2 +- lib/src/display/sprite_3d.dart | 2 +- lib/src/display/stage.dart | 2 +- lib/src/display/stage_console.dart | 2 +- lib/src/display/stage_options.dart | 2 +- lib/src/display/stage_tools.dart | 2 +- lib/src/display_ex.dart | 2 +- lib/src/display_ex/canvas_shadow_wrapper.dart | 2 +- lib/src/display_ex/flip_book.dart | 2 +- lib/src/display_ex/gauge.dart | 2 +- lib/src/display_ex/glass_plate.dart | 2 +- lib/src/display_ex/html_object.dart | 2 +- lib/src/display_ex/mesh.dart | 2 +- lib/src/display_ex/scale9_bitmap.dart | 2 +- lib/src/display_ex/time_gauge.dart | 2 +- lib/src/display_ex/video_object.dart | 2 +- lib/src/display_ex/viewport_container.dart | 2 +- lib/src/display_ex/warp.dart | 2 +- lib/src/drawing.dart | 6 ++---- .../commands/graphics_command_arc.dart | 2 +- .../graphics_command_arc_elliptical.dart | 2 +- .../commands/graphics_command_arc_to.dart | 2 +- .../commands/graphics_command_begin_path.dart | 2 +- .../graphics_command_bezier_curve_to.dart | 2 +- .../commands/graphics_command_circle.dart | 2 +- .../commands/graphics_command_close_path.dart | 2 +- .../commands/graphics_command_decode.dart | 2 +- .../commands/graphics_command_ellipse.dart | 2 +- .../commands/graphics_command_fill.dart | 2 +- .../commands/graphics_command_fill_color.dart | 2 +- .../graphics_command_fill_gradient.dart | 2 +- .../graphics_command_fill_pattern.dart | 2 +- .../commands/graphics_command_line_to.dart | 2 +- .../commands/graphics_command_move_to.dart | 2 +- .../graphics_command_quadratic_curve_to.dart | 2 +- .../commands/graphics_command_rect.dart | 2 +- .../commands/graphics_command_rect_round.dart | 2 +- .../commands/graphics_command_stroke.dart | 2 +- .../graphics_command_stroke_color.dart | 2 +- .../graphics_command_stroke_gradient.dart | 2 +- .../graphics_command_stroke_pattern.dart | 2 +- lib/src/drawing/graphics.dart | 2 +- lib/src/drawing/graphics_command.dart | 3 +-- lib/src/drawing/graphics_context.dart | 2 +- lib/src/drawing/graphics_enums.dart | 2 +- lib/src/drawing/graphics_gradient.dart | 2 +- .../drawing/graphics_gradient_program.dart | 2 +- lib/src/drawing/graphics_pattern.dart | 2 +- .../drawing/internal/graphics_command.dart | 2 +- .../internal/graphics_context_base.dart | 2 +- .../internal/graphics_context_bounds.dart | 2 +- .../internal/graphics_context_canvas.dart | 2 +- .../internal/graphics_context_compiler.dart | 2 +- .../internal/graphics_context_hittest.dart | 2 +- .../internal/graphics_context_render.dart | 2 +- lib/src/drawing/internal/graphics_mesh.dart | 2 +- .../internal/graphics_mesh_segment.dart | 2 +- lib/src/drawing/internal/graphics_path.dart | 2 +- .../internal/graphics_path_segment.dart | 2 +- lib/src/drawing/internal/graphics_stroke.dart | 2 +- .../internal/graphics_stroke_segment.dart | 2 +- lib/src/engine.dart | 12 +++++------ lib/src/engine/blend_mode.dart | 2 +- lib/src/engine/render_buffer_index.dart | 2 +- lib/src/engine/render_buffer_vertex.dart | 2 +- lib/src/engine/render_context.dart | 2 +- lib/src/engine/render_context_canvas.dart | 10 +++++----- lib/src/engine/render_context_webgl.dart | 2 +- lib/src/engine/render_filter.dart | 2 +- lib/src/engine/render_frame_buffer.dart | 2 +- lib/src/engine/render_loop_base.dart | 2 +- lib/src/engine/render_mask.dart | 2 +- lib/src/engine/render_object.dart | 2 +- lib/src/engine/render_program.dart | 2 +- lib/src/engine/render_program_simple.dart | 2 +- lib/src/engine/render_program_tinted.dart | 2 +- lib/src/engine/render_program_triangle.dart | 2 +- lib/src/engine/render_state.dart | 2 +- lib/src/engine/render_statistics.dart | 2 +- lib/src/engine/render_stencil_buffer.dart | 2 +- lib/src/engine/render_texture.dart | 4 ++-- lib/src/engine/render_texture_filtering.dart | 2 +- lib/src/engine/render_texture_quad.dart | 2 +- lib/src/engine/render_texture_wrapping.dart | 2 +- lib/src/errors.dart | 2 -- lib/src/events.dart | 4 ++-- lib/src/events/broadcast_event.dart | 2 +- lib/src/events/event.dart | 2 +- lib/src/events/event_dispatcher.dart | 2 +- lib/src/events/event_phase.dart | 2 +- lib/src/events/event_stream.dart | 2 +- lib/src/events/event_stream_provider.dart | 2 +- lib/src/events/event_stream_subscription.dart | 5 +++-- lib/src/events/input_event.dart | 2 +- lib/src/events/key_location.dart | 2 +- lib/src/events/keyboard_event.dart | 2 +- lib/src/events/mouse_event.dart | 2 +- lib/src/events/text_event.dart | 2 +- lib/src/events/touch_event.dart | 2 +- lib/src/filters.dart | 3 +-- lib/src/filters/alpha_mask_filter.dart | 2 -- lib/src/filters/blur_filter.dart | 2 -- lib/src/filters/chroma_key_filter.dart | 2 -- lib/src/filters/color_matrix_filter.dart | 2 -- lib/src/filters/displacement_map_filter.dart | 2 -- lib/src/filters/drop_shadow_filter.dart | 2 -- lib/src/filters/flatten_filter.dart | 2 -- lib/src/filters/fxaa_filter.dart | 2 -- lib/src/filters/glow_filter.dart | 2 -- lib/src/filters/normal_map_filter.dart | 2 -- lib/src/filters/tint_filter.dart | 2 -- lib/src/geom.dart | 2 +- lib/src/geom/circle.dart | 2 -- lib/src/geom/matrix.dart | 2 -- lib/src/geom/matrix_3d.dart | 2 -- lib/src/geom/perspective_projection.dart | 2 -- lib/src/geom/point.dart | 2 -- lib/src/geom/polygon.dart | 2 -- lib/src/geom/rectangle.dart | 2 -- lib/src/geom/vector.dart | 2 -- lib/src/internal/audio_loader.dart | 4 +--- lib/src/internal/environment.dart | 4 +--- lib/src/internal/filter_helpers.dart | 2 -- lib/src/internal/image_bitmap_loader.dart | 8 +++----- lib/src/internal/image_loader.dart | 2 -- lib/src/internal/jenkins_hash.dart | 2 -- lib/src/internal/shared_cache.dart | 2 -- lib/src/internal/tools.dart | 2 -- lib/src/internal/video_loader.dart | 4 +--- lib/src/media.dart | 4 ++-- .../implementation/audio_element_mixer.dart | 2 +- .../implementation/audio_element_sound.dart | 2 +- .../audio_element_sound_channel.dart | 2 +- lib/src/media/implementation/mock_sound.dart | 2 +- .../implementation/mock_sound_channel.dart | 2 +- .../implementation/web_audio_api_mixer.dart | 2 +- .../implementation/web_audio_api_sound.dart | 2 +- .../web_audio_api_sound_channel.dart | 2 +- lib/src/media/sound.dart | 2 +- lib/src/media/sound_channel.dart | 2 +- lib/src/media/sound_engine.dart | 2 +- lib/src/media/sound_load_options.dart | 2 +- lib/src/media/sound_mixer.dart | 2 +- lib/src/media/sound_transform.dart | 2 +- lib/src/media/video.dart | 2 +- lib/src/media/video_load_options.dart | 2 +- lib/src/resources.dart | 2 +- lib/src/resources/resource_manager.dart | 2 +- .../resources/resource_manager_resource.dart | 4 ++-- lib/src/resources/sound_sprite.dart | 2 +- lib/src/resources/sound_sprite_segment.dart | 2 +- lib/src/resources/sprite_sheet.dart | 2 +- lib/src/resources/texture_atlas.dart | 2 +- lib/src/resources/texture_atlas_format.dart | 2 +- .../resources/texture_atlas_format_json.dart | 2 +- .../texture_atlas_format_libgdx.dart | 2 +- .../texture_atlas_format_starling_json.dart | 2 +- .../texture_atlas_format_starling_xml.dart | 2 +- lib/src/resources/texture_atlas_frame.dart | 2 +- lib/src/resources/texture_atlas_loader.dart | 2 +- lib/src/text.dart | 4 ++-- lib/src/text/font_style_metrics.dart | 2 +- lib/src/text/text_field.dart | 2 +- lib/src/text/text_field_auto_size.dart | 2 +- lib/src/text/text_field_type.dart | 2 +- lib/src/text/text_format.dart | 2 +- lib/src/text/text_format_align.dart | 2 +- lib/src/text/text_line_metrics.dart | 2 +- lib/src/ui.dart | 3 +-- lib/src/ui/align.dart | 2 -- lib/src/ui/color.dart | 3 +-- lib/src/ui/mouse.dart | 2 -- lib/stagexl.dart | 2 -- pubspec.yaml | 4 ++-- test/display/bitmap_data_test.dart | 2 +- test/engine/render_texture_quad_test.dart | 3 ++- test/events/events_test.dart | 2 +- test/geom/matrix_test.dart | 3 ++- test/geom/point_test.dart | 2 +- test/geom/rectangle_test.dart | 2 +- test/geom/vector_test.dart | 3 ++- test/util/image_bitmap_test.dart | 2 +- test/util/spritesheet_test.dart | 2 +- 218 files changed, 217 insertions(+), 297 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 37668866..ae1b7b5c 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,4 +1,4 @@ -include: package:lints/recommended.yaml +include: package:dart_flutter_team_lints/analysis_options.yaml analyzer: language: @@ -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 @@ -26,16 +28,13 @@ 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 @@ -43,7 +42,6 @@ linter: - avoid_void_async - cancel_subscriptions - close_sinks - - comment_references - join_return_with_assignment - leading_newlines_in_multiline_strings - literal_only_boolean_expressions @@ -51,11 +49,7 @@ linter: - 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 @@ -63,20 +57,12 @@ linter: - 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 diff --git a/lib/src/animation.dart b/lib/src/animation.dart index 480531c8..973acd45 100644 --- a/lib/src/animation.dart +++ b/lib/src/animation.dart @@ -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'; diff --git a/lib/src/animation/animatable.dart b/lib/src/animation/animatable.dart index 9848db39..ce925704 100644 --- a/lib/src/animation/animatable.dart +++ b/lib/src/animation/animatable.dart @@ -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]. diff --git a/lib/src/animation/animation_chain.dart b/lib/src/animation/animation_chain.dart index 85618229..85bf4953 100644 --- a/lib/src/animation/animation_chain.dart +++ b/lib/src/animation/animation_chain.dart @@ -1,4 +1,4 @@ -part of stagexl.animation; +part of '../animation.dart'; /// The [AnimationChain] class is used to animate multiple [Animatable]s. /// diff --git a/lib/src/animation/animation_group.dart b/lib/src/animation/animation_group.dart index 72ee04ba..986a1a0d 100644 --- a/lib/src/animation/animation_group.dart +++ b/lib/src/animation/animation_group.dart @@ -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 diff --git a/lib/src/animation/delayed_call.dart b/lib/src/animation/delayed_call.dart index 2b87a6ed..2e7248eb 100644 --- a/lib/src/animation/delayed_call.dart +++ b/lib/src/animation/delayed_call.dart @@ -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. diff --git a/lib/src/animation/juggler.dart b/lib/src/animation/juggler.dart index f604cfe4..afde8cee 100644 --- a/lib/src/animation/juggler.dart +++ b/lib/src/animation/juggler.dart @@ -1,4 +1,4 @@ -part of stagexl.animation; +part of '../animation.dart'; class _AnimatableLink { Animatable? animatable; diff --git a/lib/src/animation/transition.dart b/lib/src/animation/transition.dart index 388c2baf..90eb8679 100644 --- a/lib/src/animation/transition.dart +++ b/lib/src/animation/transition.dart @@ -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 diff --git a/lib/src/animation/translation.dart b/lib/src/animation/translation.dart index 869afa65..d259de53 100644 --- a/lib/src/animation/translation.dart +++ b/lib/src/animation/translation.dart @@ -1,4 +1,4 @@ -part of stagexl.animation; +part of '../animation.dart'; /// The [Translation] class animates a value by continuously calling /// the [onUpdate] function. diff --git a/lib/src/animation/tween.dart b/lib/src/animation/tween.dart index 91c7bda6..4e2c5527 100644 --- a/lib/src/animation/tween.dart +++ b/lib/src/animation/tween.dart @@ -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 diff --git a/lib/src/animation/tween_object.dart b/lib/src/animation/tween_object.dart index 1146ba6f..5c4b2813 100644 --- a/lib/src/animation/tween_object.dart +++ b/lib/src/animation/tween_object.dart @@ -1,4 +1,4 @@ -part of stagexl.animation; +part of '../animation.dart'; /// The abstract base class for [TweenObject2D] and [TweenObject3D]. diff --git a/lib/src/animation/tween_property.dart b/lib/src/animation/tween_property.dart index 0e5018ba..82d93ae0 100644 --- a/lib/src/animation/tween_property.dart +++ b/lib/src/animation/tween_property.dart @@ -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 diff --git a/lib/src/animation/tween_property_accessor.dart b/lib/src/animation/tween_property_accessor.dart index 874421c4..d0343104 100644 --- a/lib/src/animation/tween_property_accessor.dart +++ b/lib/src/animation/tween_property_accessor.dart @@ -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 diff --git a/lib/src/display.dart b/lib/src/display.dart index f57289c4..aafeaaa5 100644 --- a/lib/src/display.dart +++ b/lib/src/display.dart @@ -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'; @@ -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'; diff --git a/lib/src/display/bitmap.dart b/lib/src/display/bitmap.dart index 24555f2b..66525322 100644 --- a/lib/src/display/bitmap.dart +++ b/lib/src/display/bitmap.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; /// The Bitmap class represents display objects that represent bitmap images. /// diff --git a/lib/src/display/bitmap_container.dart b/lib/src/display/bitmap_container.dart index 6f78d724..cea06539 100644 --- a/lib/src/display/bitmap_container.dart +++ b/lib/src/display/bitmap_container.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; /// A fast container for Bitmap instances. /// diff --git a/lib/src/display/bitmap_data.dart b/lib/src/display/bitmap_data.dart index 75047260..5ea5d4fd 100644 --- a/lib/src/display/bitmap_data.dart +++ b/lib/src/display/bitmap_data.dart @@ -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. diff --git a/lib/src/display/bitmap_data_channel.dart b/lib/src/display/bitmap_data_channel.dart index 92620764..8ea481df 100644 --- a/lib/src/display/bitmap_data_channel.dart +++ b/lib/src/display/bitmap_data_channel.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; class BitmapDataChannel { static const int RED = 1; diff --git a/lib/src/display/bitmap_data_load_info.dart b/lib/src/display/bitmap_data_load_info.dart index 0b1b97f1..c4bc2de2 100644 --- a/lib/src/display/bitmap_data_load_info.dart +++ b/lib/src/display/bitmap_data_load_info.dart @@ -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 diff --git a/lib/src/display/bitmap_data_load_options.dart b/lib/src/display/bitmap_data_load_options.dart index ef16657c..561db790 100644 --- a/lib/src/display/bitmap_data_load_options.dart +++ b/lib/src/display/bitmap_data_load_options.dart @@ -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. diff --git a/lib/src/display/bitmap_data_update_batch.dart b/lib/src/display/bitmap_data_update_batch.dart index 13c3c3b6..f9df7229 100644 --- a/lib/src/display/bitmap_data_update_batch.dart +++ b/lib/src/display/bitmap_data_update_batch.dart @@ -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. diff --git a/lib/src/display/bitmap_drawable.dart b/lib/src/display/bitmap_drawable.dart index eaf6472c..d12918a9 100644 --- a/lib/src/display/bitmap_drawable.dart +++ b/lib/src/display/bitmap_drawable.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; abstract class BitmapDrawable { void render(RenderState renderState); diff --git a/lib/src/display/bitmap_filter.dart b/lib/src/display/bitmap_filter.dart index 6e46e9a3..f6048b7f 100644 --- a/lib/src/display/bitmap_filter.dart +++ b/lib/src/display/bitmap_filter.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; abstract class BitmapFilter extends RenderFilter { BitmapFilter clone(); diff --git a/lib/src/display/color_transform.dart b/lib/src/display/color_transform.dart index f047ae8a..9ba134a1 100644 --- a/lib/src/display/color_transform.dart +++ b/lib/src/display/color_transform.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; class ColorTransform { final Float32List multipliers = Float32List(4); diff --git a/lib/src/display/display_object.dart b/lib/src/display/display_object.dart index 8fc40dc4..8ed187e2 100644 --- a/lib/src/display/display_object.dart +++ b/lib/src/display/display_object.dart @@ -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. /// diff --git a/lib/src/display/display_object_cache.dart b/lib/src/display/display_object_cache.dart index 0b919747..e6380e71 100644 --- a/lib/src/display/display_object_cache.dart +++ b/lib/src/display/display_object_cache.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; class _DisplayObjectCache { final DisplayObject displayObject; diff --git a/lib/src/display/display_object_children.dart b/lib/src/display/display_object_children.dart index 84185f5b..7525ce9a 100644 --- a/lib/src/display/display_object_children.dart +++ b/lib/src/display/display_object_children.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; /// This class is returned by the [DisplayObjectParent.children] getter. /// diff --git a/lib/src/display/display_object_container.dart b/lib/src/display/display_object_container.dart index 81a6f482..d4171873 100644 --- a/lib/src/display/display_object_container.dart +++ b/lib/src/display/display_object_container.dart @@ -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. diff --git a/lib/src/display/display_object_container_3d.dart b/lib/src/display/display_object_container_3d.dart index d49614d2..a132e215 100644 --- a/lib/src/display/display_object_container_3d.dart +++ b/lib/src/display/display_object_container_3d.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; /// The abstract [DisplayObjectContainer3D] class enables 3D transformations /// of 2D display objects. diff --git a/lib/src/display/display_object_parent.dart b/lib/src/display/display_object_parent.dart index 3e23c501..1c3b40f9 100644 --- a/lib/src/display/display_object_parent.dart +++ b/lib/src/display/display_object_parent.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; /// An abstract class implemented by containers for display objects. /// diff --git a/lib/src/display/interactive_object.dart b/lib/src/display/interactive_object.dart index 29504823..eeccd86b 100644 --- a/lib/src/display/interactive_object.dart +++ b/lib/src/display/interactive_object.dart @@ -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 diff --git a/lib/src/display/mask.dart b/lib/src/display/mask.dart index 3e594cc9..f573f65a 100644 --- a/lib/src/display/mask.dart +++ b/lib/src/display/mask.dart @@ -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 diff --git a/lib/src/display/render_loop.dart b/lib/src/display/render_loop.dart index 44bf097c..a58b0634 100644 --- a/lib/src/display/render_loop.dart +++ b/lib/src/display/render_loop.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; class RenderLoop extends RenderLoopBase { final Juggler _juggler = Juggler(); diff --git a/lib/src/display/shape.dart b/lib/src/display/shape.dart index 4e3499ba..67ae5349 100644 --- a/lib/src/display/shape.dart +++ b/lib/src/display/shape.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; /// This class is used to create lightweight shapes. /// diff --git a/lib/src/display/simple_button.dart b/lib/src/display/simple_button.dart index 97559923..74ce3b7a 100644 --- a/lib/src/display/simple_button.dart +++ b/lib/src/display/simple_button.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; enum SimpleButtonState { Up, Over, Down } diff --git a/lib/src/display/sprite.dart b/lib/src/display/sprite.dart index acf0127d..589c61fc 100644 --- a/lib/src/display/sprite.dart +++ b/lib/src/display/sprite.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; /// The Sprite class is a basic display list building block. /// diff --git a/lib/src/display/sprite_3d.dart b/lib/src/display/sprite_3d.dart index 5b7bd138..45487c3b 100644 --- a/lib/src/display/sprite_3d.dart +++ b/lib/src/display/sprite_3d.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; /// The [Sprite3D] class enables 3D transformations of 2D display objects. /// diff --git a/lib/src/display/stage.dart b/lib/src/display/stage.dart index b2a2e1f7..700f37ea 100644 --- a/lib/src/display/stage.dart +++ b/lib/src/display/stage.dart @@ -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. diff --git a/lib/src/display/stage_console.dart b/lib/src/display/stage_console.dart index d68f536e..5a0a5eef 100644 --- a/lib/src/display/stage_console.dart +++ b/lib/src/display/stage_console.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; class StageConsole extends DisplayObject { final String _fontImage = diff --git a/lib/src/display/stage_options.dart b/lib/src/display/stage_options.dart index 48d166b5..f90cb964 100644 --- a/lib/src/display/stage_options.dart +++ b/lib/src/display/stage_options.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; /// The options used by the [Stage] constructor to setup the stage. diff --git a/lib/src/display/stage_tools.dart b/lib/src/display/stage_tools.dart index 983a4d6d..0424da9b 100644 --- a/lib/src/display/stage_tools.dart +++ b/lib/src/display/stage_tools.dart @@ -1,4 +1,4 @@ -part of stagexl.display; +part of '../display.dart'; class _MouseButton { final String mouseDownEventType; diff --git a/lib/src/display_ex.dart b/lib/src/display_ex.dart index 8add89f3..5870c47d 100644 --- a/lib/src/display_ex.dart +++ b/lib/src/display_ex.dart @@ -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; diff --git a/lib/src/display_ex/canvas_shadow_wrapper.dart b/lib/src/display_ex/canvas_shadow_wrapper.dart index 07502d4d..e399d6b5 100644 --- a/lib/src/display_ex/canvas_shadow_wrapper.dart +++ b/lib/src/display_ex/canvas_shadow_wrapper.dart @@ -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 diff --git a/lib/src/display_ex/flip_book.dart b/lib/src/display_ex/flip_book.dart index 5d94e722..00d967d3 100644 --- a/lib/src/display_ex/flip_book.dart +++ b/lib/src/display_ex/flip_book.dart @@ -1,4 +1,4 @@ -part of stagexl.display_ex; +part of '../display_ex.dart'; /// A display object to play sprite sheet animations. /// diff --git a/lib/src/display_ex/gauge.dart b/lib/src/display_ex/gauge.dart index 136b64e0..5e8fa50d 100644 --- a/lib/src/display_ex/gauge.dart +++ b/lib/src/display_ex/gauge.dart @@ -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. diff --git a/lib/src/display_ex/glass_plate.dart b/lib/src/display_ex/glass_plate.dart index de59a56c..146d3eff 100644 --- a/lib/src/display_ex/glass_plate.dart +++ b/lib/src/display_ex/glass_plate.dart @@ -1,4 +1,4 @@ -part of stagexl.display_ex; +part of '../display_ex.dart'; /// An invisible and rectangular display object to catch input events. /// diff --git a/lib/src/display_ex/html_object.dart b/lib/src/display_ex/html_object.dart index febf475e..3141511c 100644 --- a/lib/src/display_ex/html_object.dart +++ b/lib/src/display_ex/html_object.dart @@ -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, diff --git a/lib/src/display_ex/mesh.dart b/lib/src/display_ex/mesh.dart index 1bce32e4..54ab32ad 100644 --- a/lib/src/display_ex/mesh.dart +++ b/lib/src/display_ex/mesh.dart @@ -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. diff --git a/lib/src/display_ex/scale9_bitmap.dart b/lib/src/display_ex/scale9_bitmap.dart index 207484f1..2e16f641 100644 --- a/lib/src/display_ex/scale9_bitmap.dart +++ b/lib/src/display_ex/scale9_bitmap.dart @@ -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 diff --git a/lib/src/display_ex/time_gauge.dart b/lib/src/display_ex/time_gauge.dart index 346ae129..984b12ea 100644 --- a/lib/src/display_ex/time_gauge.dart +++ b/lib/src/display_ex/time_gauge.dart @@ -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]. /// diff --git a/lib/src/display_ex/video_object.dart b/lib/src/display_ex/video_object.dart index 996295d1..ba70215d 100644 --- a/lib/src/display_ex/video_object.dart +++ b/lib/src/display_ex/video_object.dart @@ -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. /// diff --git a/lib/src/display_ex/viewport_container.dart b/lib/src/display_ex/viewport_container.dart index 2b888b45..53a06046 100644 --- a/lib/src/display_ex/viewport_container.dart +++ b/lib/src/display_ex/viewport_container.dart @@ -1,4 +1,4 @@ -part of stagexl.display_ex; +part of '../display_ex.dart'; class ViewportContainer extends DisplayObjectContainer { Mask? _viewportMask; diff --git a/lib/src/display_ex/warp.dart b/lib/src/display_ex/warp.dart index 149e264f..8b865130 100644 --- a/lib/src/display_ex/warp.dart +++ b/lib/src/display_ex/warp.dart @@ -1,4 +1,4 @@ -part of stagexl.display_ex; +part of '../display_ex.dart'; /// A display object with custom 2D transformation matrix. /// diff --git a/lib/src/drawing.dart b/lib/src/drawing.dart index 2a4e3890..31b170c3 100644 --- a/lib/src/drawing.dart +++ b/lib/src/drawing.dart @@ -1,8 +1,6 @@ -library stagexl.drawing; - import 'dart:html' - show CanvasRenderingContext2D, CanvasElement, CanvasGradient, CanvasPattern; -import 'dart:math' show pi, sqrt, sin, cos, tan, atan2, pow; + show CanvasElement, CanvasGradient, CanvasPattern, CanvasRenderingContext2D; +import 'dart:math' show atan2, cos, pi, pow, sin, sqrt, tan; import 'dart:typed_data'; import 'engine.dart'; diff --git a/lib/src/drawing/commands/graphics_command_arc.dart b/lib/src/drawing/commands/graphics_command_arc.dart index 0023be8a..2a2c7a37 100644 --- a/lib/src/drawing/commands/graphics_command_arc.dart +++ b/lib/src/drawing/commands/graphics_command_arc.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandArc extends GraphicsCommand { double _x; diff --git a/lib/src/drawing/commands/graphics_command_arc_elliptical.dart b/lib/src/drawing/commands/graphics_command_arc_elliptical.dart index 5d885e92..80c61cf4 100644 --- a/lib/src/drawing/commands/graphics_command_arc_elliptical.dart +++ b/lib/src/drawing/commands/graphics_command_arc_elliptical.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandArcElliptical extends GraphicsCommand { double _x; diff --git a/lib/src/drawing/commands/graphics_command_arc_to.dart b/lib/src/drawing/commands/graphics_command_arc_to.dart index 4650d784..9fa0a53b 100644 --- a/lib/src/drawing/commands/graphics_command_arc_to.dart +++ b/lib/src/drawing/commands/graphics_command_arc_to.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandArcTo extends GraphicsCommand { double _controlX; diff --git a/lib/src/drawing/commands/graphics_command_begin_path.dart b/lib/src/drawing/commands/graphics_command_begin_path.dart index ba10956e..1e718456 100644 --- a/lib/src/drawing/commands/graphics_command_begin_path.dart +++ b/lib/src/drawing/commands/graphics_command_begin_path.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandBeginPath extends GraphicsCommand { @override diff --git a/lib/src/drawing/commands/graphics_command_bezier_curve_to.dart b/lib/src/drawing/commands/graphics_command_bezier_curve_to.dart index e9f54442..ae194934 100644 --- a/lib/src/drawing/commands/graphics_command_bezier_curve_to.dart +++ b/lib/src/drawing/commands/graphics_command_bezier_curve_to.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandBezierCurveTo extends GraphicsCommand { double _controlX1; diff --git a/lib/src/drawing/commands/graphics_command_circle.dart b/lib/src/drawing/commands/graphics_command_circle.dart index 0477af2d..c7a39139 100644 --- a/lib/src/drawing/commands/graphics_command_circle.dart +++ b/lib/src/drawing/commands/graphics_command_circle.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandCircle extends GraphicsCommand { double _x; diff --git a/lib/src/drawing/commands/graphics_command_close_path.dart b/lib/src/drawing/commands/graphics_command_close_path.dart index 75943d5f..265c062e 100644 --- a/lib/src/drawing/commands/graphics_command_close_path.dart +++ b/lib/src/drawing/commands/graphics_command_close_path.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandClosePath extends GraphicsCommand { @override diff --git a/lib/src/drawing/commands/graphics_command_decode.dart b/lib/src/drawing/commands/graphics_command_decode.dart index 9ffba26a..497d05ac 100644 --- a/lib/src/drawing/commands/graphics_command_decode.dart +++ b/lib/src/drawing/commands/graphics_command_decode.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; enum PathEncoding { SVG, EaselJS } diff --git a/lib/src/drawing/commands/graphics_command_ellipse.dart b/lib/src/drawing/commands/graphics_command_ellipse.dart index 32611150..94d57521 100644 --- a/lib/src/drawing/commands/graphics_command_ellipse.dart +++ b/lib/src/drawing/commands/graphics_command_ellipse.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandEllipse extends GraphicsCommand { double _x; diff --git a/lib/src/drawing/commands/graphics_command_fill.dart b/lib/src/drawing/commands/graphics_command_fill.dart index ce59f385..6667d5da 100644 --- a/lib/src/drawing/commands/graphics_command_fill.dart +++ b/lib/src/drawing/commands/graphics_command_fill.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; /// The base class for all graphics fill commands diff --git a/lib/src/drawing/commands/graphics_command_fill_color.dart b/lib/src/drawing/commands/graphics_command_fill_color.dart index 270becbc..315ef9ec 100644 --- a/lib/src/drawing/commands/graphics_command_fill_color.dart +++ b/lib/src/drawing/commands/graphics_command_fill_color.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandFillColor extends GraphicsCommandFill { int _color; diff --git a/lib/src/drawing/commands/graphics_command_fill_gradient.dart b/lib/src/drawing/commands/graphics_command_fill_gradient.dart index 0c373d0f..e3b9532a 100644 --- a/lib/src/drawing/commands/graphics_command_fill_gradient.dart +++ b/lib/src/drawing/commands/graphics_command_fill_gradient.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandFillGradient extends GraphicsCommandFill { GraphicsGradient _gradient; diff --git a/lib/src/drawing/commands/graphics_command_fill_pattern.dart b/lib/src/drawing/commands/graphics_command_fill_pattern.dart index 5e0a02cd..b855f4f5 100644 --- a/lib/src/drawing/commands/graphics_command_fill_pattern.dart +++ b/lib/src/drawing/commands/graphics_command_fill_pattern.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandFillPattern extends GraphicsCommandFill { GraphicsPattern _pattern; diff --git a/lib/src/drawing/commands/graphics_command_line_to.dart b/lib/src/drawing/commands/graphics_command_line_to.dart index c8840221..6988635f 100644 --- a/lib/src/drawing/commands/graphics_command_line_to.dart +++ b/lib/src/drawing/commands/graphics_command_line_to.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandLineTo extends GraphicsCommand { double _x; diff --git a/lib/src/drawing/commands/graphics_command_move_to.dart b/lib/src/drawing/commands/graphics_command_move_to.dart index 856cfa59..9e2568fe 100644 --- a/lib/src/drawing/commands/graphics_command_move_to.dart +++ b/lib/src/drawing/commands/graphics_command_move_to.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandMoveTo extends GraphicsCommand { double _x; diff --git a/lib/src/drawing/commands/graphics_command_quadratic_curve_to.dart b/lib/src/drawing/commands/graphics_command_quadratic_curve_to.dart index 0ed98e2c..cbfb0fe5 100644 --- a/lib/src/drawing/commands/graphics_command_quadratic_curve_to.dart +++ b/lib/src/drawing/commands/graphics_command_quadratic_curve_to.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandQuadraticCurveTo extends GraphicsCommand { double _controlX; diff --git a/lib/src/drawing/commands/graphics_command_rect.dart b/lib/src/drawing/commands/graphics_command_rect.dart index dd0d4233..511e6b1a 100644 --- a/lib/src/drawing/commands/graphics_command_rect.dart +++ b/lib/src/drawing/commands/graphics_command_rect.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandRect extends GraphicsCommand { double _x; diff --git a/lib/src/drawing/commands/graphics_command_rect_round.dart b/lib/src/drawing/commands/graphics_command_rect_round.dart index 0b1acafd..34154cd9 100644 --- a/lib/src/drawing/commands/graphics_command_rect_round.dart +++ b/lib/src/drawing/commands/graphics_command_rect_round.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandRectRound extends GraphicsCommand { double _x; diff --git a/lib/src/drawing/commands/graphics_command_stroke.dart b/lib/src/drawing/commands/graphics_command_stroke.dart index fffc05c0..f0f9e53c 100644 --- a/lib/src/drawing/commands/graphics_command_stroke.dart +++ b/lib/src/drawing/commands/graphics_command_stroke.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; /// The base class for all graphics stroke commands diff --git a/lib/src/drawing/commands/graphics_command_stroke_color.dart b/lib/src/drawing/commands/graphics_command_stroke_color.dart index 7b50c267..804d9da2 100644 --- a/lib/src/drawing/commands/graphics_command_stroke_color.dart +++ b/lib/src/drawing/commands/graphics_command_stroke_color.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandStrokeColor extends GraphicsCommandStroke { int _color; diff --git a/lib/src/drawing/commands/graphics_command_stroke_gradient.dart b/lib/src/drawing/commands/graphics_command_stroke_gradient.dart index 17d2db82..395b968f 100644 --- a/lib/src/drawing/commands/graphics_command_stroke_gradient.dart +++ b/lib/src/drawing/commands/graphics_command_stroke_gradient.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandStrokeGradient extends GraphicsCommandStroke { GraphicsGradient _gradient; diff --git a/lib/src/drawing/commands/graphics_command_stroke_pattern.dart b/lib/src/drawing/commands/graphics_command_stroke_pattern.dart index 29861c7f..103f4d6b 100644 --- a/lib/src/drawing/commands/graphics_command_stroke_pattern.dart +++ b/lib/src/drawing/commands/graphics_command_stroke_pattern.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class GraphicsCommandStrokePattern extends GraphicsCommandStroke { GraphicsPattern _pattern; diff --git a/lib/src/drawing/graphics.dart b/lib/src/drawing/graphics.dart index 9a50bcb9..ebd4cba3 100644 --- a/lib/src/drawing/graphics.dart +++ b/lib/src/drawing/graphics.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../drawing.dart'; /// A vector graphics drawing surface. /// diff --git a/lib/src/drawing/graphics_command.dart b/lib/src/drawing/graphics_command.dart index 29305198..61825f77 100644 --- a/lib/src/drawing/graphics_command.dart +++ b/lib/src/drawing/graphics_command.dart @@ -1,7 +1,6 @@ -part of stagexl.drawing; +part of '../drawing.dart'; /// The base class for all graphics commands - abstract class GraphicsCommand { Graphics? _graphics; diff --git a/lib/src/drawing/graphics_context.dart b/lib/src/drawing/graphics_context.dart index 944c6a1b..070a368b 100644 --- a/lib/src/drawing/graphics_context.dart +++ b/lib/src/drawing/graphics_context.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../drawing.dart'; abstract class GraphicsContext { void beginPath(); diff --git a/lib/src/drawing/graphics_enums.dart b/lib/src/drawing/graphics_enums.dart index 5f793492..dfb66b02 100644 --- a/lib/src/drawing/graphics_enums.dart +++ b/lib/src/drawing/graphics_enums.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../drawing.dart'; enum JointStyle { MITER, ROUND, BEVEL } diff --git a/lib/src/drawing/graphics_gradient.dart b/lib/src/drawing/graphics_gradient.dart index 518c29a8..c42056d9 100644 --- a/lib/src/drawing/graphics_gradient.dart +++ b/lib/src/drawing/graphics_gradient.dart @@ -1,6 +1,6 @@ // ignore_for_file: prefer_interpolation_to_compose_strings, use_string_buffers -part of stagexl.drawing; +part of '../drawing.dart'; class GraphicsGradientColorStop { num offset; diff --git a/lib/src/drawing/graphics_gradient_program.dart b/lib/src/drawing/graphics_gradient_program.dart index 8b1cc9c5..312a7065 100644 --- a/lib/src/drawing/graphics_gradient_program.dart +++ b/lib/src/drawing/graphics_gradient_program.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../drawing.dart'; abstract class _GraphicsGradientProgram extends RenderProgram { GraphicsGradient? activeGradient; diff --git a/lib/src/drawing/graphics_pattern.dart b/lib/src/drawing/graphics_pattern.dart index 78719ec2..59fb3e15 100644 --- a/lib/src/drawing/graphics_pattern.dart +++ b/lib/src/drawing/graphics_pattern.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../drawing.dart'; class GraphicsPatternType { final String value; diff --git a/lib/src/drawing/internal/graphics_command.dart b/lib/src/drawing/internal/graphics_command.dart index ae747b98..2fcd882e 100644 --- a/lib/src/drawing/internal/graphics_command.dart +++ b/lib/src/drawing/internal/graphics_command.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class _GraphicsCommandMeshColor extends GraphicsCommand { final _GraphicsMesh mesh; diff --git a/lib/src/drawing/internal/graphics_context_base.dart b/lib/src/drawing/internal/graphics_context_base.dart index 777f1db7..c23b10a1 100644 --- a/lib/src/drawing/internal/graphics_context_base.dart +++ b/lib/src/drawing/internal/graphics_context_base.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; abstract class _GraphicsContextBase extends GraphicsContext { _GraphicsPath _path = _GraphicsPath(); diff --git a/lib/src/drawing/internal/graphics_context_bounds.dart b/lib/src/drawing/internal/graphics_context_bounds.dart index f922be43..fe5fc7e1 100644 --- a/lib/src/drawing/internal/graphics_context_bounds.dart +++ b/lib/src/drawing/internal/graphics_context_bounds.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class _GraphicsContextBounds extends _GraphicsContextBase { double _minX = 0.0 + double.maxFinite; diff --git a/lib/src/drawing/internal/graphics_context_canvas.dart b/lib/src/drawing/internal/graphics_context_canvas.dart index 5296df1d..94e690c2 100644 --- a/lib/src/drawing/internal/graphics_context_canvas.dart +++ b/lib/src/drawing/internal/graphics_context_canvas.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class _GraphicsContextCanvas extends GraphicsContext { final RenderState renderState; diff --git a/lib/src/drawing/internal/graphics_context_compiler.dart b/lib/src/drawing/internal/graphics_context_compiler.dart index 3957afef..1d6e722d 100644 --- a/lib/src/drawing/internal/graphics_context_compiler.dart +++ b/lib/src/drawing/internal/graphics_context_compiler.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class _GraphicsContextCompiler extends _GraphicsContextBase { final List commands; diff --git a/lib/src/drawing/internal/graphics_context_hittest.dart b/lib/src/drawing/internal/graphics_context_hittest.dart index f6d2baa7..985d9f25 100644 --- a/lib/src/drawing/internal/graphics_context_hittest.dart +++ b/lib/src/drawing/internal/graphics_context_hittest.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class _GraphicsContextHitTest extends _GraphicsContextBase { bool _hit = false; diff --git a/lib/src/drawing/internal/graphics_context_render.dart b/lib/src/drawing/internal/graphics_context_render.dart index e6655c0c..e90ab1f2 100644 --- a/lib/src/drawing/internal/graphics_context_render.dart +++ b/lib/src/drawing/internal/graphics_context_render.dart @@ -1,6 +1,6 @@ // ignore_for_file: library_private_types_in_public_api -part of stagexl.drawing; +part of '../../drawing.dart'; class _GraphicsContextRender extends _GraphicsContextBase { final RenderState renderState; diff --git a/lib/src/drawing/internal/graphics_mesh.dart b/lib/src/drawing/internal/graphics_mesh.dart index 541c53b7..99de9e71 100644 --- a/lib/src/drawing/internal/graphics_mesh.dart +++ b/lib/src/drawing/internal/graphics_mesh.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; abstract class _GraphicsMesh { final List segments = []; diff --git a/lib/src/drawing/internal/graphics_mesh_segment.dart b/lib/src/drawing/internal/graphics_mesh_segment.dart index f6f7a788..30bf6a2d 100644 --- a/lib/src/drawing/internal/graphics_mesh_segment.dart +++ b/lib/src/drawing/internal/graphics_mesh_segment.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; abstract class _GraphicsMeshSegment { Float32List _vertexBuffer; diff --git a/lib/src/drawing/internal/graphics_path.dart b/lib/src/drawing/internal/graphics_path.dart index f7c02fad..1a04c775 100644 --- a/lib/src/drawing/internal/graphics_path.dart +++ b/lib/src/drawing/internal/graphics_path.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class _GraphicsPath extends _GraphicsMesh<_GraphicsPathSegment> { _GraphicsPathSegment? _currentSegment; diff --git a/lib/src/drawing/internal/graphics_path_segment.dart b/lib/src/drawing/internal/graphics_path_segment.dart index 71eaf63a..fbddbd45 100644 --- a/lib/src/drawing/internal/graphics_path_segment.dart +++ b/lib/src/drawing/internal/graphics_path_segment.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class _GraphicsPathSegment extends _GraphicsMeshSegment { bool? _clockwise; diff --git a/lib/src/drawing/internal/graphics_stroke.dart b/lib/src/drawing/internal/graphics_stroke.dart index a7b904b3..4d5c739f 100644 --- a/lib/src/drawing/internal/graphics_stroke.dart +++ b/lib/src/drawing/internal/graphics_stroke.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class _GraphicsStroke extends _GraphicsMesh<_GraphicsStrokeSegment> { final double width; diff --git a/lib/src/drawing/internal/graphics_stroke_segment.dart b/lib/src/drawing/internal/graphics_stroke_segment.dart index cf7a0ad5..c7ef7289 100644 --- a/lib/src/drawing/internal/graphics_stroke_segment.dart +++ b/lib/src/drawing/internal/graphics_stroke_segment.dart @@ -1,4 +1,4 @@ -part of stagexl.drawing; +part of '../../drawing.dart'; class _GraphicsStrokeSegment extends _GraphicsMeshSegment { final _GraphicsStroke stroke; diff --git a/lib/src/engine.dart b/lib/src/engine.dart index 36af7ee0..5df5ce87 100644 --- a/lib/src/engine.dart +++ b/lib/src/engine.dart @@ -11,19 +11,19 @@ /// [RenderTextureQuad] classes. More advanced uses may even implement custom /// WebGL shaders by extending the [RenderProgram] class. /// -library stagexl.engine; +library; import 'dart:async'; import 'dart:html' show - window, - ImageElement, CanvasElement, - CanvasRenderingContext2D, CanvasImageSource, - ImageData, + CanvasRenderingContext2D, ImageBitmap, - VideoElement; + ImageData, + ImageElement, + VideoElement, + window; import 'dart:js_util' as js_util; import 'dart:math' as math; import 'dart:typed_data'; diff --git a/lib/src/engine/blend_mode.dart b/lib/src/engine/blend_mode.dart index b3f6eddb..8d6bbea7 100644 --- a/lib/src/engine/blend_mode.dart +++ b/lib/src/engine/blend_mode.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; /// A class that provides constant values for visual blend mode effects. class BlendMode { diff --git a/lib/src/engine/render_buffer_index.dart b/lib/src/engine/render_buffer_index.dart index 181febd0..d9d1cae2 100644 --- a/lib/src/engine/render_buffer_index.dart +++ b/lib/src/engine/render_buffer_index.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; class RenderBufferIndex { final Int16List data; diff --git a/lib/src/engine/render_buffer_vertex.dart b/lib/src/engine/render_buffer_vertex.dart index ffd93026..b85612cc 100644 --- a/lib/src/engine/render_buffer_vertex.dart +++ b/lib/src/engine/render_buffer_vertex.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; class RenderBufferVertex { final Float32List data; diff --git a/lib/src/engine/render_context.dart b/lib/src/engine/render_context.dart index 2688c98e..5f553154 100644 --- a/lib/src/engine/render_context.dart +++ b/lib/src/engine/render_context.dart @@ -1,6 +1,6 @@ // ignore_for_file: close_sinks -part of stagexl.engine; +part of '../engine.dart'; /// The implementation kind of the render context. diff --git a/lib/src/engine/render_context_canvas.dart b/lib/src/engine/render_context_canvas.dart index d100edff..1177a128 100644 --- a/lib/src/engine/render_context_canvas.dart +++ b/lib/src/engine/render_context_canvas.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; class RenderContextCanvas extends RenderContext { final CanvasElement _canvasElement; @@ -125,7 +125,7 @@ class RenderContextCanvas extends RenderContext { if (rotation == 0) { context.setTransform( matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty); - js_util.callMethod(context, 'drawImage', [ + js_util.callMethod(context, 'drawImage', [ source, sourceRect.left, sourceRect.top, @@ -139,7 +139,7 @@ class RenderContextCanvas extends RenderContext { } else if (rotation == 1) { context.setTransform( -matrix.c, -matrix.d, matrix.a, matrix.b, matrix.tx, matrix.ty); - js_util.callMethod(context, 'drawImage', [ + js_util.callMethod(context, 'drawImage', [ source, sourceRect.left, sourceRect.top, @@ -153,7 +153,7 @@ class RenderContextCanvas extends RenderContext { } else if (rotation == 2) { context.setTransform( -matrix.a, -matrix.b, -matrix.c, -matrix.d, matrix.tx, matrix.ty); - js_util.callMethod(context, 'drawImage', [ + js_util.callMethod(context, 'drawImage', [ source, sourceRect.left, sourceRect.top, @@ -167,7 +167,7 @@ class RenderContextCanvas extends RenderContext { } else if (rotation == 3) { context.setTransform( matrix.c, matrix.d, -matrix.a, -matrix.b, matrix.tx, matrix.ty); - js_util.callMethod(context, 'drawImage', [ + js_util.callMethod(context, 'drawImage', [ source, sourceRect.left, sourceRect.top, diff --git a/lib/src/engine/render_context_webgl.dart b/lib/src/engine/render_context_webgl.dart index b8ff6d05..5e486733 100644 --- a/lib/src/engine/render_context_webgl.dart +++ b/lib/src/engine/render_context_webgl.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; class RenderContextWebGL extends RenderContext { static int _globalContextIdentifier = 0; diff --git a/lib/src/engine/render_filter.dart b/lib/src/engine/render_filter.dart index 8fa4892e..0ebfdb13 100644 --- a/lib/src/engine/render_filter.dart +++ b/lib/src/engine/render_filter.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; /// The abstract [RenderFilter] class defines the interface for filters /// that can be rendered by the engine. diff --git a/lib/src/engine/render_frame_buffer.dart b/lib/src/engine/render_frame_buffer.dart index 23689c47..4a728a21 100644 --- a/lib/src/engine/render_frame_buffer.dart +++ b/lib/src/engine/render_frame_buffer.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; class RenderFrameBuffer { RenderTexture? _renderTexture; diff --git a/lib/src/engine/render_loop_base.dart b/lib/src/engine/render_loop_base.dart index 28d640ab..9183d677 100644 --- a/lib/src/engine/render_loop_base.dart +++ b/lib/src/engine/render_loop_base.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; final _globalFrameListeners = []; num _globalFrameTime = double.maxFinite; diff --git a/lib/src/engine/render_mask.dart b/lib/src/engine/render_mask.dart index fe8fee5e..d1eb4e6a 100644 --- a/lib/src/engine/render_mask.dart +++ b/lib/src/engine/render_mask.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; /// The abstract [RenderMask] class defines the interface for masks /// that can be rendered by the engine. diff --git a/lib/src/engine/render_object.dart b/lib/src/engine/render_object.dart index 60eeaf11..825c1b90 100644 --- a/lib/src/engine/render_object.dart +++ b/lib/src/engine/render_object.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; /// The abstract [RenderObject] class defines the interface for a class /// that can be rendered with the [RenderState.renderObject] method. All diff --git a/lib/src/engine/render_program.dart b/lib/src/engine/render_program.dart index e26200c0..c0b8d2c0 100644 --- a/lib/src/engine/render_program.dart +++ b/lib/src/engine/render_program.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; abstract class RenderProgram { int _contextIdentifier = -1; diff --git a/lib/src/engine/render_program_simple.dart b/lib/src/engine/render_program_simple.dart index 488c2818..6e997ea3 100644 --- a/lib/src/engine/render_program_simple.dart +++ b/lib/src/engine/render_program_simple.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; class RenderProgramSimple extends RenderProgram { // aVertexPosition: Float32(x), Float32(y) diff --git a/lib/src/engine/render_program_tinted.dart b/lib/src/engine/render_program_tinted.dart index d2637ad4..8af14fdf 100644 --- a/lib/src/engine/render_program_tinted.dart +++ b/lib/src/engine/render_program_tinted.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; class RenderProgramTinted extends RenderProgram { // aVertexPosition: Float32(x), Float32(y) diff --git a/lib/src/engine/render_program_triangle.dart b/lib/src/engine/render_program_triangle.dart index 345fe3c7..7cbcf09e 100644 --- a/lib/src/engine/render_program_triangle.dart +++ b/lib/src/engine/render_program_triangle.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; class RenderProgramTriangle extends RenderProgram { // aVertexPosition: Float32(x), Float32(y) diff --git a/lib/src/engine/render_state.dart b/lib/src/engine/render_state.dart index ac2d736b..df375879 100644 --- a/lib/src/engine/render_state.dart +++ b/lib/src/engine/render_state.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; class _ContextState { double alpha = 1; diff --git a/lib/src/engine/render_statistics.dart b/lib/src/engine/render_statistics.dart index 67351d63..c85058d7 100644 --- a/lib/src/engine/render_statistics.dart +++ b/lib/src/engine/render_statistics.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; class RenderStatistics { int drawCount = 0; diff --git a/lib/src/engine/render_stencil_buffer.dart b/lib/src/engine/render_stencil_buffer.dart index ed70c06c..ac5601a2 100644 --- a/lib/src/engine/render_stencil_buffer.dart +++ b/lib/src/engine/render_stencil_buffer.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; class RenderStencilBuffer { int _width = 0; diff --git a/lib/src/engine/render_texture.dart b/lib/src/engine/render_texture.dart index 0d662ea2..b76e4cdb 100644 --- a/lib/src/engine/render_texture.dart +++ b/lib/src/engine/render_texture.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; class RenderTexture { int _width = 0; @@ -100,7 +100,7 @@ class RenderTexture { // Note: We need to use js_util.callMethod, because Dart SDK // does not support ImageBitmap as a CanvasImageSource - js_util.callMethod(_canvas!.context2D, 'drawImage', [ + js_util.callMethod(_canvas!.context2D, 'drawImage', [ image, 0, 0, diff --git a/lib/src/engine/render_texture_filtering.dart b/lib/src/engine/render_texture_filtering.dart index 7f8dd4ad..29284192 100644 --- a/lib/src/engine/render_texture_filtering.dart +++ b/lib/src/engine/render_texture_filtering.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; /// The RenderTextureFiltering defines the method that is used to determine /// the texture color for a texture mapped pixel, using the colors of nearby diff --git a/lib/src/engine/render_texture_quad.dart b/lib/src/engine/render_texture_quad.dart index e596d011..5ad8d08c 100644 --- a/lib/src/engine/render_texture_quad.dart +++ b/lib/src/engine/render_texture_quad.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; class RenderTextureQuad { final RenderTexture renderTexture; diff --git a/lib/src/engine/render_texture_wrapping.dart b/lib/src/engine/render_texture_wrapping.dart index 19107eeb..81335c86 100644 --- a/lib/src/engine/render_texture_wrapping.dart +++ b/lib/src/engine/render_texture_wrapping.dart @@ -1,4 +1,4 @@ -part of stagexl.engine; +part of '../engine.dart'; class RenderTextureWrapping { final int value; diff --git a/lib/src/errors.dart b/lib/src/errors.dart index eca2171a..2e31e185 100644 --- a/lib/src/errors.dart +++ b/lib/src/errors.dart @@ -1,5 +1,3 @@ -library stagexl.errors; - /// An AggregateError contains a list of errors that occur during execution. class AggregateError extends Error { final String message; diff --git a/lib/src/events.dart b/lib/src/events.dart index f989858d..ec0504c7 100644 --- a/lib/src/events.dart +++ b/lib/src/events.dart @@ -5,7 +5,7 @@ /// All display objects extend the [EventDispatcher] class which is used /// to listen to events as well as dispatching new events. /// -library stagexl.events; +library; import 'dart:async'; import 'dart:html'; @@ -18,8 +18,8 @@ part 'events/event_stream.dart'; part 'events/event_stream_provider.dart'; part 'events/event_stream_subscription.dart'; part 'events/input_event.dart'; -part 'events/keyboard_event.dart'; part 'events/key_location.dart'; +part 'events/keyboard_event.dart'; part 'events/mouse_event.dart'; part 'events/text_event.dart'; part 'events/touch_event.dart'; diff --git a/lib/src/events/broadcast_event.dart b/lib/src/events/broadcast_event.dart index 33323e0e..12060d01 100644 --- a/lib/src/events/broadcast_event.dart +++ b/lib/src/events/broadcast_event.dart @@ -1,4 +1,4 @@ -part of stagexl.events; +part of '../events.dart'; /// An event that has no specific [DisplayObject] as target but rather all /// [DisplayObject] instances, including those that are not on the display list. diff --git a/lib/src/events/event.dart b/lib/src/events/event.dart index 9de7358d..08b72a34 100644 --- a/lib/src/events/event.dart +++ b/lib/src/events/event.dart @@ -1,4 +1,4 @@ -part of stagexl.events; +part of '../events.dart'; /// Holds basic information about an event. /// diff --git a/lib/src/events/event_dispatcher.dart b/lib/src/events/event_dispatcher.dart index 41d2ab03..250af53b 100644 --- a/lib/src/events/event_dispatcher.dart +++ b/lib/src/events/event_dispatcher.dart @@ -1,4 +1,4 @@ -part of stagexl.events; +part of '../events.dart'; /// The base class for all classes that dispatch events. /// diff --git a/lib/src/events/event_phase.dart b/lib/src/events/event_phase.dart index 2f0becc6..06c1645c 100644 --- a/lib/src/events/event_phase.dart +++ b/lib/src/events/event_phase.dart @@ -1,4 +1,4 @@ -part of stagexl.events; +part of '../events.dart'; /// Provides constant values for the eventPhase property of the [Event] class. diff --git a/lib/src/events/event_stream.dart b/lib/src/events/event_stream.dart index 17b88326..08cb4345 100644 --- a/lib/src/events/event_stream.dart +++ b/lib/src/events/event_stream.dart @@ -1,4 +1,4 @@ -part of stagexl.events; +part of '../events.dart'; /// Provides a stream of [Event]s. class EventStream extends Stream { diff --git a/lib/src/events/event_stream_provider.dart b/lib/src/events/event_stream_provider.dart index aa2472b5..075b8258 100644 --- a/lib/src/events/event_stream_provider.dart +++ b/lib/src/events/event_stream_provider.dart @@ -1,4 +1,4 @@ -part of stagexl.events; +part of '../events.dart'; /// A factory to expose [Event]s as streams. class EventStreamProvider { diff --git a/lib/src/events/event_stream_subscription.dart b/lib/src/events/event_stream_subscription.dart index 898c6d84..851547fb 100644 --- a/lib/src/events/event_stream_subscription.dart +++ b/lib/src/events/event_stream_subscription.dart @@ -1,4 +1,4 @@ -part of stagexl.events; +part of '../events.dart'; /// A handler function that is used to listen to events. @@ -10,7 +10,8 @@ typedef EventListener = void Function(T event); /// used to handle the events. The subscription can also be used to unsubscribe /// from the events, or to temporarily pause the events from the stream. -class EventStreamSubscription implements StreamSubscription { +class EventStreamSubscription + implements StreamSubscription { final int _priority; int _pauseCount = 0; bool _canceled = false; diff --git a/lib/src/events/input_event.dart b/lib/src/events/input_event.dart index 0065eff9..781ccf47 100644 --- a/lib/src/events/input_event.dart +++ b/lib/src/events/input_event.dart @@ -1,4 +1,4 @@ -part of stagexl.events; +part of '../events.dart'; enum InputEventMode { MouseOnly, TouchOnly, MouseAndTouch } diff --git a/lib/src/events/key_location.dart b/lib/src/events/key_location.dart index b114450a..a8c25a19 100644 --- a/lib/src/events/key_location.dart +++ b/lib/src/events/key_location.dart @@ -1,4 +1,4 @@ -part of stagexl.events; +part of '../events.dart'; /// Defines the standard key locations returned by /// [KeyboardEvent.getKeyLocation]. diff --git a/lib/src/events/keyboard_event.dart b/lib/src/events/keyboard_event.dart index d0ce8df4..113b5aa1 100644 --- a/lib/src/events/keyboard_event.dart +++ b/lib/src/events/keyboard_event.dart @@ -1,4 +1,4 @@ -part of stagexl.events; +part of '../events.dart'; /// An [Event] that is dispatched in response to user input through a keyboard. /// diff --git a/lib/src/events/mouse_event.dart b/lib/src/events/mouse_event.dart index 99067ea0..bfa5520e 100644 --- a/lib/src/events/mouse_event.dart +++ b/lib/src/events/mouse_event.dart @@ -1,4 +1,4 @@ -part of stagexl.events; +part of '../events.dart'; /// An event that is dispatched into the event flow whenever mouse events occur. /// diff --git a/lib/src/events/text_event.dart b/lib/src/events/text_event.dart index b2aa044e..1a353361 100644 --- a/lib/src/events/text_event.dart +++ b/lib/src/events/text_event.dart @@ -1,4 +1,4 @@ -part of stagexl.events; +part of '../events.dart'; /// An object dispatches a [TextEvent] object when a user enters text in a text /// field or clicks a hyperlink in an HTML-enabled text field. diff --git a/lib/src/events/touch_event.dart b/lib/src/events/touch_event.dart index 74bf7a62..03b87c71 100644 --- a/lib/src/events/touch_event.dart +++ b/lib/src/events/touch_event.dart @@ -1,4 +1,4 @@ -part of stagexl.events; +part of '../events.dart'; /// The [TouchEvent] class lets you handle events on devices that detect user /// contact with the device (such as a finger on a touch screen). diff --git a/lib/src/filters.dart b/lib/src/filters.dart index 87eea02a..7332a0fd 100644 --- a/lib/src/filters.dart +++ b/lib/src/filters.dart @@ -8,8 +8,7 @@ /// consuming operation performed on the CPU. /// /// Sample: - -library stagexl.filters; +library; export 'filters/alpha_mask_filter.dart' show AlphaMaskFilter; export 'filters/blur_filter.dart' show BlurFilter; diff --git a/lib/src/filters/alpha_mask_filter.dart b/lib/src/filters/alpha_mask_filter.dart index cccdc4fa..1ec88166 100644 --- a/lib/src/filters/alpha_mask_filter.dart +++ b/lib/src/filters/alpha_mask_filter.dart @@ -1,5 +1,3 @@ -library stagexl.filters.alpha_mask; - import '../display.dart'; import '../engine.dart'; import '../geom.dart'; diff --git a/lib/src/filters/blur_filter.dart b/lib/src/filters/blur_filter.dart index 2607897a..a838b112 100644 --- a/lib/src/filters/blur_filter.dart +++ b/lib/src/filters/blur_filter.dart @@ -1,5 +1,3 @@ -library stagexl.filters.blur; - import 'dart:math' hide Point, Rectangle; import '../display.dart'; diff --git a/lib/src/filters/chroma_key_filter.dart b/lib/src/filters/chroma_key_filter.dart index d483b457..64f0cc7e 100644 --- a/lib/src/filters/chroma_key_filter.dart +++ b/lib/src/filters/chroma_key_filter.dart @@ -1,5 +1,3 @@ -library stagexl.filters.chroma_key; - import '../display.dart'; import '../engine.dart'; import '../geom.dart'; diff --git a/lib/src/filters/color_matrix_filter.dart b/lib/src/filters/color_matrix_filter.dart index f50c19e4..6e197fbf 100644 --- a/lib/src/filters/color_matrix_filter.dart +++ b/lib/src/filters/color_matrix_filter.dart @@ -1,5 +1,3 @@ -library stagexl.filters.color_matrix; - import 'dart:math' hide Point, Rectangle; import 'dart:typed_data'; diff --git a/lib/src/filters/displacement_map_filter.dart b/lib/src/filters/displacement_map_filter.dart index 85481dad..7dac73e6 100644 --- a/lib/src/filters/displacement_map_filter.dart +++ b/lib/src/filters/displacement_map_filter.dart @@ -1,5 +1,3 @@ -library stagexl.filters.displacement_map; - import 'dart:typed_data'; import '../display.dart'; diff --git a/lib/src/filters/drop_shadow_filter.dart b/lib/src/filters/drop_shadow_filter.dart index 54b7c65f..bd9942fd 100644 --- a/lib/src/filters/drop_shadow_filter.dart +++ b/lib/src/filters/drop_shadow_filter.dart @@ -1,5 +1,3 @@ -library stagexl.filters.drop_shadow; - import 'dart:math' hide Point, Rectangle; import '../display.dart'; diff --git a/lib/src/filters/flatten_filter.dart b/lib/src/filters/flatten_filter.dart index 3b8ac562..38f4c66b 100644 --- a/lib/src/filters/flatten_filter.dart +++ b/lib/src/filters/flatten_filter.dart @@ -1,5 +1,3 @@ -library stagexl.filters.flatten; - import '../display.dart'; /// The FlattenFilter does not change the visual appearance of the BitmapData diff --git a/lib/src/filters/fxaa_filter.dart b/lib/src/filters/fxaa_filter.dart index 92ad8558..9b613524 100644 --- a/lib/src/filters/fxaa_filter.dart +++ b/lib/src/filters/fxaa_filter.dart @@ -1,5 +1,3 @@ -library stagexl.filters.fxaa; - import '../display.dart'; import '../engine.dart'; import '../geom.dart'; diff --git a/lib/src/filters/glow_filter.dart b/lib/src/filters/glow_filter.dart index b8727516..3b213328 100644 --- a/lib/src/filters/glow_filter.dart +++ b/lib/src/filters/glow_filter.dart @@ -1,5 +1,3 @@ -library stagexl.filters.glow; - import 'dart:math' hide Point, Rectangle; import '../display.dart'; diff --git a/lib/src/filters/normal_map_filter.dart b/lib/src/filters/normal_map_filter.dart index 317bc390..c35572a3 100644 --- a/lib/src/filters/normal_map_filter.dart +++ b/lib/src/filters/normal_map_filter.dart @@ -1,5 +1,3 @@ -library stagexl.filters.normal_map; - import 'dart:math' as math; import '../display.dart'; diff --git a/lib/src/filters/tint_filter.dart b/lib/src/filters/tint_filter.dart index 45f8151c..2278336d 100644 --- a/lib/src/filters/tint_filter.dart +++ b/lib/src/filters/tint_filter.dart @@ -1,5 +1,3 @@ -library stagexl.filters.tint; - import '../display.dart'; import '../engine.dart'; import '../geom.dart'; diff --git a/lib/src/geom.dart b/lib/src/geom.dart index a7c9f443..84f16f3a 100644 --- a/lib/src/geom.dart +++ b/lib/src/geom.dart @@ -5,7 +5,7 @@ /// rectangle class of StageXL are mutable, so you can change the fields /// which is not possible with the dart:math classes. /// -library stagexl.geom; +library; export 'geom/circle.dart'; export 'geom/matrix.dart'; diff --git a/lib/src/geom/circle.dart b/lib/src/geom/circle.dart index 09a7b748..dbbb433c 100644 --- a/lib/src/geom/circle.dart +++ b/lib/src/geom/circle.dart @@ -1,5 +1,3 @@ -library stagexl.geom.circle; - import '../internal/jenkins_hash.dart'; import 'point.dart'; diff --git a/lib/src/geom/matrix.dart b/lib/src/geom/matrix.dart index 1eec3961..172e707a 100644 --- a/lib/src/geom/matrix.dart +++ b/lib/src/geom/matrix.dart @@ -1,5 +1,3 @@ -library stagexl.geom.matrix; - import 'dart:math' hide Point, Rectangle; import 'dart:math' as math; import 'dart:typed_data'; diff --git a/lib/src/geom/matrix_3d.dart b/lib/src/geom/matrix_3d.dart index 6ca9f591..7fcf76a5 100644 --- a/lib/src/geom/matrix_3d.dart +++ b/lib/src/geom/matrix_3d.dart @@ -1,5 +1,3 @@ -library stagexl.geom.matrix_3d; - import 'dart:math' as math; import 'dart:typed_data'; diff --git a/lib/src/geom/perspective_projection.dart b/lib/src/geom/perspective_projection.dart index 21d18398..54c2368c 100644 --- a/lib/src/geom/perspective_projection.dart +++ b/lib/src/geom/perspective_projection.dart @@ -1,5 +1,3 @@ -library stagexl.geom.perspective_projection; - import 'matrix_3d.dart'; /// The [PerspectiveProjection] defines the matrix that is used to projection diff --git a/lib/src/geom/point.dart b/lib/src/geom/point.dart index 9b6d1227..4037cb30 100644 --- a/lib/src/geom/point.dart +++ b/lib/src/geom/point.dart @@ -1,5 +1,3 @@ -library stagexl.geom.point; - import 'dart:math' hide Point, Rectangle; import 'dart:math' as math; diff --git a/lib/src/geom/polygon.dart b/lib/src/geom/polygon.dart index 7e002405..b3a00003 100644 --- a/lib/src/geom/polygon.dart +++ b/lib/src/geom/polygon.dart @@ -1,5 +1,3 @@ -library stagexl.geom.polygon; - import 'dart:math' hide Point, Rectangle; import 'point.dart'; diff --git a/lib/src/geom/rectangle.dart b/lib/src/geom/rectangle.dart index 264ab1c8..c9ca61c8 100644 --- a/lib/src/geom/rectangle.dart +++ b/lib/src/geom/rectangle.dart @@ -1,5 +1,3 @@ -library stagexl.geom.rectangle; - import 'dart:math' hide Point, Rectangle; import 'dart:math' as math; diff --git a/lib/src/geom/vector.dart b/lib/src/geom/vector.dart index c39b0e32..8bd282b2 100644 --- a/lib/src/geom/vector.dart +++ b/lib/src/geom/vector.dart @@ -1,5 +1,3 @@ -library stagexl.geom.vector; - import 'dart:math' hide Point, Rectangle; import '../internal/jenkins_hash.dart'; diff --git a/lib/src/internal/audio_loader.dart b/lib/src/internal/audio_loader.dart index 806be307..8a0fbc8d 100644 --- a/lib/src/internal/audio_loader.dart +++ b/lib/src/internal/audio_loader.dart @@ -1,5 +1,3 @@ -library stagexl.internal.audio_loader; - import 'dart:async'; import 'dart:html'; @@ -75,7 +73,7 @@ class AudioLoader { reader.readAsDataUrl(request.response as Blob); reader.onLoadEnd.first .then((e) => _loadAudioSource(reader.result as String)); - }).catchError((error) { + }).catchError((Object error) { final loadError = LoadError('Failed to load $url.', error); aggregateError.errors.add(loadError); _loadNextUrl(); diff --git a/lib/src/internal/environment.dart b/lib/src/internal/environment.dart index 78696d27..688ff67d 100644 --- a/lib/src/internal/environment.dart +++ b/lib/src/internal/environment.dart @@ -1,8 +1,6 @@ -library stagexl.internal.environment; - import 'dart:async'; -import 'dart:js' as js; import 'dart:html'; +import 'dart:js' as js; import 'dart:typed_data'; final bool autoHiDPI = _checkAutoHiDPI(); diff --git a/lib/src/internal/filter_helpers.dart b/lib/src/internal/filter_helpers.dart index 6bdffbf4..776c4229 100644 --- a/lib/src/internal/filter_helpers.dart +++ b/lib/src/internal/filter_helpers.dart @@ -1,5 +1,3 @@ -library stagexl.internal.filter_helpers; - import 'dart:typed_data'; import 'environment.dart' as env; import 'tools.dart'; diff --git a/lib/src/internal/image_bitmap_loader.dart b/lib/src/internal/image_bitmap_loader.dart index dfec4537..cf6c6f9f 100644 --- a/lib/src/internal/image_bitmap_loader.dart +++ b/lib/src/internal/image_bitmap_loader.dart @@ -1,5 +1,3 @@ -library stagexl.internal.image_bitmap_loader; - import 'dart:async'; import 'dart:html'; import 'dart:js_util'; @@ -30,9 +28,9 @@ class ImageBitmapLoader { // Note: Dart SDK does not support createImageBitmap, so // use callMethod and convert from promise to future. // See https://github.com/dart-lang/sdk/issues/12379 - final promise = callMethod(window, 'createImageBitmap', [blob]); - final imageBitmap = - await promiseToFuture(promise as Object); + final promise = + callMethod(window, 'createImageBitmap', [blob]); + final imageBitmap = await promiseToFuture(promise); _completer.complete(imageBitmap); } catch (e) { diff --git a/lib/src/internal/image_loader.dart b/lib/src/internal/image_loader.dart index 1670146f..4b3058c2 100644 --- a/lib/src/internal/image_loader.dart +++ b/lib/src/internal/image_loader.dart @@ -1,5 +1,3 @@ -library stagexl.internal.image_loader; - import 'dart:async'; import 'dart:html'; diff --git a/lib/src/internal/jenkins_hash.dart b/lib/src/internal/jenkins_hash.dart index 1d26f810..2dd7c1be 100644 --- a/lib/src/internal/jenkins_hash.dart +++ b/lib/src/internal/jenkins_hash.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -library stagexl.internal.jenkins_hash; - /* * This is the [Jenkins hash function][1] but using masking to keep * values in SMI range. diff --git a/lib/src/internal/shared_cache.dart b/lib/src/internal/shared_cache.dart index 8eed71cc..861b9317 100644 --- a/lib/src/internal/shared_cache.dart +++ b/lib/src/internal/shared_cache.dart @@ -1,5 +1,3 @@ -library stagexl.internal.shared_cache; - import '../events.dart'; class ObjectReleaseEvent extends Event { diff --git a/lib/src/internal/tools.dart b/lib/src/internal/tools.dart index 95882e25..7ab15c06 100644 --- a/lib/src/internal/tools.dart +++ b/lib/src/internal/tools.dart @@ -1,5 +1,3 @@ -library stagexl.internal.tools; - int colorGetA(int color) => (color >> 24) & 0xFF; int colorGetR(int color) => (color >> 16) & 0xFF; int colorGetG(int color) => (color >> 8) & 0xFF; diff --git a/lib/src/internal/video_loader.dart b/lib/src/internal/video_loader.dart index 153479df..bb141118 100644 --- a/lib/src/internal/video_loader.dart +++ b/lib/src/internal/video_loader.dart @@ -1,5 +1,3 @@ -library stagexl.internal.video_loader; - import 'dart:async'; import 'dart:html'; @@ -71,7 +69,7 @@ class VideoLoader { reader.readAsDataUrl(request.response as Blob); reader.onLoadEnd.first .then((e) => _loadVideoSource(reader.result as String)); - }).catchError((error) { + }).catchError((Object error) { final loadError = LoadError('Failed to load $url.', error); aggregateError.errors.add(loadError); _loadNextUrl(); diff --git a/lib/src/media.dart b/lib/src/media.dart index 8adea284..3079f343 100644 --- a/lib/src/media.dart +++ b/lib/src/media.dart @@ -19,12 +19,12 @@ /// resourceManager.getSound("bingo").play(); /// }); /// -library stagexl.media; +library; import 'dart:async'; import 'dart:convert'; import 'dart:html' as html; -import 'dart:html' show HttpRequest, AudioElement, VideoElement; +import 'dart:html' show AudioElement, HttpRequest, VideoElement; import 'dart:math'; import 'dart:typed_data'; import 'dart:web_audio'; diff --git a/lib/src/media/implementation/audio_element_mixer.dart b/lib/src/media/implementation/audio_element_mixer.dart index c6bd5642..251e21aa 100644 --- a/lib/src/media/implementation/audio_element_mixer.dart +++ b/lib/src/media/implementation/audio_element_mixer.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../../media.dart'; class AudioElementMixer { num _volume = 1.0; diff --git a/lib/src/media/implementation/audio_element_sound.dart b/lib/src/media/implementation/audio_element_sound.dart index af3024ea..06e3dd62 100644 --- a/lib/src/media/implementation/audio_element_sound.dart +++ b/lib/src/media/implementation/audio_element_sound.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../../media.dart'; class AudioElementSound extends Sound { final AudioElement _audioElement; diff --git a/lib/src/media/implementation/audio_element_sound_channel.dart b/lib/src/media/implementation/audio_element_sound_channel.dart index 84446dc9..357fcdb8 100644 --- a/lib/src/media/implementation/audio_element_sound_channel.dart +++ b/lib/src/media/implementation/audio_element_sound_channel.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../../media.dart'; class AudioElementSoundChannel extends SoundChannel { final AudioElementSound _audioElementSound; diff --git a/lib/src/media/implementation/mock_sound.dart b/lib/src/media/implementation/mock_sound.dart index bd004c10..e60fd7e1 100644 --- a/lib/src/media/implementation/mock_sound.dart +++ b/lib/src/media/implementation/mock_sound.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../../media.dart'; class MockSound extends Sound { MockSound._(); diff --git a/lib/src/media/implementation/mock_sound_channel.dart b/lib/src/media/implementation/mock_sound_channel.dart index 60852f4a..721450b6 100644 --- a/lib/src/media/implementation/mock_sound_channel.dart +++ b/lib/src/media/implementation/mock_sound_channel.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../../media.dart'; class MockSoundChannel extends SoundChannel { final MockSound _mockSound; diff --git a/lib/src/media/implementation/web_audio_api_mixer.dart b/lib/src/media/implementation/web_audio_api_mixer.dart index be153266..060da186 100644 --- a/lib/src/media/implementation/web_audio_api_mixer.dart +++ b/lib/src/media/implementation/web_audio_api_mixer.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../../media.dart'; class WebAudioApiMixer { static final AudioContext audioContext = AudioContext(); diff --git a/lib/src/media/implementation/web_audio_api_sound.dart b/lib/src/media/implementation/web_audio_api_sound.dart index fe62b3be..139f8576 100644 --- a/lib/src/media/implementation/web_audio_api_sound.dart +++ b/lib/src/media/implementation/web_audio_api_sound.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../../media.dart'; class WebAudioApiSound extends Sound { final AudioBuffer _audioBuffer; diff --git a/lib/src/media/implementation/web_audio_api_sound_channel.dart b/lib/src/media/implementation/web_audio_api_sound_channel.dart index 90b47650..4c3f0efa 100644 --- a/lib/src/media/implementation/web_audio_api_sound_channel.dart +++ b/lib/src/media/implementation/web_audio_api_sound_channel.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../../media.dart'; class WebAudioApiSoundChannel extends SoundChannel { final WebAudioApiSound _webAudioApiSound; diff --git a/lib/src/media/sound.dart b/lib/src/media/sound.dart index e0283b2a..b91d2c13 100644 --- a/lib/src/media/sound.dart +++ b/lib/src/media/sound.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../media.dart'; abstract class Sound { Sound() { diff --git a/lib/src/media/sound_channel.dart b/lib/src/media/sound_channel.dart index 65151d9c..c5cd7371 100644 --- a/lib/src/media/sound_channel.dart +++ b/lib/src/media/sound_channel.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../media.dart'; abstract class SoundChannel extends EventDispatcher { EventStream get onComplete => on(Event.COMPLETE); diff --git a/lib/src/media/sound_engine.dart b/lib/src/media/sound_engine.dart index 28e09e93..64352622 100644 --- a/lib/src/media/sound_engine.dart +++ b/lib/src/media/sound_engine.dart @@ -1,3 +1,3 @@ -part of stagexl.media; +part of '../media.dart'; enum SoundEngine { WebAudioApi, AudioElement, Mockup } diff --git a/lib/src/media/sound_load_options.dart b/lib/src/media/sound_load_options.dart index 108cc82b..a13cddd9 100644 --- a/lib/src/media/sound_load_options.dart +++ b/lib/src/media/sound_load_options.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../media.dart'; /// The SoundLoadOptions class contains different options to configure /// how audio files are loaded from the server. diff --git a/lib/src/media/sound_mixer.dart b/lib/src/media/sound_mixer.dart index 542f0332..69a286f1 100644 --- a/lib/src/media/sound_mixer.dart +++ b/lib/src/media/sound_mixer.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../media.dart'; class SoundMixer { static SoundEngine? _engineDetected; diff --git a/lib/src/media/sound_transform.dart b/lib/src/media/sound_transform.dart index 708f31e1..80b91ab0 100644 --- a/lib/src/media/sound_transform.dart +++ b/lib/src/media/sound_transform.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../media.dart'; class SoundTransform { num volume; diff --git a/lib/src/media/video.dart b/lib/src/media/video.dart index d0b1f610..bf25404d 100644 --- a/lib/src/media/video.dart +++ b/lib/src/media/video.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../media.dart'; /// The Video class is used to load and control videos. /// diff --git a/lib/src/media/video_load_options.dart b/lib/src/media/video_load_options.dart index 0ef9153c..023f201e 100644 --- a/lib/src/media/video_load_options.dart +++ b/lib/src/media/video_load_options.dart @@ -1,4 +1,4 @@ -part of stagexl.media; +part of '../media.dart'; /// The VideoLoadOptions class contains different options to configure /// how videos are loaded from the server. diff --git a/lib/src/resources.dart b/lib/src/resources.dart index 851c44ec..b8f9ca8e 100644 --- a/lib/src/resources.dart +++ b/lib/src/resources.dart @@ -6,7 +6,7 @@ /// performance of the WebGL renderer). The [SoundSprite] does a similar /// thing for Sounds as the texture altas does for BitmapDatas. /// -library stagexl.resources; +library; import 'dart:async'; import 'dart:convert'; diff --git a/lib/src/resources/resource_manager.dart b/lib/src/resources/resource_manager.dart index 5cbde9bb..79ac5594 100644 --- a/lib/src/resources/resource_manager.dart +++ b/lib/src/resources/resource_manager.dart @@ -1,4 +1,4 @@ -part of stagexl.resources; +part of '../resources.dart'; class ResourceManager { final Map _resourceMap = diff --git a/lib/src/resources/resource_manager_resource.dart b/lib/src/resources/resource_manager_resource.dart index d065a1c6..e70a3d6b 100644 --- a/lib/src/resources/resource_manager_resource.dart +++ b/lib/src/resources/resource_manager_resource.dart @@ -1,4 +1,4 @@ -part of stagexl.resources; +part of '../resources.dart'; class ResourceManagerResource { final String kind; @@ -12,7 +12,7 @@ class ResourceManagerResource { ResourceManagerResource(this.kind, this.name, this.url, Future loader) { loader.then((resource) { _value = resource; - }).catchError((error) { + }).catchError((Object error) { _error = error; }).whenComplete(() { _completer.complete(this); diff --git a/lib/src/resources/sound_sprite.dart b/lib/src/resources/sound_sprite.dart index 986ddd93..c47858d5 100644 --- a/lib/src/resources/sound_sprite.dart +++ b/lib/src/resources/sound_sprite.dart @@ -1,4 +1,4 @@ -part of stagexl.resources; +part of '../resources.dart'; /// A SoundSprite combines multiple audio files into a single audio file. /// diff --git a/lib/src/resources/sound_sprite_segment.dart b/lib/src/resources/sound_sprite_segment.dart index 1543ff73..9950377d 100644 --- a/lib/src/resources/sound_sprite_segment.dart +++ b/lib/src/resources/sound_sprite_segment.dart @@ -1,4 +1,4 @@ -part of stagexl.resources; +part of '../resources.dart'; class SoundSpriteSegment { final SoundSprite soundSprite; diff --git a/lib/src/resources/sprite_sheet.dart b/lib/src/resources/sprite_sheet.dart index 91d4483a..1a777d46 100644 --- a/lib/src/resources/sprite_sheet.dart +++ b/lib/src/resources/sprite_sheet.dart @@ -1,4 +1,4 @@ -part of stagexl.resources; +part of '../resources.dart'; class SpriteSheet { int width; diff --git a/lib/src/resources/texture_atlas.dart b/lib/src/resources/texture_atlas.dart index dd6a660b..04566010 100644 --- a/lib/src/resources/texture_atlas.dart +++ b/lib/src/resources/texture_atlas.dart @@ -1,4 +1,4 @@ -part of stagexl.resources; +part of '../resources.dart'; class TextureAtlas { /// A list with the frames in this texture atlas. diff --git a/lib/src/resources/texture_atlas_format.dart b/lib/src/resources/texture_atlas_format.dart index bafffba5..66aff692 100644 --- a/lib/src/resources/texture_atlas_format.dart +++ b/lib/src/resources/texture_atlas_format.dart @@ -1,4 +1,4 @@ -part of stagexl.resources; +part of '../resources.dart'; abstract class TextureAtlasFormat { static const TextureAtlasFormat JSON = _TextureAtlasFormatJson(); diff --git a/lib/src/resources/texture_atlas_format_json.dart b/lib/src/resources/texture_atlas_format_json.dart index 8a28a278..233f6884 100644 --- a/lib/src/resources/texture_atlas_format_json.dart +++ b/lib/src/resources/texture_atlas_format_json.dart @@ -1,4 +1,4 @@ -part of stagexl.resources; +part of '../resources.dart'; class _TextureAtlasFormatJson extends TextureAtlasFormat { const _TextureAtlasFormatJson(); diff --git a/lib/src/resources/texture_atlas_format_libgdx.dart b/lib/src/resources/texture_atlas_format_libgdx.dart index 75ddb233..c5c0f48d 100644 --- a/lib/src/resources/texture_atlas_format_libgdx.dart +++ b/lib/src/resources/texture_atlas_format_libgdx.dart @@ -1,4 +1,4 @@ -part of stagexl.resources; +part of '../resources.dart'; class _TextureAtlasFormatLibGDX extends TextureAtlasFormat { const _TextureAtlasFormatLibGDX(); diff --git a/lib/src/resources/texture_atlas_format_starling_json.dart b/lib/src/resources/texture_atlas_format_starling_json.dart index 3ba784a9..42935a09 100644 --- a/lib/src/resources/texture_atlas_format_starling_json.dart +++ b/lib/src/resources/texture_atlas_format_starling_json.dart @@ -1,4 +1,4 @@ -part of stagexl.resources; +part of '../resources.dart'; class _TextureAtlasFormatStarlingJson extends TextureAtlasFormat { const _TextureAtlasFormatStarlingJson(); diff --git a/lib/src/resources/texture_atlas_format_starling_xml.dart b/lib/src/resources/texture_atlas_format_starling_xml.dart index 5f0581c8..6d724d20 100644 --- a/lib/src/resources/texture_atlas_format_starling_xml.dart +++ b/lib/src/resources/texture_atlas_format_starling_xml.dart @@ -1,4 +1,4 @@ -part of stagexl.resources; +part of '../resources.dart'; class _TextureAtlasFormatStarlingXml extends TextureAtlasFormat { const _TextureAtlasFormatStarlingXml(); diff --git a/lib/src/resources/texture_atlas_frame.dart b/lib/src/resources/texture_atlas_frame.dart index fddf0afe..4c4455ab 100644 --- a/lib/src/resources/texture_atlas_frame.dart +++ b/lib/src/resources/texture_atlas_frame.dart @@ -1,4 +1,4 @@ -part of stagexl.resources; +part of '../resources.dart'; class TextureAtlasFrame { final TextureAtlas textureAtlas; diff --git a/lib/src/resources/texture_atlas_loader.dart b/lib/src/resources/texture_atlas_loader.dart index deee041c..20664697 100644 --- a/lib/src/resources/texture_atlas_loader.dart +++ b/lib/src/resources/texture_atlas_loader.dart @@ -1,4 +1,4 @@ -part of stagexl.resources; +part of '../resources.dart'; /// The base class for a custom texture atlas loader. /// diff --git a/lib/src/text.dart b/lib/src/text.dart index 058b9679..1db9cdeb 100644 --- a/lib/src/text.dart +++ b/lib/src/text.dart @@ -6,10 +6,10 @@ /// you can add it the display list. Use the [TextFormat] class to change /// the color, size, margin, style and more of your texts. /// -library stagexl.text; +library; import 'dart:html' as html; -import 'dart:html' show CanvasElement, CanvasRenderingContext2D, CanvasGradient; +import 'dart:html' show CanvasElement, CanvasGradient, CanvasRenderingContext2D; import 'dart:math' hide Point, Rectangle; import 'display.dart'; diff --git a/lib/src/text/font_style_metrics.dart b/lib/src/text/font_style_metrics.dart index fd6461ca..c9323b99 100644 --- a/lib/src/text/font_style_metrics.dart +++ b/lib/src/text/font_style_metrics.dart @@ -1,4 +1,4 @@ -part of stagexl.text; +part of '../text.dart'; final Map _fontStyleMetrics = {}; diff --git a/lib/src/text/text_field.dart b/lib/src/text/text_field.dart index 8adac2dd..d155635a 100644 --- a/lib/src/text/text_field.dart +++ b/lib/src/text/text_field.dart @@ -1,6 +1,6 @@ // ignore_for_file: prefer_interpolation_to_compose_strings, use_string_buffers -part of stagexl.text; +part of '../text.dart'; class TextField extends InteractiveObject { String _text = ''; diff --git a/lib/src/text/text_field_auto_size.dart b/lib/src/text/text_field_auto_size.dart index 2f77c8f3..aa764011 100644 --- a/lib/src/text/text_field_auto_size.dart +++ b/lib/src/text/text_field_auto_size.dart @@ -1,4 +1,4 @@ -part of stagexl.text; +part of '../text.dart'; class TextFieldAutoSize { static const String CENTER = 'center'; diff --git a/lib/src/text/text_field_type.dart b/lib/src/text/text_field_type.dart index d967b7e2..0c692bbe 100644 --- a/lib/src/text/text_field_type.dart +++ b/lib/src/text/text_field_type.dart @@ -1,4 +1,4 @@ -part of stagexl.text; +part of '../text.dart'; class TextFieldType { static const String DYNAMIC = 'dynamic'; diff --git a/lib/src/text/text_format.dart b/lib/src/text/text_format.dart index 9d83555f..1a8adfa1 100644 --- a/lib/src/text/text_format.dart +++ b/lib/src/text/text_format.dart @@ -1,4 +1,4 @@ -part of stagexl.text; +part of '../text.dart'; class TextFormat { String font; diff --git a/lib/src/text/text_format_align.dart b/lib/src/text/text_format_align.dart index 4c4f9eba..37422ac7 100644 --- a/lib/src/text/text_format_align.dart +++ b/lib/src/text/text_format_align.dart @@ -1,4 +1,4 @@ -part of stagexl.text; +part of '../text.dart'; class TextFormatAlign { static const String CENTER = 'center'; diff --git a/lib/src/text/text_line_metrics.dart b/lib/src/text/text_line_metrics.dart index a0e54686..e1e433aa 100644 --- a/lib/src/text/text_line_metrics.dart +++ b/lib/src/text/text_line_metrics.dart @@ -1,4 +1,4 @@ -part of stagexl.text; +part of '../text.dart'; class TextLineMetrics { final String _text; diff --git a/lib/src/ui.dart b/lib/src/ui.dart index 8e24960f..4b5f4e7c 100644 --- a/lib/src/ui.dart +++ b/lib/src/ui.dart @@ -5,8 +5,7 @@ /// /// Use the list of color values defined in [Color] to have /// easy access to the ARGB values of different colors. - -library stagexl.ui; +library; export 'ui/align.dart'; export 'ui/color.dart'; diff --git a/lib/src/ui/align.dart b/lib/src/ui/align.dart index 8ba52dd2..c57b1ba9 100644 --- a/lib/src/ui/align.dart +++ b/lib/src/ui/align.dart @@ -1,5 +1,3 @@ -library stagexl.ui.align; - enum HorizontalAlign { Left, Center, Right } enum VerticalAlign { Top, Center, Bottom } diff --git a/lib/src/ui/color.dart b/lib/src/ui/color.dart index 0d4589ad..6c268b78 100644 --- a/lib/src/ui/color.dart +++ b/lib/src/ui/color.dart @@ -1,7 +1,6 @@ -library stagexl.ui.color; - /// Use the list of color values defined in [Color] to have /// easy access to the ARGB values of different colors. +library; class Color { static const int AliceBlue = 0xFFF0F8FF; diff --git a/lib/src/ui/mouse.dart b/lib/src/ui/mouse.dart index b62a4e54..e52dd447 100644 --- a/lib/src/ui/mouse.dart +++ b/lib/src/ui/mouse.dart @@ -1,5 +1,3 @@ -library stagexl.ui.mouse; - import 'dart:async'; import 'dart:math'; diff --git a/lib/stagexl.dart b/lib/stagexl.dart index ce761f70..c1f651c2 100644 --- a/lib/stagexl.dart +++ b/lib/stagexl.dart @@ -1,5 +1,3 @@ -library stagexl; - //========================================================== // StageXL Library Hierarchy (bottom-up) //========================================================== diff --git a/pubspec.yaml b/pubspec.yaml index ad7ef8df..5c654ae1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ homepage: http://www.stagexl.org repository: https://github.com/bp74/StageXL environment: - sdk: '^3.0.0' + sdk: ^3.0.0 documentation: http://www.stagexl.org/docs/api/index.html @@ -16,5 +16,5 @@ dev_dependencies: build_runner: any build_test: any build_web_compilers: any - lints: any + dart_flutter_team_lints: any test: any diff --git a/test/display/bitmap_data_test.dart b/test/display/bitmap_data_test.dart index d87a3110..b8e5efae 100644 --- a/test/display/bitmap_data_test.dart +++ b/test/display/bitmap_data_test.dart @@ -1,5 +1,5 @@ @TestOn('browser') -library bitmap_data_test; +library; import 'package:stagexl/stagexl.dart'; import 'package:test/test.dart'; diff --git a/test/engine/render_texture_quad_test.dart b/test/engine/render_texture_quad_test.dart index f1fbb88a..6e1485c9 100644 --- a/test/engine/render_texture_quad_test.dart +++ b/test/engine/render_texture_quad_test.dart @@ -1,7 +1,8 @@ @TestOn('browser') -library render_texture_quad_test; +library; import 'dart:typed_data'; + import 'package:stagexl/stagexl.dart'; import 'package:test/test.dart'; diff --git a/test/events/events_test.dart b/test/events/events_test.dart index cce7ddb5..3c0f0ae1 100644 --- a/test/events/events_test.dart +++ b/test/events/events_test.dart @@ -1,5 +1,5 @@ @TestOn('browser') -library events_test; +library; import 'package:stagexl/stagexl.dart'; import 'package:test/test.dart'; diff --git a/test/geom/matrix_test.dart b/test/geom/matrix_test.dart index 7f6b3c98..c36069b6 100644 --- a/test/geom/matrix_test.dart +++ b/test/geom/matrix_test.dart @@ -1,7 +1,8 @@ @TestOn('browser') -library matrix_test; +library; import 'dart:math'; + import 'package:stagexl/stagexl.dart'; import 'package:test/test.dart'; diff --git a/test/geom/point_test.dart b/test/geom/point_test.dart index cdde521d..23ce9237 100644 --- a/test/geom/point_test.dart +++ b/test/geom/point_test.dart @@ -1,5 +1,5 @@ @TestOn('browser') -library point_test; +library; import 'package:stagexl/stagexl.dart'; import 'package:test/test.dart'; diff --git a/test/geom/rectangle_test.dart b/test/geom/rectangle_test.dart index d237fe0f..d7a2d2e5 100644 --- a/test/geom/rectangle_test.dart +++ b/test/geom/rectangle_test.dart @@ -1,5 +1,5 @@ @TestOn('browser') -library rectangle_test; +library; import 'package:stagexl/stagexl.dart'; import 'package:test/test.dart'; diff --git a/test/geom/vector_test.dart b/test/geom/vector_test.dart index cf7af43f..d90609b5 100644 --- a/test/geom/vector_test.dart +++ b/test/geom/vector_test.dart @@ -1,7 +1,8 @@ @TestOn('browser') -library vector_test; +library; import 'dart:math'; + import 'package:stagexl/stagexl.dart'; import 'package:test/test.dart'; diff --git a/test/util/image_bitmap_test.dart b/test/util/image_bitmap_test.dart index 63cdae0b..4b3502ce 100644 --- a/test/util/image_bitmap_test.dart +++ b/test/util/image_bitmap_test.dart @@ -1,5 +1,5 @@ @TestOn('browser') -library image_bitmap_test; +library; import 'dart:html' show ImageBitmap; import 'dart:math' show pi; diff --git a/test/util/spritesheet_test.dart b/test/util/spritesheet_test.dart index 6cf635c1..8937bdad 100644 --- a/test/util/spritesheet_test.dart +++ b/test/util/spritesheet_test.dart @@ -1,5 +1,5 @@ @TestOn('browser') -library spritesheet_test; +library; import 'package:stagexl/stagexl.dart'; import 'package:test/test.dart';