fromFile static method
SwaggerUI
fromFile(
- File fileSchema, {
- String title = 'API Swagger',
- DocExpansion docExpansion = DocExpansion.list,
- SyntaxHighlightTheme syntaxHighlightTheme = SyntaxHighlightTheme.agate,
- bool deepLink = false,
- 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,
);
}