fromFile static method

SwaggerUI fromFile(
  1. File fileSchema, {
  2. String title = 'API Swagger',
  3. DocExpansion docExpansion = DocExpansion.list,
  4. SyntaxHighlightTheme syntaxHighlightTheme = SyntaxHighlightTheme.agate,
  5. bool deepLink = false,
  6. bool persistAuthorization = false,
})

Implementation

static SwaggerUI fromFile(
  File fileSchema, {
  String title = 'API Swagger',
  DocExpansion docExpansion = DocExpansion.list,
  SyntaxHighlightTheme syntaxHighlightTheme = SyntaxHighlightTheme.agate,
  bool deepLink = false,
  bool persistAuthorization = false,
}) {
  return SwaggerUI(
    fileSchema.readAsStringSync(),
    title: title,
    specType: fileSchema.path.endsWith('.yaml') ? SpecType.yaml : SpecType.json,
    docExpansion: docExpansion,
    syntaxHighlightTheme: syntaxHighlightTheme,
    deepLink: deepLink,
    persistAuthorization: persistAuthorization,
  );
}