diff --git a/CHANGELOG.md b/CHANGELOG.md index c10612c..916202e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ +## [1.0.12] + +- Missed a as EOF in a some dart files, failing static analysis. + ## [1.0.11] + - remove private constructors to pass Dart's static analysis ## [1.0.10] diff --git a/example/lib/demos/altitude_indicator/scene.dart b/example/lib/demos/altitude_indicator/scene.dart index 873ab8f..eb7b3a7 100644 --- a/example/lib/demos/altitude_indicator/scene.dart +++ b/example/lib/demos/altitude_indicator/scene.dart @@ -143,8 +143,10 @@ class AltitudIndicatorScene extends GSprite { /// center pivot in the drawn object. rotatorCircle.alignPivot(); - var sky = buildBox(const Color(0xff3D84A9), innerCircleSize, innerCircleSize); - var ground = buildBox(const Color(0xff493F42), innerCircleSize, innerCircleSize); + var sky = + buildBox(const Color(0xff3D84A9), innerCircleSize, innerCircleSize); + var ground = + buildBox(const Color(0xff493F42), innerCircleSize, innerCircleSize); var line = buildBox(kColorWhite, innerCircleSize, 2); sky.alignPivot(Alignment.bottomCenter); diff --git a/example/lib/demos/ball_line_collision/ball_line_collision.dart b/example/lib/demos/ball_line_collision/ball_line_collision.dart index 5e38aa0..84d3531 100644 --- a/example/lib/demos/ball_line_collision/ball_line_collision.dart +++ b/example/lib/demos/ball_line_collision/ball_line_collision.dart @@ -17,7 +17,10 @@ class BallVsLineMain extends StatelessWidget { decoration: const BoxDecoration( // color: Color.fromARGB(255, 176, 209, 234), gradient: LinearGradient( - colors: [Color.fromARGB(255, 6, 4, 96), Color.fromARGB(255, 143, 212, 238)], + colors: [ + Color.fromARGB(255, 6, 4, 96), + Color.fromARGB(255, 143, 212, 238) + ], begin: Alignment.topCenter, end: Alignment.bottomCenter, ), diff --git a/example/lib/demos/breakout/scene/game_scene.dart b/example/lib/demos/breakout/scene/game_scene.dart index 994c000..b355229 100644 --- a/example/lib/demos/breakout/scene/game_scene.dart +++ b/example/lib/demos/breakout/scene/game_scene.dart @@ -285,8 +285,8 @@ class BreakoutAtari extends GSprite { } } - for (var b in removeBricks) { - bricks.remove(b); + for (var b in removeBricks) { + bricks.remove(b); } // removeBricks.forEach(bricks.remove); removeBricks.clear(); diff --git a/example/lib/demos/card_rotation/scene.dart b/example/lib/demos/card_rotation/scene.dart index f3b9e52..57c0133 100644 --- a/example/lib/demos/card_rotation/scene.dart +++ b/example/lib/demos/card_rotation/scene.dart @@ -18,8 +18,8 @@ class CardRotation3dScene extends GSprite { Future initUi() async { var photoTexture = await ResourceLoader.loadTexture('assets/card_rotation/photo.png'); - var logoTexture = await ResourceLoader.loadTexture( - 'assets/card_rotation/mcdonalds.png'); + var logoTexture = + await ResourceLoader.loadTexture('assets/card_rotation/mcdonalds.png'); var cardItem = GSprite(); addChild(cardItem); @@ -45,7 +45,7 @@ class CardRotation3dScene extends GSprite { .drawRoundRect(0, 0, 120, 120, 20) .endFill(); - if(SystemUtils.usingSkia){ + if (SystemUtils.usingSkia) { var bmp = GBitmap(photoTexture); bmp.height = 120; bmp.scaleX = bmp.scaleY; @@ -60,12 +60,6 @@ class CardRotation3dScene extends GSprite { image.x = -30; image.y = (144 - 120) / 2; - - - - - - var logo = GSprite(); cardItem.addChild(logo); logo.graphics diff --git a/example/lib/demos/color_picker/color_picker.dart b/example/lib/demos/color_picker/color_picker.dart index aab4fef..cff160e 100644 --- a/example/lib/demos/color_picker/color_picker.dart +++ b/example/lib/demos/color_picker/color_picker.dart @@ -48,14 +48,17 @@ class ColorPickerMain extends StatelessWidget { children: [ const SizedBox(width: 12), TextButton( - child: const Text('graphx gist', style: TextStyle(fontSize: 12)), - onPressed: () => - trace('https://gist.github.com/roipeker/6e7d5b30f6b022196bc98e2db14676a2'), + child: + const Text('graphx gist', style: TextStyle(fontSize: 12)), + onPressed: () => trace( + 'https://gist.github.com/roipeker/6e7d5b30f6b022196bc98e2db14676a2'), ), const VerticalDivider(), TextButton( - child: const Text('original workshop', style: TextStyle(fontSize: 12)), - onPressed: () => trace('https://www.youtube.com/watch?v=HURA4DKjA1c'), + child: const Text('original workshop', + style: TextStyle(fontSize: 12)), + onPressed: () => + trace('https://www.youtube.com/watch?v=HURA4DKjA1c'), ), ], ), diff --git a/example/lib/demos/colorful_shaders/colorful_shaders_scene.dart b/example/lib/demos/colorful_shaders/colorful_shaders_scene.dart index dfdf454..1eb8c81 100644 --- a/example/lib/demos/colorful_shaders/colorful_shaders_scene.dart +++ b/example/lib/demos/colorful_shaders/colorful_shaders_scene.dart @@ -18,7 +18,7 @@ class ColorfulShadersScene extends GSprite { @override Future addedToStage() async { stage!.color = Colors.black; - stage!.maskBounds = true ; + stage!.maskBounds = true; if (kIsWeb) { trace("This particular GLSL shader is not supported (currently) on web."); diff --git a/example/lib/demos/drawing_pad_bezier/drawing_pad/point.dart b/example/lib/demos/drawing_pad_bezier/drawing_pad/point.dart index 3d3c742..02d0a8a 100644 --- a/example/lib/demos/drawing_pad_bezier/drawing_pad/point.dart +++ b/example/lib/demos/drawing_pad_bezier/drawing_pad/point.dart @@ -21,7 +21,10 @@ class PadPoint { @override // ignore: avoid_equals_and_hash_code_on_mutable_classes bool operator ==(Object other) { - return other is PadPoint && other.time == time && other.x == x && other.y == y; + return other is PadPoint && + other.time == time && + other.x == x && + other.y == y; } @override diff --git a/example/lib/demos/drawing_pad_bezier/drawing_pad_bezier.dart b/example/lib/demos/drawing_pad_bezier/drawing_pad_bezier.dart index a97326f..af36366 100644 --- a/example/lib/demos/drawing_pad_bezier/drawing_pad_bezier.dart +++ b/example/lib/demos/drawing_pad_bezier/drawing_pad_bezier.dart @@ -22,7 +22,8 @@ class DrawingPadBezierMain extends StatelessWidget { ), ), ), - const Positioned(left: 0, right: 0, bottom: 0, child: PadSettings()), + const Positioned( + left: 0, right: 0, bottom: 0, child: PadSettings()), ], ), ), diff --git a/example/lib/demos/expander_fab_menu/expander_fab_menu.dart b/example/lib/demos/expander_fab_menu/expander_fab_menu.dart index 9466964..44b5465 100644 --- a/example/lib/demos/expander_fab_menu/expander_fab_menu.dart +++ b/example/lib/demos/expander_fab_menu/expander_fab_menu.dart @@ -91,9 +91,13 @@ class _MyMenuState extends State with TickerProviderStateMixin { Expanded(child: widget.child!), Container( height: 60, - decoration: const BoxDecoration(color: Colors.white, boxShadow: [ + decoration: + const BoxDecoration(color: Colors.white, boxShadow: [ BoxShadow( - color: Colors.black38, blurRadius: 12, offset: Offset(0, -1), spreadRadius: 2) + color: Colors.black38, + blurRadius: 12, + offset: Offset(0, -1), + spreadRadius: 2) ]), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, diff --git a/example/lib/demos/fun/fun.dart b/example/lib/demos/fun/fun.dart index ffced74..236880f 100644 --- a/example/lib/demos/fun/fun.dart +++ b/example/lib/demos/fun/fun.dart @@ -91,7 +91,10 @@ class FunScene extends GSprite { final shape = GShape(); final grx = shape.graphics; - grx.beginFill(const Color.fromARGB(255, 246, 104, 104)).drawCircle(0, 0, 20).endFill(); + grx + .beginFill(const Color.fromARGB(255, 246, 104, 104)) + .drawCircle(0, 0, 20) + .endFill(); return shape; }(); @@ -108,7 +111,11 @@ class FunScene extends GSprite { .endFill(); // Eyes - grx.beginFill(Colors.black).drawEllipse(-20, -20, 4, 8).drawEllipse(20, -20, 4, 8).endFill(); + grx + .beginFill(Colors.black) + .drawEllipse(-20, -20, 4, 8) + .drawEllipse(20, -20, 4, 8) + .endFill(); /// mouth grx.lineStyle(2).moveTo(-16, 32).lineTo(16, 32); @@ -129,7 +136,11 @@ class FunScene extends GSprite { .endFill(); // Eyes - grx.beginFill(Colors.black).drawEllipse(-16, -8, 4, 4).drawEllipse(16, -8, 4, 4).endFill(); + grx + .beginFill(Colors.black) + .drawEllipse(-16, -8, 4, 4) + .drawEllipse(16, -8, 4, 4) + .endFill(); // mouth grx.lineStyle(2).arc(0, 5, 16, deg2rad(45), deg2rad(90)).endFill(); @@ -150,7 +161,11 @@ class FunScene extends GSprite { .endFill(); // Eyes - grx.beginFill(Colors.black).drawEllipse(-16, -8, 3, 10).drawEllipse(16, -8, 3, 10).endFill(); + grx + .beginFill(Colors.black) + .drawEllipse(-16, -8, 3, 10) + .drawEllipse(16, -8, 3, 10) + .endFill(); // mouth grx.lineStyle(2).arc(0, 36, 16, deg2rad(45 + 180), deg2rad(90)).endFill(); diff --git a/example/lib/demos/heart_reaction/heart_reaction.dart b/example/lib/demos/heart_reaction/heart_reaction.dart index 3aad513..b063bd3 100644 --- a/example/lib/demos/heart_reaction/heart_reaction.dart +++ b/example/lib/demos/heart_reaction/heart_reaction.dart @@ -27,7 +27,9 @@ class HeartReactionMain extends StatelessWidget { return FloatingActionButton( key: _key, onPressed: event.type == 'like' ? null : () => mps.emit('like'), - backgroundColor: event.type == 'like' ? Theme.of(context).disabledColor : Colors.red, + backgroundColor: event.type == 'like' + ? Theme.of(context).disabledColor + : Colors.red, disabledElevation: 0, elevation: 6, child: SvgPicture.string( diff --git a/example/lib/demos/nokia_snake/game_scene.dart b/example/lib/demos/nokia_snake/game_scene.dart index 5621595..d2ebd37 100644 --- a/example/lib/demos/nokia_snake/game_scene.dart +++ b/example/lib/demos/nokia_snake/game_scene.dart @@ -147,8 +147,8 @@ class SnakeGameScene extends GSprite { final inflation = isPulsing ? 0.0 : -2.0; final outRect = foodRect.clone().inflate(inflation, inflation); - graphics.drawCircle( - outRect.x + outRect.width / 2, outRect.y + outRect.height / 2, outRect.width / 2); + graphics.drawCircle(outRect.x + outRect.width / 2, + outRect.y + outRect.height / 2, outRect.width / 2); graphics.endFill(); graphics.endFill(); @@ -169,7 +169,8 @@ class SnakeGameScene extends GSprite { return false; } - double randomFood(double min, double max) => Math.randomRangeClamp(min, max, tileSize); + double randomFood(double min, double max) => + Math.randomRangeClamp(min, max, tileSize); void generateFood() { isBig = score % 8 == 0 && score > 0; diff --git a/example/lib/demos/page_indicator/dot.dart b/example/lib/demos/page_indicator/dot.dart index c3a83db..5e7b9ad 100644 --- a/example/lib/demos/page_indicator/dot.dart +++ b/example/lib/demos/page_indicator/dot.dart @@ -1,4 +1,3 @@ - import 'package:graphx/graphx.dart'; class PageDot extends GShape { diff --git a/example/lib/demos/run_hero_canvas/run_hero_canvas.dart b/example/lib/demos/run_hero_canvas/run_hero_canvas.dart index 28acfda..b702e9f 100644 --- a/example/lib/demos/run_hero_canvas/run_hero_canvas.dart +++ b/example/lib/demos/run_hero_canvas/run_hero_canvas.dart @@ -31,13 +31,20 @@ class RunHeroScene extends GSprite { Future _init() async { GTextureUtils.resolution = 2; - await ResourceLoader.loadTexture('assets/run_hero/parallax/layer_01.png', 2, 'l1'); - await ResourceLoader.loadTexture('assets/run_hero/parallax/layer_02.png', 2, 'l2'); - await ResourceLoader.loadTexture('assets/run_hero/parallax/layer_03.png', 2, 'l3'); - await ResourceLoader.loadTexture('assets/run_hero/parallax/layer_04.png', 2, 'l4'); - await ResourceLoader.loadTexture('assets/run_hero/parallax/layer_05.png', 2, 'l5'); - await ResourceLoader.loadGif('assets/run_hero/run_outline.gif', cacheId: 'hero'); - await ResourceLoader.loadGif('assets/run_hero/midair_outline.gif', cacheId: 'hero_air'); + await ResourceLoader.loadTexture( + 'assets/run_hero/parallax/layer_01.png', 2, 'l1'); + await ResourceLoader.loadTexture( + 'assets/run_hero/parallax/layer_02.png', 2, 'l2'); + await ResourceLoader.loadTexture( + 'assets/run_hero/parallax/layer_03.png', 2, 'l3'); + await ResourceLoader.loadTexture( + 'assets/run_hero/parallax/layer_04.png', 2, 'l4'); + await ResourceLoader.loadTexture( + 'assets/run_hero/parallax/layer_05.png', 2, 'l5'); + await ResourceLoader.loadGif('assets/run_hero/run_outline.gif', + cacheId: 'hero'); + await ResourceLoader.loadGif('assets/run_hero/midair_outline.gif', + cacheId: 'hero_air'); // var program = await ui.FragmentProgram.fromAsset('shaders/blur.glsl'); // shader = program.fragmentShader(); diff --git a/example/lib/demos/simple_toast/simple_toast.dart b/example/lib/demos/simple_toast/simple_toast.dart index 542900f..1d3734e 100644 --- a/example/lib/demos/simple_toast/simple_toast.dart +++ b/example/lib/demos/simple_toast/simple_toast.dart @@ -39,7 +39,8 @@ class _MyHomePageState extends State { 'text': tec.text == '' ? 'No messege' : tec.text, 'color': Colors.red, 'bottomInset': MediaQuery.of(context).viewInsets.bottom, - 'onMouseClick': (MouseInputData event) => tec.text = event.localX.toString(), + 'onMouseClick': (MouseInputData event) => + tec.text = event.localX.toString(), }, ); } diff --git a/example/lib/demos/svg_icons/test_svg_scene.dart b/example/lib/demos/svg_icons/test_svg_scene.dart index b6295c6..be16d91 100644 --- a/example/lib/demos/svg_icons/test_svg_scene.dart +++ b/example/lib/demos/svg_icons/test_svg_scene.dart @@ -145,7 +145,8 @@ class TestSvgScene extends GSprite { var px = Math.randomRange(10, stage!.stageWidth - 10); leaf.setPosition(px, -10); - final rndPivot = Math.randomBool() ? Alignment.bottomCenter : Alignment.topCenter; + final rndPivot = + Math.randomBool() ? Alignment.bottomCenter : Alignment.topCenter; leaf.alignPivot(rndPivot); leaf.scale = Math.randomRange(.4, 1); @@ -186,7 +187,11 @@ class TestSvgScene extends GSprite { ); final randomX = Math.randomRange(5, 40) * dir; final randomY = Math.randomRange(5, 30); - leaf.tween(duration: randomDuration * .9, x: '$randomX', y: '$randomY', ease: GEase.linear); + leaf.tween( + duration: randomDuration * .9, + x: '$randomX', + y: '$randomY', + ease: GEase.linear); } /// utils for parsing SVG. diff --git a/example/lib/demos/xmas/xmas_scene.dart b/example/lib/demos/xmas/xmas_scene.dart index 3da206f..1295022 100644 --- a/example/lib/demos/xmas/xmas_scene.dart +++ b/example/lib/demos/xmas/xmas_scene.dart @@ -33,7 +33,8 @@ class SnowScene extends GSprite { ); return flake; }); - _snowDirectionTimer = Timer.periodic(const Duration(milliseconds: 900), (timer) { + _snowDirectionTimer = + Timer.periodic(const Duration(milliseconds: 900), (timer) { _snowDirectionTimer = timer; _changeSnowDirection(); }); @@ -48,8 +49,8 @@ class SnowScene extends GSprite { void _changeSnowDirection() { /// flip the x velocity direction of each snowflake every 2 seconds. - for (var flake in flakes) { - flake.velX *= -1; + for (var flake in flakes) { + flake.velX *= -1; } } diff --git a/example/lib/model.dart b/example/lib/model.dart index 707570a..fe4584a 100644 --- a/example/lib/model.dart +++ b/example/lib/model.dart @@ -4,7 +4,8 @@ import 'demos/demos.dart'; import 'utils/utils.dart'; extension GitUrl on String { - String get git => 'https://github.com/roipeker/graphx/tree/master/example/lib/demos/$this'; + String get git => + 'https://github.com/roipeker/graphx/tree/master/example/lib/demos/$this'; } final demos = [ diff --git a/example/lib/utils/utils.dart b/example/lib/utils/utils.dart index 7b2e926..1277239 100644 --- a/example/lib/utils/utils.dart +++ b/example/lib/utils/utils.dart @@ -4,4 +4,4 @@ export 'package:graphx/graphx.dart' show SceneBuilderWidget; export 'base_scene.dart'; export 'demo_scene_widget.dart'; export 'svg_utils.dart'; -export 'system_utils.dart'; \ No newline at end of file +export 'system_utils.dart'; diff --git a/lib/src/extensions/extensions.dart b/lib/src/extensions/extensions.dart index c5fe4c5..9b556f3 100644 --- a/lib/src/extensions/extensions.dart +++ b/lib/src/extensions/extensions.dart @@ -1,2 +1,2 @@ export 'display_object_extensions.dart'; -export 'graphics_extensions.dart'; \ No newline at end of file +export 'graphics_extensions.dart'; diff --git a/lib/src/input/mouse.dart b/lib/src/input/mouse.dart index 75a963b..6c62e02 100644 --- a/lib/src/input/mouse.dart +++ b/lib/src/input/mouse.dart @@ -3,7 +3,6 @@ import '../../graphx.dart'; /// "Static" class for managing system mouse cursors. /// Accessible from `pointer_manager.dart` abstract class GMouse { - /// The current system mouse cursor. static SystemMouseCursor _cursor = SystemMouseCursors.basic; diff --git a/lib/src/render/icon.dart b/lib/src/render/icon.dart index 1675147..5123872 100644 --- a/lib/src/render/icon.dart +++ b/lib/src/render/icon.dart @@ -192,7 +192,6 @@ class GIcon extends GDisplayObject { variations.weight = weight; } - /// (Internal usage) /// Applies the current paint to the [canvas], drawing the glyph using a /// [ui.Paint] object, updating it if necessary. diff --git a/lib/src/tween/src/extensions/filter_types.dart b/lib/src/tween/src/extensions/filter_types.dart index 43d66fd..2e6caa2 100644 --- a/lib/src/tween/src/extensions/filter_types.dart +++ b/lib/src/tween/src/extensions/filter_types.dart @@ -3,7 +3,6 @@ part of gtween; /// An extension of [GBlurFilter] to create tween animations for the blur /// filter. extension GTweenBlurFilterExt on GBlurFilter { - /// Returns a [GTweenableBlur] instance of the blur filter. GTweenableBlur get twn { return GTweenableBlur(this); @@ -161,7 +160,6 @@ extension GTweenDropShadowFilterExt on GDropShadowFilter { /// Extension on [GlowFilter] providing a getter for [GTweenableGlowFilter] /// and a tween method to tween the properties of the glow filter. extension GTweenGlowFilterExt on GlowFilter { - /// Returns a [GTweenableGlowFilter] that can be animated with GTween. GTweenableGlowFilter get twn { return GTweenableGlowFilter(this); @@ -220,4 +218,4 @@ extension GTweenGlowFilterExt on GlowFilter { startAt: startAt, ); } -} \ No newline at end of file +} diff --git a/lib/src/tween/src/extensions/geom_types.dart b/lib/src/tween/src/extensions/geom_types.dart index f1ca105..6181d87 100644 --- a/lib/src/tween/src/extensions/geom_types.dart +++ b/lib/src/tween/src/extensions/geom_types.dart @@ -7,7 +7,6 @@ part of gtween; /// returns a [GTweenableColor] object that can be used to create GTween /// animations. extension GTweenColorExt on Color { - /// Returns a [GTweenableColor] instance that can be used to animate the /// properties of this point with a [GTween] animation. GTweenableColor get twn { @@ -22,7 +21,6 @@ extension GTweenColorExt on Color { /// returns a [GTweenablePoint] object that can be used to create GTween /// animations. extension GTweenPointExt on GPoint { - /// Returns a [GTweenablePoint] instance that can be used to animate the /// properties of this point with a [GTween] animation. GTweenablePoint get twn { @@ -37,7 +35,6 @@ extension GTweenPointExt on GPoint { /// returns a [GTweenableRect] object that can be used to create GTween /// animations. extension GTweenRectExt on GRect { - /// Returns a [GTweenableRect] object that wraps this [GRect] instance, /// allowing it to be used with GTween animations. Use this to animate /// the properties of the rectangle, such as its position, size, and anchor diff --git a/pubspec.yaml b/pubspec.yaml index 216fe6d..86d44eb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: graphx description: Render API on top of CustomPainter to power-up your Flutter apps to the next level. -version: 1.0.11 +version: 1.0.12 homepage: https://github.com/roipeker/graphx environment: