Move files to src and comply with the dart package layout convention (#621)

* 👌 Use `Offset` type directly in `JoystickAction.update` calculations (#631)

* Move files to src and comply with the dart package layout convention

* Fixing widgets example

Co-authored-by: Serge Matveenko <lig@countzero.co>
Co-authored-by: Erick Zanardo <erickzanardoo@gmail.com>
This commit is contained in:
Renan
2021-01-20 09:05:43 -03:00
committed by GitHub
parent a8ef5cadea
commit ccee9a466b
146 changed files with 1232 additions and 1275 deletions

View File

@ -0,0 +1,20 @@
import 'dart:math';
import 'dart:ui';
import 'vector2.dart';
export 'dart:ui' show Size;
extension SizeExtension on Size {
/// Creates an [Offset] from the [Size]
Offset toOffset() => Offset(width, height);
/// Creates a [Vector2] from the [Size]
Vector2 toVector2() => Vector2(width, height);
/// Creates a [Point] from the [Size]
Point toPoint() => Point(width, height);
/// Creates a [Rect] from the [Size]
Rect toRect() => Rect.fromLTWH(0, 0, width, height);
}