algebraicDataTypes function

Builder algebraicDataTypes(
  1. BuilderOptions options
)

Supports package:build_runner creation and configuration of adt.

Not meant to be invoked by hand-authored code.

Implementation

Builder algebraicDataTypes(BuilderOptions options) {
  try {
    return adtPartBuilder();
  } on Exception catch (e) {
    final lines = <String>['Could not parse the options provided for `adt`.'];
    /*
    if (e.key != null) {
      lines.add('There is a problem with "${e.key}".');
    }
    if (e.message != null) {
      lines.add(e.message!);
    } else if (e.innerError != null) {
      lines.add(e.innerError.toString());
    }*/

    throw StateError(lines.join('\n'));
  }
}