customAction method

  1. @override
Parser customAction()

Implementation

@override
Parser customAction() => super.customAction().map((each) {
      final e = each as List;
      final date = e.first as DateTime;
      final type = e.elementAt(2).toString().replaceAll('"', '');
      final values = e.elementAt(3) as List;
      final comment = e.elementAt(4) as String;
      final metadata = e.elementAt(5) as Map<String, MetaValue>;

      switch (type) {
        case 'budget':
          return CustomAction.budget(
            date: date,
            values: values,
            comment: comment,
            metadata: metadata,
          );
        case 'custom':
        default:
          return CustomAction.custom(
            date: date,
            type: type,
            values: values,
            comment: comment,
            metadata: metadata,
          );
      }
    });