Cost class abstract

A variant of Amount that also includes a date and a label.

Annotations
  • @freezed

Constructors

Cost({Money? value, DateTime? date, String? label})
Absolute cost: {{amount, date, label}} {{10.00 BRL, 2020-11-19, "lot-A"}} Per unit cost: {amount, date, label} {10.00 BRL, 2020-11-19, "lot-A"}
factory
Cost.def({Money? value, DateTime? date, String? label})
factory

Properties

copyWith → $CostCopyWith<Cost>
no setterinherited
date DateTime?
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
label String?
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify String
no setter
value → Money?
no setterinherited

Methods

balance(DateTime tansactionDate, Money positionUnit) Cost
map<TResult extends Object?>({required TResult def(_Cost value)}) → TResult
inherited
mapOrNull<TResult extends Object?>({TResult? def(_Cost value)?}) → TResult?
inherited
maybeMap<TResult extends Object?>({TResult def(_Cost value)?, required TResult orElse()}) → TResult
inherited
maybeWhen<TResult extends Object?>({TResult def(Money? value, DateTime? date, String? label)?, required TResult orElse()}) → TResult
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult def(Money? value, DateTime? date, String? label)}) → TResult
inherited
whenOrNull<TResult extends Object?>({TResult? def(Money? value, DateTime? date, String? label)?}) → TResult?
inherited

Operators

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