ApiEndpoint constructor

ApiEndpoint({
  1. required int id,
  2. void handler(
    1. Socket socket,
    2. Uint8List data
    )?,
})

Create a new ApiEndpoint given an id and an optional handler.

Implementation

ApiEndpoint({
  required this.id,
  this.handler,
}) {
  if (id < 0) {
    throw ArgumentError('Must not be negative', 'id');
  }
}