LogViewerStrings class

Log viewer strings. English by default.

Viewer widgets (LogViewerPage, LogFilterSheet, LogEntryDetailsPage) find the strings via LogViewerStrings.of, like MaterialLocalizations, so they need not be passed to every widget and are available in modal sheets and on pages opened via Navigator alike. Without configuration the English strings are used. To translate, add LogViewerStringsDelegate to the app's localizationsDelegates:

MaterialApp(
  localizationsDelegates: [
    LogViewerStringsDelegate((locale) => switch (locale.languageCode) {
      'de' => const LogViewerStrings(title: 'Protokoll', retry: 'Wiederholen'),
      _ => const LogViewerStrings(),
    }),
    ...GlobalMaterialLocalizations.delegates,
  ],
);
Annotations

Constructors

LogViewerStrings({String title = 'Logs', String loadFailed = 'Failed to load logs', String loadMoreFailed = 'Failed to load older logs', String retry = 'Retry', String empty = 'Nothing to display', String removeFilter = 'Remove filter', String search = 'Search', String levelFilter = 'Log level:', String tagFilter = 'Tags:', String export = 'Export', String exportFailed = 'Export failed', String entryTitle = 'Logged event', String level = 'Level', String date = 'Date', String message = 'Body', String location = 'Code location', String error = 'Error', String stackTrace = 'Stack', String levelName(LogLevel level) = _defaultLevelName})
const
LogViewerStrings.of(BuildContext context)
Strings from Localizations for context, or English if LogViewerStringsDelegate is not installed.
factory

Properties

date → String
final
empty → String
No entry matched the filter.
final
entryTitle → String
Title of the entry page when it has no tags.
final
error → String
final
export → String
Tooltip of the log export button and its failure message.
final
exportFailed → String
final
hashCode → int
The hash code for this object.
no setterinherited
level → String
final
levelFilter → String
final
levelName → String Function(LogLevel level)
Level name in the filter and on the entry page.
final
loadFailed → String
final
loadMoreFailed → String
final
location → String
final
message → String
final
removeFilter → String
final
retry → String
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
Hint in the entry text search field.
final
stackTrace → String
final
tagFilter → String
final
title → String
Title of the entry list.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited