WeatherMeasure class

Specify the configuration on how to collect weather data. Needs an apiKey for the OpenWeatherMap API.

Inheritance
  • Object
  • Serializable
  • Measure
  • PeriodicMeasure
  • WeatherMeasure
Annotations
  • @JsonSerializable(fieldRename: FieldRename.snake, includeIfNull: false)

Constructors

WeatherMeasure(MeasureType type, { dynamic name, dynamic enabled, dynamic frequency, dynamic duration, String apiKey })
WeatherMeasure.fromJson(Map<String, dynamic> json)
factory

Properties

apiKey String
API key for the OpenWeatherMap API.
read / write
c__ String
The runtime class name (type) of this object. Used for deserialization from JSON objects.
read / write, inherited
configuration Map<String, String>
A key-value map holding any application-specific configuration.
read / write, inherited
duration int
The sampling duration in milliseconds.
read / write, inherited
enabled bool
Whether the measure is enabled - i.e. collecting data - when the study is running. A measure is enabled as default.
read / write, inherited
frequency int
Sampling frequency in milliseconds (i.e., delay between sampling).
read / write, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
name String
A printer-friendly name for this measure.
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
type ↔ MeasureType
The type of measure to do.
read / write, inherited

Methods

toJson() Map<String, dynamic>
Return a JSON encoding of this object.
override
adapt(Measure measure) → void
Adapt this Measure to a new value specified in measure.
inherited
addMeasureListener(MeasureListener listener) → void
Add a MeasureListener to this Measure.
inherited
getConfiguration(String key) String
Get value from the configuration for this measure.
inherited
hasChanged() Future<void>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
registerFromJson(Function fromJsonFunction) → dynamic
Use this method to register a custom fromJson function for this class in the FromJsonFactory.
inherited
removeMeasureListener(MeasureListener listener) → void
Remove a MeasureListener to this Measure.
inherited
restore() → void
Restore this Measure to its original value before adapt was called. [...]
inherited
setConfiguration(String key, String configuration) → void
Add a key-value pair as configuration for this measure.
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Static Properties

fromJsonFunction Function
read-only, override

Constants

DEFAULT_WEATHER_API_KEY → const String
'12b6e28582eb9298577c734a31ba9f4f'