Skip to content

Commit

Permalink
Update offline_data.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
polina-c committed Apr 25, 2024
1 parent 98ec6a4 commit bb82f00
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/devtools_app/lib/src/shared/offline_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ mixin OfflineScreenControllerMixin<T> on AutoDisposeControllerMixin {
/// Each screen controller that mixes in [OfflineScreenControllerMixin] is
/// responsible for setting up the data models and feeding the data to the
/// screen for offline viewing - that should occur in this method.
///
/// Returns true if offline data was loaded, false otherwise.
@protected
Future<void> maybeLoadOfflineData(
Future<bool> maybeLoadOfflineData(
String screenId, {
required T Function(Map<String, Object?> json) createData,
required bool Function(T data) shouldLoad,
Expand All @@ -157,8 +159,10 @@ mixin OfflineScreenControllerMixin<T> on AutoDisposeControllerMixin {
_loadingOfflineData.value = true;
await loadData(screenData);
_loadingOfflineData.value = false;
return true;
}
}
return false;
}

/// Exports the current screen data to a .json file and downloads the file to
Expand Down

0 comments on commit bb82f00

Please sign in to comment.