Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update flutter version for code analysis and fix linter issues.
Browse files Browse the repository at this point in the history
panmari committed Jan 24, 2025
1 parent da48532 commit 23b90a4
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
@@ -24,7 +24,7 @@ jobs:
distribution: temurin
- uses: subosito/flutter-action@v2.18.0
with:
flutter-version: '3.24.0'
flutter-version: '3.27.3'
cache: true

- name: Install dependencies for google_ml_kit
Original file line number Diff line number Diff line change
@@ -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,
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
@@ -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;
Original file line number Diff line number Diff line change
@@ -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);
}
}
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 23b90a4

Please sign in to comment.