CloudConfig constructor

  1. @JsonSerializable(converters: [ColorSerializer()])
const CloudConfig({
  1. @Default(250.0) double size,
  2. @Default(Color.fromARGB(170, 255, 255, 255)) Color color,
  3. @Default(Icons.cloud_rounded) @JsonKey(ignore: true) IconData icon,
  4. @JsonKey(ignore: true) Widget? widgetCloud,
  5. @Default(70.0) double x,
  6. @Default(5.0) double y,
  7. @Default(1.0) double scaleBegin,
  8. @Default(1.1) double scaleEnd,
  9. @Default(Curves.fastOutSlowIn) @JsonKey(ignore: true) Curve scaleCurve,
  10. @Default(11.0) double slideX,
  11. @Default(5.0) double slideY,
  12. @Default(2000) int slideDurMill,
  13. @Default(Curves.fastOutSlowIn) @JsonKey(ignore: true) Curve slideCurve,
})

Implementation

@JsonSerializable(converters: [ColorSerializer()])
const factory CloudConfig({
  /// Cloud size.
  @Default(250.0) double size,

  /// The color of the cloud.
  @Default(Color.fromARGB(170, 255, 255, 255)) Color color,

  /// Cloud icon. You can use a custom widget [widgetCloud].
  @Default(Icons.cloud_rounded) @JsonKey(ignore: true) IconData icon,

  /// Specify the cloud widget. In this case, the fields [icon] and
  /// [color] be ignored.
  @JsonKey(ignore: true) Widget? widgetCloud,

  /// The coordinate of cloud displacement along the x-axis (in pixels).
  @Default(70.0) double x,

  /// The coordinate of cloud displacement along the x-axis (in pixels).
  @Default(5.0) double y,

  /// The scale factor of the widget at the beginning of the animation.
  @Default(1.0) double scaleBegin,

  /// The scale factor of the widget at the end of the animation.
  @Default(1.1) double scaleEnd,

  /// Animation curve for [ScaleTransition].
  @Default(Curves.fastOutSlowIn) @JsonKey(ignore: true) Curve scaleCurve,

  /// Offset of the widget along the X-axis during the slide animation (in pixels).
  @Default(11.0) double slideX,

  /// Offset of the widget along the Y-axis during the slide animation (in pixels).
  @Default(5.0) double slideY,

  /// Shift duration (in milliseconds).
  @Default(2000) int slideDurMill,

  /// Animation curve for [SlideTransition].
  @Default(Curves.fastOutSlowIn) @JsonKey(ignore: true) Curve slideCurve,
}) = _CloudConfig;