Skip to content

Commit 233d926

Browse files
authored
chore: Update flutter version for code analysis and fix linter issues. (#737)
1 parent da48532 commit 233d926

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

.github/workflows/code-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
distribution: temurin
2525
- uses: subosito/[email protected]
2626
with:
27-
flutter-version: '3.24.0'
27+
flutter-version: '3.27.3'
2828
cache: true
2929

3030
- name: Install dependencies for google_ml_kit

packages/example/lib/activity_indicator/activity_indicator.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class LoadingIndicator extends StatelessWidget {
4343
Widget build(BuildContext context) {
4444
return Container(
4545
padding: EdgeInsets.all(16),
46-
color: Colors.black.withOpacity(0.8),
46+
color: Colors.black.withAlpha(204),
4747
child: Column(
4848
mainAxisAlignment: MainAxisAlignment.center,
4949
mainAxisSize: MainAxisSize.min,

packages/example/lib/vision_detector_views/camera_view.dart

+3-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,9 @@ class _CameraViewState extends State<CameraView> {
364364
// * bgra8888 for iOS
365365
if (format == null ||
366366
(Platform.isAndroid && format != InputImageFormat.nv21) ||
367-
(Platform.isIOS && format != InputImageFormat.bgra8888)) return null;
367+
(Platform.isIOS && format != InputImageFormat.bgra8888)) {
368+
return null;
369+
}
368370

369371
// since format is constraint to nv21 or bgra8888, both only have one plane
370372
if (image.planes.length != 1) return null;

packages/example/lib/vision_detector_views/painters/segmentation_painter.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class SegmentationPainter extends CustomPainter {
4444
).round();
4545

4646
final double opacity = confidences[(y * width) + x] * 0.5;
47-
paint.color = color.withOpacity(opacity);
47+
paint.color = color.withAlpha((opacity * 255).round());
4848
canvas.drawCircle(Offset(tx.toDouble(), ty.toDouble()), 2, paint);
4949
}
5050
}

packages/example/lib/vision_detector_views/painters/subject_segmentation_painter.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class SubjectSegmentationPainter extends CustomPainter {
5252
.round();
5353

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

0 commit comments

Comments
 (0)