Options constructor
Options({
- double tension = 0.45,
- double width = 50,
- double height = 20,
- double hoverFactor = -0.3,
- double gap = 5,
- double forceFactor = 0.15,
- double forceFactorBuild = 1,
- double forceFactorOnTap = 1,
- List<
LayerModel> ? layers, - List<
TouchModel> ? touches, - List<
int> ? layerNumbers, - List<
double> ? scaleOptionLayer, - double noise = 0,
Designer with liquid widget settings
Implementation
Options({
this.tension = 0.45,
this.width = 50,
this.height = 20,
this.hoverFactor = -0.3,
this.gap = 5,
this.forceFactor = 0.15,
this.forceFactorBuild = 1,
this.forceFactorOnTap = 1,
List<LayerModel>? layers,
List<TouchModel>? touches,
/// To draw layers
List<int>? layerNumbers,
/// Scale object size at each level, independent of layer order
List<double>? scaleOptionLayer,
this.noise = 0,
}) : layers = layers ??
[
LayerModel(
points: [],
viscosity: 0.5,
touchForce: 100,
forceLimit: 2,
),
LayerModel(
points: [],
viscosity: 0.8,
touchForce: 150,
forceLimit: 3,
),
],
touches = touches ?? [] {
this.layerNumbers = layerNumbers ?? List.generate(this.layers.length, (index) => index);
layerScales = scaleOptionLayer ?? List.generate(this.layers.length, (index) => 1.0);
}