styleFor<T extends FdcExportFormatStyle> method

T? styleFor<T extends FdcExportFormatStyle>(
  1. FdcExportFormat format
)

Returns the style registered for format, when it matches T.

Implementation

T? styleFor<T extends FdcExportFormatStyle>(FdcExportFormat format) {
  final direct = format.id == 'pdf' ? pdf : null;
  if (direct is T) {
    return direct;
  }
  final style = formats[format];
  return style is T ? style : null;
}