Skip to content

Commit 49aa68b

Browse files
committed
Added documentation for byte formatting
1 parent 63e2041 commit 49aa68b

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

packages/devtools_app/lib/src/screens/network/network_request_inspector_views.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,11 @@ class NetworkRequestOverviewView extends StatelessWidget {
677677
];
678678
}
679679

680+
// Output Formats:
681+
// - 512 → "512 B"
682+
// - 2048 → "2.0 KB"
683+
// - 1048576 → "1.0 MB"
684+
// Values are rounded to one decimal place for KB and MB.
680685
String _formatBytes(int? bytes) {
681686
if (bytes == null) return '-';
682687
if (bytes < 1024) return '$bytes B';

packages/devtools_app/lib/src/screens/network/network_screen.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,11 @@ class NetworkRequestsTable extends StatelessWidget {
406406
}
407407
}
408408

409+
// Output Formats:
410+
// - 512 → "512 B"
411+
// - 2048 → "2.0 KB"
412+
// - 1048576 → "1.0 MB"
413+
// Values are rounded to one decimal place for KB and MB.
409414
String _formatBytes(int? bytes) {
410415
if (bytes == null) return '-';
411416
if (bytes < 1024) return '$bytes B';

0 commit comments

Comments
 (0)