runQuickScan method

Future<void> runQuickScan(
  1. Future<BundleScanResult?> scan()
)

Runs scan (normally scanInstalledBundle, overridable so callers — e.g. widget tests — can substitute a fake instead of touching the real filesystem) for a live size breakdown; on failure, leaves any previously loaded analysis in place and sets errorMessage.

Implementation

Future<void> runQuickScan(
  Future<BundleScanResult?> Function() scan,
) async {
  final result = await scan();
  if (result == null) {
    _errorMessage =
        'Quick scan isn\'t available on this platform yet — use '
        '"Import file" to load a --analyze-size JSON instead.';
    notifyListeners();
    return;
  }
  _setLoaded(
    root: result.root,
    fileName: 'Installed app bundle',
    platform: result.platformLabel,
    isLive: true,
  );
}