WaterRecord class

A class representing a water consumption record.

Constructors

WaterRecord({int? id, int createdAt = 0})
Constructs a WaterRecord instance with optional parameters.
factory
WaterRecord.fromJson(Map<String, dynamic> json)
Constructs a WaterRecord instance from a JSON map.
factory

Properties

createdAt int
The timestamp indicating when the water record was created.
final
hashCode int
Overrides the hashCode method.
no setteroverride
id int?
The unique identifier of the water record.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({int? id, double? waterConsumption, int? createdAt}) WaterRecord
Creates a copy of the WaterRecord instance with optional parameter overrides.
getWater({MeasurementSystem? unit}) double
Retrieves the amount of water consumed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setWater(double water, MeasurementSystem unit) → void
Sets the amount of water consumed.
toJson() Map<String, dynamic>
Converts the WaterRecord instance to a JSON map.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
Overrides the equality operator.
override