forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp_performance_test.dart
More file actions
610 lines (516 loc) · 23.3 KB
/
Copy pathapp_performance_test.dart
File metadata and controls
610 lines (516 loc) · 23.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
import 'dart:async';
import 'dart:io';
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:omi/main.dart' as app;
/// Real App Animation Performance Profiling Test
///
/// This test handles onboarding automatically and profiles animation performance.
///
/// Run with:
/// ```bash
/// flutter drive \
/// --driver=test_driver/integration_test.dart \
/// --target=integration_test/app_performance_test.dart \
/// --profile \
/// --flavor dev \
/// -d <device_id>
/// ```
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('Omi App Animation Performance', () {
testWidgets('Profile all animation screens', (WidgetTester tester) async {
debugPrint('');
debugPrint('╔══════════════════════════════════════════════════════════════╗');
debugPrint('║ OMI APP ANIMATION PERFORMANCE TEST ║');
debugPrint('╚══════════════════════════════════════════════════════════════╝');
debugPrint('');
// Launch the real app
debugPrint('[1/7] Launching app...');
app.main();
// Wait for app initialization - use pump() instead of pumpAndSettle()
// because pumpAndSettle hangs on screens with continuous animations
for (int i = 0; i < 50; i++) {
await tester.pump(const Duration(milliseconds: 100));
}
debugPrint(' App launched');
// === HANDLE ONBOARDING IF PRESENT ===
await _handleOnboardingIfNeeded(tester);
// Wait for home screen to fully load
await _pumpFor(tester, 3000);
// Dismiss any popup that might appear (like "Loving Omi?" after home loads)
await _dismissAnyPopup(tester);
// Wait 60 seconds for app to stabilize before profiling
debugPrint('');
debugPrint('[2.5/7] Waiting 60 seconds for app to stabilize...');
for (int i = 0; i < 60; i++) {
await tester.pump(const Duration(seconds: 1));
// Check and dismiss any popup that might appear during wait
await _dismissAnyPopup(tester);
if (i % 10 == 0) {
debugPrint(' ${60 - i} seconds remaining...');
}
}
debugPrint(' App stabilized');
// Collect frame timing data
final allFrameTimings = <String, List<FrameTiming>>{};
List<FrameTiming> currentFrameTimings = [];
void frameCallback(List<FrameTiming> timings) {
currentFrameTimings.addAll(timings);
}
// === SCREEN 1: HOME (Conversations) ===
debugPrint('');
debugPrint('[3/7] Profiling HOME screen...');
debugPrint(' (WaveformSection, ProcessingCapture animations)');
currentFrameTimings = [];
WidgetsBinding.instance.addTimingsCallback(frameCallback);
// Profile home screen for 15 seconds
for (int i = 0; i < 150; i++) {
await tester.pump(const Duration(milliseconds: 100));
}
WidgetsBinding.instance.removeTimingsCallback(frameCallback);
allFrameTimings['home'] = List.from(currentFrameTimings);
_printScreenMetrics('HOME', currentFrameTimings);
// === SCREEN 2: CHAT ===
debugPrint('');
debugPrint('[4/7] Navigating to CHAT screen...');
// Find and tap the "Ask Omi" button
final askOmiButton = find.text('Ask Omi');
if (askOmiButton.evaluate().isNotEmpty) {
await tester.tap(askOmiButton);
await _pumpFor(tester, 2000);
debugPrint(' Navigated to chat screen');
debugPrint('');
debugPrint('[5/7] Profiling CHAT screen...');
debugPrint(' (TypingIndicator, VoiceRecorder animations)');
currentFrameTimings = [];
WidgetsBinding.instance.addTimingsCallback(frameCallback);
// Profile chat screen for 15 seconds
for (int i = 0; i < 150; i++) {
await tester.pump(const Duration(milliseconds: 100));
}
WidgetsBinding.instance.removeTimingsCallback(frameCallback);
allFrameTimings['chat'] = List.from(currentFrameTimings);
_printScreenMetrics('CHAT', currentFrameTimings);
// Try to trigger typing indicator by sending a message
debugPrint('');
debugPrint('[6/7] Triggering AI response...');
final textField = find.byType(TextField);
if (textField.evaluate().isNotEmpty) {
await tester.enterText(textField.first, 'hello');
await _pumpFor(tester, 500);
// Find and tap send button
final sendButton = find.byIcon(Icons.send);
if (sendButton.evaluate().isNotEmpty) {
await tester.tap(sendButton);
} else {
// Try arrow_upward icon (common send icon)
final altSendButton = find.byIcon(Icons.arrow_upward);
if (altSendButton.evaluate().isNotEmpty) {
await tester.tap(altSendButton);
}
}
await tester.pump();
debugPrint(' Message sent, profiling typing indicator...');
currentFrameTimings = [];
WidgetsBinding.instance.addTimingsCallback(frameCallback);
// Profile during AI response (10 seconds)
for (int i = 0; i < 100; i++) {
await tester.pump(const Duration(milliseconds: 100));
}
WidgetsBinding.instance.removeTimingsCallback(frameCallback);
allFrameTimings['chat_typing'] = List.from(currentFrameTimings);
_printScreenMetrics('CHAT (typing)', currentFrameTimings);
}
// Go back to home
await tester.pageBack();
await _pumpFor(tester, 1000);
} else {
debugPrint(' ⚠ Could not find Ask Omi button - skipping chat test');
}
// === FINAL SUMMARY ===
debugPrint('');
debugPrint('[7/7] Generating summary...');
_printFinalSummary(allFrameTimings);
});
});
}
/// Pump frames for a specified duration (in milliseconds)
/// Use this instead of pumpAndSettle() for screens with continuous animations
Future<void> _pumpFor(WidgetTester tester, int milliseconds) async {
final iterations = milliseconds ~/ 100;
for (int i = 0; i < iterations; i++) {
await tester.pump(const Duration(milliseconds: 100));
}
}
/// Handle onboarding flow if the app shows onboarding screens
/// Flow: Auth -> Name -> Primary Language -> Permissions -> User Review -> Speech Profile
Future<void> _handleOnboardingIfNeeded(WidgetTester tester) async {
debugPrint('');
debugPrint('[2/7] Checking for onboarding...');
// Check if we're already on home screen
final askOmi = find.text('Ask Omi');
if (askOmi.evaluate().isNotEmpty) {
debugPrint(' Already logged in - on home screen');
return;
}
// Check for auth screen
final signInWithGoogle = find.text('Sign in with Google');
if (signInWithGoogle.evaluate().isNotEmpty) {
debugPrint(' Found auth screen - starting onboarding flow');
await _handleAuthFlow(tester);
return;
}
// Check for "Get Started" button (welcome/splash screen)
final getStarted = find.textContaining('Get Started');
if (getStarted.evaluate().isNotEmpty) {
debugPrint(' Found "Get Started" - tapping to proceed');
await tester.tap(getStarted.first);
await _pumpFor(tester, 2000);
await _handleAuthFlow(tester);
return;
}
// Check if we're on name screen
final wantToGoBy = find.textContaining('Want to go by');
if (wantToGoBy.evaluate().isNotEmpty) {
debugPrint(' Found name screen - continuing from there');
await _handleNameScreen(tester);
await _handlePrimaryLanguageScreen(tester);
await _handlePermissionsScreen(tester);
await _handleUserReviewScreen(tester);
await _handleSpeechProfileScreen(tester);
return;
}
// Check if we're on primary language screen
final primaryLanguage = find.textContaining('primary language');
if (primaryLanguage.evaluate().isNotEmpty) {
debugPrint(' Found primary language screen');
await _handlePrimaryLanguageScreen(tester);
await _handlePermissionsScreen(tester);
await _handleUserReviewScreen(tester);
await _handleSpeechProfileScreen(tester);
return;
}
// Check if we're on permissions screen
final grantPermissions = find.textContaining('Grant');
if (grantPermissions.evaluate().isNotEmpty) {
debugPrint(' Found permissions screen');
await _handlePermissionsScreen(tester);
await _handleUserReviewScreen(tester);
await _handleSpeechProfileScreen(tester);
return;
}
// Check if we're on user review screen (look for "Maybe Later" button)
final maybeLater = find.text('Maybe Later');
if (maybeLater.evaluate().isNotEmpty) {
debugPrint(' Found user review screen');
await _handleUserReviewScreen(tester);
await _handleSpeechProfileScreen(tester);
return;
}
debugPrint(' No onboarding detected - assuming logged in');
}
/// Handle the auth flow (Sign in with Google)
Future<void> _handleAuthFlow(WidgetTester tester) async {
// Tap "Sign in with Google"
final signInWithGoogle = find.text('Sign in with Google');
if (signInWithGoogle.evaluate().isNotEmpty) {
debugPrint(' Tapping "Sign in with Google"');
await tester.tap(signInWithGoogle);
await _pumpFor(tester, 2000);
// Handle consent bottom sheet
await _handleConsentSheet(tester);
// Wait for Google sign-in to complete (user interaction required)
debugPrint(' Waiting for Google sign-in (60 seconds)...');
debugPrint(' >>> Please complete sign-in on device <<<');
// Poll for next screen to appear
for (int i = 0; i < 120; i++) {
await tester.pump(const Duration(milliseconds: 500));
// Check if we've reached home screen
final askOmi = find.text('Ask Omi');
if (askOmi.evaluate().isNotEmpty) {
debugPrint(' Sign-in complete - reached home screen');
return;
}
// Check if we're on the name screen
final wantToGoBy = find.textContaining('Want to go by');
if (wantToGoBy.evaluate().isNotEmpty) {
debugPrint(' Sign-in complete - on name screen');
await _handleNameScreen(tester);
await _handlePrimaryLanguageScreen(tester);
await _handlePermissionsScreen(tester);
await _handleUserReviewScreen(tester);
await _handleSpeechProfileScreen(tester);
return;
}
}
debugPrint(' ⚠ Sign-in timeout - continuing anyway');
}
}
/// Handle consent bottom sheet (Continue with Google)
Future<void> _handleConsentSheet(WidgetTester tester) async {
await _pumpFor(tester, 500);
final continueWithGoogle = find.text('Continue with Google');
if (continueWithGoogle.evaluate().isNotEmpty) {
debugPrint(' Found consent sheet - tapping "Continue with Google"');
await tester.tap(continueWithGoogle);
await _pumpFor(tester, 2000);
}
}
/// Handle name screen ("Want to go by something else?")
Future<void> _handleNameScreen(WidgetTester tester) async {
debugPrint(' On name screen - tapping Continue');
// Find and tap Continue button
final continueBtn = find.text('Continue');
if (continueBtn.evaluate().isNotEmpty) {
await tester.tap(continueBtn.first);
await _pumpFor(tester, 2000);
}
}
/// Handle primary language screen ("What's your primary language?")
Future<void> _handlePrimaryLanguageScreen(WidgetTester tester) async {
// Check if we're on the primary language screen
final primaryLanguage = find.textContaining('primary language');
if (primaryLanguage.evaluate().isEmpty) {
debugPrint(' Not on primary language screen - skipping');
return;
}
debugPrint(' On primary language screen - tapping Continue');
// The language auto-selects from device locale, so Continue should be enabled
// Just tap Continue
final continueBtn = find.text('Continue');
if (continueBtn.evaluate().isNotEmpty) {
await tester.tap(continueBtn.first);
await _pumpFor(tester, 2000);
}
}
/// Handle permissions screen ("Grant permissions")
Future<void> _handlePermissionsScreen(WidgetTester tester) async {
// Check if we're on the permissions screen
final grantPermissions = find.textContaining('Grant');
if (grantPermissions.evaluate().isEmpty) {
debugPrint(' Not on permissions screen - skipping');
return;
}
debugPrint(' On permissions screen - tapping Continue');
// Tap Continue - this will trigger system permission dialogs
final continueBtn = find.text('Continue');
if (continueBtn.evaluate().isNotEmpty) {
await tester.tap(continueBtn.first);
await _pumpFor(tester, 3000); // Give more time for permission dialogs
}
}
/// Handle user review screen ("Loving Omi?")
Future<void> _handleUserReviewScreen(WidgetTester tester) async {
// Wait for screen to fully transition and check multiple times
for (int attempt = 0; attempt < 10; attempt++) {
await _pumpFor(tester, 500);
// Check if we're on the user review screen by looking for "Maybe Later" button
final maybeLater = find.text('Maybe Later');
if (maybeLater.evaluate().isNotEmpty) {
debugPrint(' On user review screen - tapping "Maybe Later"');
await tester.tap(maybeLater.first);
await _pumpFor(tester, 2000);
return;
}
// Check if we've already passed to home screen
final askOmi = find.text('Ask Omi');
if (askOmi.evaluate().isNotEmpty) {
debugPrint(' Already on home screen - skipping user review');
return;
}
}
debugPrint(' Not on user review screen - skipping');
}
/// Dismiss any popup that might appear during the test
/// This handles popups like "Loving Omi?" that can appear after reaching home
Future<void> _dismissAnyPopup(WidgetTester tester) async {
// Pump frames to ensure UI is rendered
await tester.pump(const Duration(milliseconds: 100));
// First check if "Loving Omi?" text is visible - that's the popup title
final lovingOmiTitle = find.text('Loving Omi?');
if (lovingOmiTitle.evaluate().isNotEmpty) {
debugPrint(' >>> POPUP DETECTED: "Loving Omi?" dialog is showing');
// The app_review_service.dart uses lowercase 'Maybe later' (line 210)
// Try to find and tap the TextButton with "Maybe later" text
final maybeLater = find.text('Maybe later');
if (maybeLater.evaluate().isNotEmpty) {
debugPrint(' >>> Found "Maybe later" button - tapping to dismiss...');
await tester.tap(maybeLater.first, warnIfMissed: false);
await tester.pump(const Duration(milliseconds: 300));
await tester.pump(const Duration(milliseconds: 300));
await tester.pump(const Duration(milliseconds: 300));
// Verify popup is gone
if (find.text('Loving Omi?').evaluate().isEmpty) {
debugPrint(' >>> Popup dismissed successfully!');
} else {
debugPrint(' >>> Popup still visible, trying again...');
// Try tapping the TextButton widget directly
final textButtons = find.byType(TextButton);
if (textButtons.evaluate().length >= 1) {
// The "Maybe later" is usually the last TextButton in the dialog
await tester.tap(textButtons.last, warnIfMissed: false);
await tester.pump(const Duration(milliseconds: 500));
await tester.pump(const Duration(milliseconds: 500));
}
}
return;
}
// Fallback: Try with capital L
final maybeLaterCap = find.text('Maybe Later');
if (maybeLaterCap.evaluate().isNotEmpty) {
debugPrint(' >>> Found "Maybe Later" (capital) button - tapping...');
await tester.tap(maybeLaterCap.first, warnIfMissed: false);
await tester.pump(const Duration(milliseconds: 500));
await tester.pump(const Duration(milliseconds: 500));
return;
}
// Last resort: tap any TextButton in the dialog
final textButtons = find.byType(TextButton);
if (textButtons.evaluate().isNotEmpty) {
debugPrint(' >>> Tapping TextButton to dismiss popup...');
await tester.tap(textButtons.last, warnIfMissed: false);
await tester.pump(const Duration(milliseconds: 500));
await tester.pump(const Duration(milliseconds: 500));
return;
}
}
// Check for "Skip for now" (Speech profile popup)
final skipForNow = find.text('Skip for now');
if (skipForNow.evaluate().isNotEmpty) {
debugPrint(' >>> Found "Skip for now" - TAPPING to dismiss');
await tester.tap(skipForNow.first, warnIfMissed: false);
await tester.pump(const Duration(milliseconds: 500));
await tester.pump(const Duration(milliseconds: 500));
return;
}
// Check for generic "Skip" button
final skip = find.text('Skip');
if (skip.evaluate().isNotEmpty) {
debugPrint(' >>> Found "Skip" - TAPPING to dismiss');
await tester.tap(skip.first, warnIfMissed: false);
await tester.pump(const Duration(milliseconds: 500));
await tester.pump(const Duration(milliseconds: 500));
return;
}
// Check for "Not now" button
final notNow = find.text('Not now');
if (notNow.evaluate().isNotEmpty) {
debugPrint(' >>> Found "Not now" - TAPPING to dismiss');
await tester.tap(notNow.first, warnIfMissed: false);
await tester.pump(const Duration(milliseconds: 500));
await tester.pump(const Duration(milliseconds: 500));
return;
}
}
/// Handle speech profile screen
Future<void> _handleSpeechProfileScreen(WidgetTester tester) async {
// Wait for screen to fully transition and check multiple times
for (int attempt = 0; attempt < 10; attempt++) {
await _pumpFor(tester, 500);
// Check if we're already on home screen
final askOmi = find.text('Ask Omi');
if (askOmi.evaluate().isNotEmpty) {
debugPrint(' Onboarding complete - reached home screen');
return;
}
// Check if we're on the speech profile screen - button text is "Skip for now"
final skipForNowBtn = find.text('Skip for now');
if (skipForNowBtn.evaluate().isNotEmpty) {
debugPrint(' On speech profile screen - tapping "Skip for now"');
await tester.tap(skipForNowBtn.first);
await _pumpFor(tester, 2000);
return;
}
// Also check for just "Skip" as fallback
final skipBtn = find.text('Skip');
if (skipBtn.evaluate().isNotEmpty) {
debugPrint(' On speech profile screen - tapping Skip');
await tester.tap(skipBtn.first);
await _pumpFor(tester, 2000);
return;
}
}
debugPrint(' Not on speech profile screen - skipping');
}
void _printScreenMetrics(String screenName, List<FrameTiming> timings) {
if (timings.isEmpty) {
debugPrint(' ⚠ No frame timings collected for $screenName');
return;
}
final buildTimes = timings.map((t) => t.buildDuration.inMicroseconds).toList()..sort();
final rasterTimes = timings.map((t) => t.rasterDuration.inMicroseconds).toList()..sort();
final avgBuild = buildTimes.reduce((a, b) => a + b) / buildTimes.length;
final avgRaster = rasterTimes.reduce((a, b) => a + b) / rasterTimes.length;
final p50Build = buildTimes[buildTimes.length ~/ 2];
final p90Build = buildTimes[(buildTimes.length * 0.9).toInt()];
final p99Build = buildTimes[(buildTimes.length * 0.99).toInt()];
// Janky frames (>16ms total frame time)
final jankyFrames = timings
.where((t) => t.buildDuration.inMilliseconds + t.rasterDuration.inMilliseconds > 16)
.length;
final jankyPercent = (jankyFrames / timings.length * 100);
debugPrint(' ┌─────────────────────────────────────');
debugPrint(' │ $screenName METRICS');
debugPrint(' ├─────────────────────────────────────');
debugPrint(' │ Frames: ${timings.length.toString().padLeft(6)}');
debugPrint(' │ Build avg: ${(avgBuild / 1000).toStringAsFixed(2).padLeft(6)} ms');
debugPrint(' │ Build p50: ${(p50Build / 1000).toStringAsFixed(2).padLeft(6)} ms');
debugPrint(' │ Build p90: ${(p90Build / 1000).toStringAsFixed(2).padLeft(6)} ms');
debugPrint(' │ Build p99: ${(p99Build / 1000).toStringAsFixed(2).padLeft(6)} ms');
debugPrint(' │ Raster avg: ${(avgRaster / 1000).toStringAsFixed(2).padLeft(6)} ms');
debugPrint(' │ Janky: ${jankyFrames.toString().padLeft(6)} (${jankyPercent.toStringAsFixed(1)}%)');
debugPrint(' └─────────────────────────────────────');
}
void _printFinalSummary(Map<String, List<FrameTiming>> allTimings) {
debugPrint('');
debugPrint('╔══════════════════════════════════════════════════════════════╗');
debugPrint('║ FINAL SUMMARY ║');
debugPrint('╠══════════════════════════════════════════════════════════════╣');
int totalFrames = 0;
int totalJanky = 0;
for (final entry in allTimings.entries) {
final name = entry.key;
final timings = entry.value;
if (timings.isEmpty) continue;
totalFrames += timings.length;
final janky = timings.where((t) => t.buildDuration.inMilliseconds + t.rasterDuration.inMilliseconds > 16).length;
totalJanky += janky;
final jankyPct = (janky / timings.length * 100).toStringAsFixed(1);
debugPrint(
'║ ${name.padRight(15)} │ ${timings.length.toString().padLeft(5)} frames │ ${jankyPct.padLeft(5)}% janky ║',
);
}
debugPrint('╠══════════════════════════════════════════════════════════════╣');
final overallJankyPct = totalFrames > 0 ? (totalJanky / totalFrames * 100) : 0.0;
debugPrint(
'║ TOTAL │ ${totalFrames.toString().padLeft(5)} frames │ ${overallJankyPct.toStringAsFixed(1).padLeft(5)}% janky ║',
);
debugPrint('╚══════════════════════════════════════════════════════════════╝');
debugPrint('');
// Write results to file for comparison
_writeResultsToFile(allTimings);
}
void _writeResultsToFile(Map<String, List<FrameTiming>> allTimings) {
try {
final timestamp = DateTime.now().toIso8601String().replaceAll(':', '-');
final file = File('/tmp/omi_perf_$timestamp.csv');
final buffer = StringBuffer();
buffer.writeln('screen,frame_index,build_us,raster_us,total_us');
for (final entry in allTimings.entries) {
final screen = entry.key;
for (var i = 0; i < entry.value.length; i++) {
final timing = entry.value[i];
final buildUs = timing.buildDuration.inMicroseconds;
final rasterUs = timing.rasterDuration.inMicroseconds;
buffer.writeln('$screen,$i,$buildUs,$rasterUs,${buildUs + rasterUs}');
}
}
file.writeAsStringSync(buffer.toString());
debugPrint('Results saved to: ${file.path}');
} catch (e) {
debugPrint('Could not save results to file: $e');
}
}