factory static method

Future factory({
  1. String market = 'std',
  2. String? host,
  3. int? port,
  4. bool autoRetry = true,
  5. Duration timeout = const Duration(seconds: 15),
})

Create a Quotes instance. market - 'std' for standard market (stocks), 'ext' for extended market.

Implementation

static Future<dynamic> factory({
  String market = 'std',
  String? host,
  int? port,
  bool autoRetry = true,
  Duration timeout = const Duration(seconds: 15),
}) async {
  if (market == 'ext') {
    return ExtQuotes.connect(
      host: host,
      port: port,
      autoRetry: autoRetry,
      timeout: timeout,
    );
  }

  return StdQuotes.connect(
    host: host,
    port: port,
    autoRetry: autoRetry,
    timeout: timeout,
  );
}