forked from firka/flutter
MinimumTextContrastGuideline should dispose image. (#133861)
This commit is contained in:
committed by
GitHub
parent
195dca02c0
commit
ee0a15d4f5
@@ -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;
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user