Rails API, app Flutter, infrastruttura Docker/MediaMTX, sito marketing e documentazione di deploy. Co-authored-by: Cursor <cursoragent@cursor.com>
40 lines
1.1 KiB
Dart
40 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// Riga compatta metriche stream (sostituisce le MetricCard ingombranti in camera).
|
|
class CameraCompactMetrics extends StatelessWidget {
|
|
const CameraCompactMetrics({
|
|
super.key,
|
|
required this.networkType,
|
|
required this.bitrateMbps,
|
|
required this.fps,
|
|
this.batteryLevel,
|
|
this.viewerCount,
|
|
this.light = false,
|
|
});
|
|
|
|
final String networkType;
|
|
final double bitrateMbps;
|
|
final int fps;
|
|
final int? batteryLevel;
|
|
final int? viewerCount;
|
|
final bool light;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final color = light ? Colors.white70 : Theme.of(context).textTheme.bodySmall?.color;
|
|
final parts = <String>[
|
|
networkType,
|
|
'${bitrateMbps.toStringAsFixed(1)} Mbps',
|
|
'$fps fps',
|
|
if (batteryLevel != null) '$batteryLevel%',
|
|
if (viewerCount != null && viewerCount! > 0) '$viewerCount spett.',
|
|
];
|
|
return Text(
|
|
parts.join(' · '),
|
|
style: TextStyle(fontSize: 11, color: color, fontWeight: FontWeight.w500),
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
);
|
|
}
|
|
}
|