operator [] abstract method

Name operator [](
  1. dynamic name
)

Returns a single object from a Names collection.

final Workbook workbook = Workbook();
final Worksheet sheet1 = workbook.worksheets[0];
worksheet.getRangeByName('A1:D4').setText('Hello');
final Range range1 = worksheet.getRangeByName('A1:C1');
final Range range2 = worksheet.getRangeByName('A2:C2');
workbook.names.add('Title', range1);
worksheet.names.add('Body', range2);
final Name? namedrange1 = workbook.names[0];
final Name? namedrange2 = worksheet.names['Body'];
final List<int> bytes = workbook.saveAsStream();
saveAsExcel(bytes, 'AddNamedRange.xlsx');
workbook.dispose();

Implementation

Name operator [](dynamic name);