mirror of
https://github.com/flutter/holobooth.git
synced 2025-08-24 07:01:02 +08:00
refactor: removed .fromVector constructor
This commit is contained in:
@ -18,7 +18,7 @@ class PhotoboothBackground extends StatelessWidget {
|
||||
return BackgroundAnimation(
|
||||
x: avatar.direction.x,
|
||||
y: avatar.direction.y,
|
||||
z: avatar.distance,
|
||||
z: 0,
|
||||
backgroundSelected: backgroundSelected,
|
||||
);
|
||||
}
|
||||
|
@ -13,18 +13,6 @@ class BackgroundAnimation extends StatefulWidget {
|
||||
required this.backgroundSelected,
|
||||
});
|
||||
|
||||
BackgroundAnimation.fromVector3(
|
||||
Vector3 direction, {
|
||||
Key? key,
|
||||
required Background backgroundSelected,
|
||||
}) : this(
|
||||
key: key,
|
||||
x: direction.x,
|
||||
y: direction.y,
|
||||
z: direction.z,
|
||||
backgroundSelected: backgroundSelected,
|
||||
);
|
||||
|
||||
final double x;
|
||||
final double y;
|
||||
final double z;
|
||||
|
@ -15,8 +15,10 @@ void main() {
|
||||
home: StatefulBuilder(
|
||||
builder: (context, setState) {
|
||||
stateSetter = setState;
|
||||
return BackgroundAnimation.fromVector3(
|
||||
vector3,
|
||||
return BackgroundAnimation(
|
||||
x: vector3.x,
|
||||
y: vector3.y,
|
||||
z: vector3.z,
|
||||
backgroundSelected: background,
|
||||
);
|
||||
},
|
||||
|
Reference in New Issue
Block a user