mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-06-26 17:56:28 +08:00
Regenerated cleaned up code that happily runs through flutter analyze.
This commit is contained in:
@ -19,9 +19,4 @@ class KeyFrameDrawOrderValue extends KeyFrameDrawOrderValueBase {
|
||||
drawable.drawOrder = value;
|
||||
}
|
||||
}
|
||||
|
||||
int runtimeValueValue(int editorValue) {
|
||||
assert(false, 'this should never get called');
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +0,0 @@
|
||||
// ignore: one_member_abstracts
|
||||
abstract class BoundsDelegate {
|
||||
void boundsChanged();
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:rive/src/rive_core/bounds_delegate.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/container_component.dart';
|
||||
import 'package:rive/src/rive_core/math/mat2d.dart';
|
||||
@ -11,7 +10,6 @@ export 'package:rive/src/generated/node_base.dart';
|
||||
class Node extends NodeBase {
|
||||
final Mat2D transform = Mat2D();
|
||||
final Mat2D worldTransform = Mat2D();
|
||||
BoundsDelegate _delegate;
|
||||
double _renderOpacity = 0;
|
||||
double get renderOpacity => _renderOpacity;
|
||||
@override
|
||||
@ -60,16 +58,6 @@ class Node extends NodeBase {
|
||||
} else {
|
||||
Mat2D.copy(worldTransform, transform);
|
||||
}
|
||||
_delegate?.boundsChanged();
|
||||
}
|
||||
|
||||
@override
|
||||
void userDataChanged(dynamic from, dynamic to) {
|
||||
if (to is BoundsDelegate) {
|
||||
_delegate = to;
|
||||
} else {
|
||||
_delegate = null;
|
||||
}
|
||||
}
|
||||
|
||||
void calculateWorldTransform() {
|
||||
|
@ -16,6 +16,11 @@ class CubicAsymmetricVertex extends CubicAsymmetricVertexBase {
|
||||
cos(rotation) * outDistance, sin(rotation) * outDistance));
|
||||
}
|
||||
|
||||
@override
|
||||
set outPoint(Vec2D value) {
|
||||
_outPoint = Vec2D.clone(value);
|
||||
}
|
||||
|
||||
@override
|
||||
Vec2D get inPoint {
|
||||
return _inPoint ??= Vec2D.add(
|
||||
@ -25,6 +30,11 @@ class CubicAsymmetricVertex extends CubicAsymmetricVertexBase {
|
||||
cos(rotation) * -inDistance, sin(rotation) * -inDistance));
|
||||
}
|
||||
|
||||
@override
|
||||
set inPoint(Vec2D value) {
|
||||
_inPoint = Vec2D.clone(value);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'in ${inPoint[0]}, ${inPoint[1]} | ${translation.toString()} '
|
||||
|
@ -28,6 +28,7 @@ class CubicDetachedVertex extends CubicDetachedVertexBase {
|
||||
translation,
|
||||
Vec2D.fromValues(
|
||||
cos(outRotation) * outDistance, sin(outRotation) * outDistance));
|
||||
@override
|
||||
set outPoint(Vec2D value) {
|
||||
_outPoint = Vec2D.clone(value);
|
||||
}
|
||||
@ -38,6 +39,7 @@ class CubicDetachedVertex extends CubicDetachedVertexBase {
|
||||
translation,
|
||||
Vec2D.fromValues(
|
||||
cos(inRotation) * inDistance, sin(inRotation) * inDistance));
|
||||
@override
|
||||
set inPoint(Vec2D value) {
|
||||
_inPoint = Vec2D.clone(value);
|
||||
}
|
||||
|
@ -13,12 +13,23 @@ class CubicMirroredVertex extends CubicMirroredVertexBase {
|
||||
Vec2D.fromValues(cos(rotation) * distance, sin(rotation) * distance));
|
||||
}
|
||||
|
||||
@override
|
||||
set outPoint(Vec2D value) {
|
||||
_outPoint = Vec2D.clone(value);
|
||||
}
|
||||
|
||||
@override
|
||||
Vec2D get inPoint {
|
||||
return _inPoint ??= Vec2D.add(Vec2D(), translation,
|
||||
Vec2D.fromValues(cos(rotation) * -distance, sin(rotation) * -distance));
|
||||
}
|
||||
|
||||
@override
|
||||
set inPoint(Vec2D value) {
|
||||
var diffIn = Vec2D.fromValues(value[0] - x, value[1] - y);
|
||||
outPoint = Vec2D.subtract(Vec2D(), translation, diffIn);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'in ${inPoint[0]}, ${inPoint[1]} | ${translation.toString()} '
|
||||
|
@ -4,4 +4,6 @@ import 'package:rive/src/generated/shapes/cubic_vertex_base.dart';
|
||||
abstract class CubicVertex extends CubicVertexBase {
|
||||
Vec2D get outPoint;
|
||||
Vec2D get inPoint;
|
||||
set outPoint(Vec2D value);
|
||||
set inPoint(Vec2D value);
|
||||
}
|
||||
|
@ -1,15 +1,10 @@
|
||||
import 'dart:ui' as ui;
|
||||
import 'package:rive/src/rive_core/component.dart';
|
||||
import 'package:rive/src/rive_core/container_component.dart';
|
||||
import 'package:rive/src/generated/shapes/paint/gradient_stop_base.dart';
|
||||
import 'package:rive/src/rive_core/shapes/paint/linear_gradient.dart';
|
||||
export 'package:rive/src/generated/shapes/paint/gradient_stop_base.dart';
|
||||
|
||||
class GradientStop extends GradientStopBase {
|
||||
Component get timelineParent =>
|
||||
_gradient is LinearGradient ? _gradient.parent : null;
|
||||
String get timelineName =>
|
||||
'Stop ${_gradient.gradientStops.indexOf(this) + 1}';
|
||||
LinearGradient _gradient;
|
||||
LinearGradient get gradient => _gradient;
|
||||
ui.Color get color => ui.Color(colorValue);
|
||||
|
@ -10,7 +10,6 @@ export 'package:rive/src/generated/shapes/paint/linear_gradient_base.dart';
|
||||
|
||||
class LinearGradient extends LinearGradientBase with ShapePaintMutator {
|
||||
final List<GradientStop> gradientStops = [];
|
||||
Component get timelineProxy => parent;
|
||||
bool _paintsInWorldSpace = true;
|
||||
bool get paintsInWorldSpace => _paintsInWorldSpace;
|
||||
set paintsInWorldSpace(bool value) {
|
||||
|
@ -21,7 +21,6 @@ abstract class ShapePaint extends ShapePaintBase {
|
||||
set blendMode(BlendMode value) => _paint.blendMode = value;
|
||||
double get renderOpacity => _paintMutator.renderOpacity;
|
||||
set renderOpacity(double value) => _paintMutator.renderOpacity = value;
|
||||
Component get timelineParent => _shapePaintContainer as Component;
|
||||
ShapePaintMutator get paintMutator => _paintMutator;
|
||||
void _changeMutator(ShapePaintMutator mutator) {
|
||||
_paint = makePaint();
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'dart:ui';
|
||||
import 'package:rive/src/rive_core/component.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/shapes/paint/shape_paint_mutator.dart';
|
||||
import 'package:rive/src/rive_core/shapes/shape_paint_container.dart';
|
||||
@ -7,7 +6,6 @@ import 'package:rive/src/generated/shapes/paint/solid_color_base.dart';
|
||||
export 'package:rive/src/generated/shapes/paint/solid_color_base.dart';
|
||||
|
||||
class SolidColor extends SolidColorBase with ShapePaintMutator {
|
||||
Component get timelineProxy => parent;
|
||||
Color get color => Color(colorValue);
|
||||
set color(Color c) {
|
||||
colorValue = c.value;
|
||||
|
@ -11,7 +11,6 @@ class Stroke extends StrokeBase {
|
||||
..strokeCap = strokeCap
|
||||
..strokeJoin = strokeJoin
|
||||
..strokeWidth = thickness;
|
||||
String get timelineParentGroup => 'strokes';
|
||||
StrokeCap get strokeCap => StrokeCap.values[cap];
|
||||
set strokeCap(StrokeCap value) => cap = value.index;
|
||||
StrokeJoin get strokeJoin => StrokeJoin.values[join];
|
||||
|
@ -1,6 +1,5 @@
|
||||
import 'dart:math';
|
||||
import 'dart:ui' as ui;
|
||||
import 'package:rive/src/rive_core/bounds_delegate.dart';
|
||||
import 'package:rive/src/rive_core/component.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/math/aabb.dart';
|
||||
@ -31,27 +30,12 @@ abstract class Path extends PathBase {
|
||||
Mat2D get pathTransform;
|
||||
Mat2D get inversePathTransform;
|
||||
Mat2D get inverseWorldTransform => _inverseWorldTransform;
|
||||
Component get timelineParent => _shape;
|
||||
@override
|
||||
bool resolveArtboard() {
|
||||
_changeShape(null);
|
||||
return super.resolveArtboard();
|
||||
}
|
||||
|
||||
BoundsDelegate _delegate;
|
||||
void markBoundsDirty() {
|
||||
_delegate?.boundsChanged();
|
||||
}
|
||||
|
||||
@override
|
||||
void userDataChanged(dynamic from, dynamic to) {
|
||||
if (to is BoundsDelegate) {
|
||||
_delegate = to;
|
||||
} else {
|
||||
_delegate = null;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void visitAncestor(Component ancestor) {
|
||||
if (_shape == null && ancestor is Shape) {
|
||||
|
@ -1,16 +1,11 @@
|
||||
import 'dart:collection';
|
||||
import 'package:rive/src/rive_core/math/vec2d.dart';
|
||||
import 'package:rive/src/rive_core/shapes/cubic_vertex.dart';
|
||||
import 'package:rive/src/utilities/binary_buffer/binary_writer.dart';
|
||||
|
||||
class RenderCubicVertex extends CubicVertex {
|
||||
void changeNonNull() {}
|
||||
@override
|
||||
Vec2D inPoint;
|
||||
@override
|
||||
Vec2D outPoint;
|
||||
@override
|
||||
void onAddedDirty() {}
|
||||
void writeRuntimeProperties(
|
||||
BinaryWriter writer, HashMap<int, int> idLookup) {}
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
import 'dart:ui';
|
||||
import 'package:rive/src/rive_core/bounds_delegate.dart';
|
||||
import 'package:rive/src/rive_core/component.dart';
|
||||
import 'package:rive/src/rive_core/component_dirt.dart';
|
||||
import 'package:rive/src/rive_core/math/aabb.dart';
|
||||
@ -34,17 +33,12 @@ class Shape extends ShapeBase with ShapePaintContainer {
|
||||
|
||||
AABB _worldBounds;
|
||||
AABB _localBounds;
|
||||
BoundsDelegate _delegate;
|
||||
@override
|
||||
AABB get worldBounds => _worldBounds ??= computeWorldBounds();
|
||||
@override
|
||||
AABB get localBounds => _localBounds ??= computeLocalBounds();
|
||||
void markBoundsDirty() {
|
||||
_worldBounds = _localBounds = null;
|
||||
_delegate?.boundsChanged();
|
||||
for (final path in paths) {
|
||||
path.markBoundsDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@ -202,15 +196,6 @@ class Shape extends ShapeBase with ShapePaintContainer {
|
||||
return localBounds;
|
||||
}
|
||||
|
||||
@override
|
||||
void userDataChanged(dynamic from, dynamic to) {
|
||||
if (to is BoundsDelegate) {
|
||||
_delegate = to;
|
||||
} else {
|
||||
_delegate = null;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void blendModeValueChanged(int from, int to) => _markBlendModeDirty();
|
||||
@override
|
||||
|
Reference in New Issue
Block a user