Skip to content

Commit

Permalink
Missed a <CR> as EOF in a some dart files, failing static analysis.
Browse files Browse the repository at this point in the history
## [1.0.12]

- Missed a <CR> as EOF in a some dart files, failing static analysis.
  • Loading branch information
Roi Peker committed Mar 24, 2023
1 parent 9526b98 commit 332518d
Show file tree
Hide file tree
Showing 26 changed files with 98 additions and 58 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
## [1.0.12]

- Missed a <CR> 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]
Expand Down
6 changes: 4 additions & 2 deletions example/lib/demos/altitude_indicator/scene.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand Down
4 changes: 2 additions & 2 deletions example/lib/demos/breakout/scene/game_scene.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 3 additions & 9 deletions example/lib/demos/card_rotation/scene.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class CardRotation3dScene extends GSprite {
Future<void> 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);
Expand All @@ -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;
Expand All @@ -60,12 +60,6 @@ class CardRotation3dScene extends GSprite {
image.x = -30;
image.y = (144 - 120) / 2;







var logo = GSprite();
cardItem.addChild(logo);
logo.graphics
Expand Down
13 changes: 8 additions & 5 deletions example/lib/demos/color_picker/color_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
),
],
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ColorfulShadersScene extends GSprite {
@override
Future<void> 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.");
Expand Down
5 changes: 4 additions & 1 deletion example/lib/demos/drawing_pad_bezier/drawing_pad/point.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion example/lib/demos/drawing_pad_bezier/drawing_pad_bezier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
],
),
),
Expand Down
8 changes: 6 additions & 2 deletions example/lib/demos/expander_fab_menu/expander_fab_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@ class _MyMenuState extends State<MyMenu> 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,
Expand Down
23 changes: 19 additions & 4 deletions example/lib/demos/fun/fun.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}();

Expand All @@ -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);
Expand All @@ -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();
Expand All @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion example/lib/demos/heart_reaction/heart_reaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
7 changes: 4 additions & 3 deletions example/lib/demos/nokia_snake/game_scene.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand Down
1 change: 0 additions & 1 deletion example/lib/demos/page_indicator/dot.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'package:graphx/graphx.dart';

class PageDot extends GShape {
Expand Down
21 changes: 14 additions & 7 deletions example/lib/demos/run_hero_canvas/run_hero_canvas.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,20 @@ class RunHeroScene extends GSprite {

Future<void> _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();
Expand Down
3 changes: 2 additions & 1 deletion example/lib/demos/simple_toast/simple_toast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class _MyHomePageState extends State<MyHomePage> {
'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(),
},
);
}
Expand Down
9 changes: 7 additions & 2 deletions example/lib/demos/svg_icons/test_svg_scene.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions example/lib/demos/xmas/xmas_scene.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand All @@ -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;
}
}

Expand Down
3 changes: 2 additions & 1 deletion example/lib/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <Scene>[
Expand Down
2 changes: 1 addition & 1 deletion example/lib/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
export 'system_utils.dart';
2 changes: 1 addition & 1 deletion lib/src/extensions/extensions.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export 'display_object_extensions.dart';
export 'graphics_extensions.dart';
export 'graphics_extensions.dart';
1 change: 0 additions & 1 deletion lib/src/input/mouse.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion lib/src/render/icon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 1 addition & 3 deletions lib/src/tween/src/extensions/filter_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -220,4 +218,4 @@ extension GTweenGlowFilterExt on GlowFilter {
startAt: startAt,
);
}
}
}
Loading

0 comments on commit 332518d

Please sign in to comment.