Operation constructor

Operation(
  1. dynamic book, {
  2. dynamic name,
  3. dynamic date,
  4. dynamic cplus,
  5. dynamic cminus,
  6. dynamic desc,
  7. dynamic cur,
  8. dynamic valuta,
  9. dynamic mod,
})

Constructor to initialize the operation.

Takes a Book and optional parameters like name, date, and other attributes.

Implementation

Operation(book, {name, date, cplus, cminus, desc, cur, valuta, mod}) {
  this.name = (name != null && name.isNotEmpty) ? name : "unknowntag";
  this.book = (book != null) ? book : Book();
  //assume we got a oneliner!
  if ((cplus != null))
    add(
        date: date,
        cplus: cplus,
        cminus: cminus,
        desc: desc,
        cur: cur,
        valuta: valuta,
        mod: mod);
}