staticFieldDefinitions property

List<FieldDefinition> staticFieldDefinitions
final

Implementation

static final List<FieldDefinition> staticFieldDefinitions = [
  FieldDefinition(
    'route_id',
    (dataset, header, records) => true,
    type: const IdFieldType(displayName: 'Route ID'),
    primaryKey: true,
  ),
  FieldDefinition(
    'agency_id',
    (dataset, header, records) async =>
        await dataset.agencies.count() > 1 ? true : null,
    type: const IdFieldType(displayName: 'Agency ID'),
  ),
  FieldDefinition(
    'route_short_name',
    (dataset, header, records) => null,
    shouldBeRequired:
        (dataset, header, record) =>
            (record['route_long_name']?.isEmpty ?? true) ? true : null,
    type: const TextFieldType(),
  ),
  FieldDefinition(
    'route_long_name',
    (dataset, header, records) => null,
    shouldBeRequired:
        (dataset, header, record) =>
            (record['route_short_name']?.isEmpty ?? true) ? true : null,
    type: const TextFieldType(),
  ),
  FieldDefinition(
    'route_desc',
    (dataset, header, records) => null,
    type: const TextFieldType(),
  ),
  FieldDefinition(
    'route_type',
    (dataset, header, records) => true,
    type: routeType,
  ),
  FieldDefinition(
    'route_url',
    (dataset, header, records) => null,
    type: const UrlFieldType(),
  ),
  FieldDefinition(
    'route_color',
    (dataset, header, records) => null,
    type: const ColorFieldType(),
    defaultValue: 'FFFFFF',
  ),
  FieldDefinition(
    'route_text_color',
    (dataset, header, records) => null,
    type: const ColorFieldType(),
    defaultValue: '000000',
  ),
  FieldDefinition(
    'route_sort_order',
    (dataset, header, records) => null,
    type: const IntegerFieldType(NumberConstraint.nonNegative),
  ),
  // TODO: Check for stop_times.start/end_pickup_drop_off_window and see reference
  FieldDefinition(
    'continuous_pickup',
    (dataset, header, records) => null,
    type: continuousPickup,
    defaultValue: '1',
  ),
  FieldDefinition(
    'continuous_drop_off',
    (dataset, header, records) => null,
    type: continuousDropOff,
    defaultValue: '1',
  ),
  FieldDefinition(
    'network_id',
    (dataset, header, records) =>
        dataset.fileNameList.contains('route_networks.txt') ? false : null,
    type: const IdFieldType(displayName: 'Network ID'),
  ),
];