Unverified Commit ee0a15d4 authored by Polina Cherkasova's avatar Polina Cherkasova Committed by GitHub

MinimumTextContrastGuideline should dispose image. (#133861)

parent 195dca02
......@@ -6,6 +6,7 @@ import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';
import '../image_data.dart';
......@@ -443,7 +444,7 @@ void main() {
);
});
testWidgets('generated scheme "on" colors meet a11y contrast guidelines', (WidgetTester tester) async {
testWidgetsWithLeakTracking('generated scheme "on" colors meet a11y contrast guidelines', (WidgetTester tester) async {
final ColorScheme colors = ColorScheme.fromSeed(seedColor: Colors.teal);
Widget label(String text, Color textColor, Color background) {
......
......@@ -329,7 +329,9 @@ class MinimumTextContrastGuideline extends AccessibilityGuideline {
// the last transform layer.
final double ratio = 1 / renderView.flutterView.devicePixelRatio;
image = await layer.toImage(renderView.paintBounds, pixelRatio: ratio);
return image.toByteData();
final ByteData? data = await image.toByteData();
image.dispose();
return data;
},
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment