StacDuration class

A Stac model representing Flutter's Duration class.

Represents a span of time with various time units.

StacDuration(
  days: 1,
  hours: 2,
  minutes: 30,
  seconds: 45,
  milliseconds: 500,
)
{
  "days": 1,
  "hours": 2,
  "minutes": 30,
  "seconds": 45,
  "milliseconds": 500,
  "microseconds": 0
}
Inheritance
Annotations
  • @JsonSerializable()

Constructors

StacDuration.new({int? days, int? hours, int? minutes, int? seconds, int? milliseconds, int? microseconds})
Creates a StacDuration with the given time components.
const
StacDuration.fromJson(Map<String, dynamic> json)
Creates a StacDuration from JSON.
factory

Properties

days int?
The number of days in this duration.
final
hashCode int
The hash code for this object.
no setterinherited
hours int?
The number of hours in this duration.
final
microseconds int?
The number of microseconds in this duration.
final
milliseconds int?
The number of milliseconds in this duration.
final
minutes int?
The number of minutes in this duration.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seconds int?
The number of seconds in this duration.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this duration to JSON.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited