Rails API, app Flutter, infrastruttura Docker/MediaMTX, sito marketing e documentazione di deploy. Co-authored-by: Cursor <cursoragent@cursor.com>
43 lines
979 B
Dart
43 lines
979 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../app/theme.dart';
|
|
|
|
/// Dot verde + etichetta COLLEGATO.
|
|
class ConnectedBadge extends StatelessWidget {
|
|
const ConnectedBadge({
|
|
super.key,
|
|
this.connected = true,
|
|
this.label,
|
|
});
|
|
|
|
final bool connected;
|
|
final String? label;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
final color = connected ? AppTheme.successGreen : AppTheme.textSecondary;
|
|
return Row(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Container(
|
|
width: 8,
|
|
height: 8,
|
|
decoration: BoxDecoration(
|
|
color: color,
|
|
shape: BoxShape.circle,
|
|
),
|
|
),
|
|
const SizedBox(width: 6),
|
|
Text(
|
|
label ?? (connected ? 'COLLEGATO' : 'DISCONNESSO'),
|
|
style: theme.textTheme.labelLarge?.copyWith(
|
|
color: color,
|
|
fontSize: 12,
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|