Skip to content

Commit

Permalink
Merge branch 'main' into video-screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 authored Jan 9, 2025
2 parents 3e207e0 + 73697b1 commit ea48648
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/src/models/view/builders/preset_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class PresetBuilder extends ValueBuilder<void> {
@override
void get value { /* Use [save] instead */ }

/// Calls [models.views.saveAsPreset] in views.dart
/// Calls `models.views.saveAsPreset` in views.dart
void save() => models.views.saveAsPreset(nameController.text);
}
6 changes: 3 additions & 3 deletions lib/src/pages/arm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,23 +188,23 @@ class ArmPainterSide extends CustomPainter {
];

final firstCirclePaint = Paint()
..color = lineColors[0].withOpacity(opacity)
..color = lineColors[0].withValues(alpha: opacity)
..style = PaintingStyle.fill;

canvas.drawCircle(points[0], screen / 40, firstCirclePaint);

// Draw lines based off joint position
for (var i = 0; i < points.length - 1; i++) {
final paint = Paint()
..color = lineColors[i].withOpacity(opacity)
..color = lineColors[i].withValues(alpha: opacity)
..strokeWidth = screen / 50;
canvas.drawLine(points[i], points[i + 1], paint);
}

// Draw circles on each joint
for (var i = 0; i < points.length - 1; i++) {
final circlePaint = Paint()
..color = lineColors[i].withOpacity(opacity)
..color = lineColors[i].withValues(alpha: opacity)
..style = PaintingStyle.fill;
canvas.drawCircle(points[i + 1], screen / 50, circlePaint);
}
Expand Down
16 changes: 8 additions & 8 deletions lib/src/pages/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DashboardView {
/// An icon to indicate the status of the given camera.
static Widget getCameraStatus(CameraName name) {
if (!models.sockets.video.isConnected) {
return Icon(Icons.signal_wifi_off, color: Colors.black.withOpacity(0.5));
return Icon(Icons.signal_wifi_off, color: Colors.black.withValues(alpha: 0.5));
}
final status = models.video.feeds[name]!.details.status;
const size = 12.0;
Expand Down Expand Up @@ -93,37 +93,37 @@ class DashboardView {
static final List<DashboardView> uiViews = [
DashboardView(
name: Routes.science,
iconFunc: () => Icon(Icons.science, color: Colors.black.withOpacity(0.5)),
iconFunc: () => Icon(Icons.science, color: Colors.black.withValues(alpha: 0.5)),
builder: (context, index) => SciencePage(index: index),
),
DashboardView(
name: Routes.autonomy,
iconFunc: () => Icon(Icons.map, color: Colors.black.withOpacity(0.5)),
iconFunc: () => Icon(Icons.map, color: Colors.black.withValues(alpha: 0.5)),
builder: (context, index) => MapPage(index: index),
),
DashboardView(
name: Routes.electrical,
iconFunc: () => Icon(Icons.bolt, color: Colors.black.withOpacity(0.5)),
iconFunc: () => Icon(Icons.bolt, color: Colors.black.withValues(alpha: 0.5)),
builder: (context, index) => ElectricalPage(index: index),
),
DashboardView(
name: Routes.arm,
iconFunc: () => Icon(Icons.precision_manufacturing_outlined, color: Colors.black.withOpacity(0.5)),
iconFunc: () => Icon(Icons.precision_manufacturing_outlined, color: Colors.black.withValues(alpha: 0.5)),
builder: (context, index) => ArmPage(index: index),
),
DashboardView(
name: Routes.drive,
iconFunc: () => Icon(Icons.drive_eta, color: Colors.black.withOpacity(0.5)),
iconFunc: () => Icon(Icons.drive_eta, color: Colors.black.withValues(alpha: 0.5)),
builder: (context, index) => DrivePage(index: index),
),
DashboardView(
name: Routes.rocks,
iconFunc: () => Icon(Icons.landslide, color: Colors.black.withOpacity(0.5)),
iconFunc: () => Icon(Icons.landslide, color: Colors.black.withValues(alpha: 0.5)),
builder: (context, index) => RocksPage(index: index),
),
DashboardView(
name: Routes.controllers,
iconFunc: () => Icon(Icons.sports_esports, color: Colors.black.withOpacity(0.5)),
iconFunc: () => Icon(Icons.sports_esports, color: Colors.black.withValues(alpha: 0.5)),
builder: (context, index) => ControllersPage(index: index),
),
];
Expand Down
2 changes: 1 addition & 1 deletion lib/src/services/socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DashboardSocket extends BurtSocket {
/// Notifier for when the socket connects or disconnects
final ValueNotifier<bool> connectionStatus = ValueNotifier(false);

/// Number of times to check heart beat per seconds based on [settings.network.connectionTimeout].
/// Number of times to check heart beat per seconds based on `models.settings.network.connectionTimeout`.
double get frequency => models.settings.network.connectionTimeout;

/// Listens for incoming messages on a UDP socket and sends heartbeats to the [device].
Expand Down

0 comments on commit ea48648

Please sign in to comment.