Skip to content

Commit

Permalink
chore: Update flutter version for code analysis and fix linter issues. (
Browse files Browse the repository at this point in the history
  • Loading branch information
panmari authored Feb 5, 2025
1 parent da48532 commit 233d926
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
distribution: temurin
- uses: subosito/[email protected]
with:
flutter-version: '3.24.0'
flutter-version: '3.27.3'
cache: true

- name: Install dependencies for google_ml_kit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class LoadingIndicator extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(16),
color: Colors.black.withOpacity(0.8),
color: Colors.black.withAlpha(204),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
Expand Down
4 changes: 3 additions & 1 deletion packages/example/lib/vision_detector_views/camera_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,9 @@ class _CameraViewState extends State<CameraView> {
// * bgra8888 for iOS
if (format == null ||
(Platform.isAndroid && format != InputImageFormat.nv21) ||
(Platform.isIOS && format != InputImageFormat.bgra8888)) return null;
(Platform.isIOS && format != InputImageFormat.bgra8888)) {
return null;
}

// since format is constraint to nv21 or bgra8888, both only have one plane
if (image.planes.length != 1) return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SegmentationPainter extends CustomPainter {
).round();

final double opacity = confidences[(y * width) + x] * 0.5;
paint.color = color.withOpacity(opacity);
paint.color = color.withAlpha((opacity * 255).round());
canvas.drawCircle(Offset(tx.toDouble(), ty.toDouble()), 2, paint);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class SubjectSegmentationPainter extends CustomPainter {
.round();

final double opacity = confidences[(y * subjectWidth) + x] * 0.5;
paint.color = color.withOpacity(opacity);
paint.color = color.withAlpha((opacity * 255).round());
canvas.drawCircle(Offset(tx.toDouble(), ty.toDouble()), 2, paint);
}
}
Expand Down

0 comments on commit 233d926

Please sign in to comment.