mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Improve accessibility contrast for pre-test message (#180469)
Fixes https://github.com/flutter/flutter/issues/179181 The pre-test message "Test starting..." previously had a contrast ratio of 2.99:1 against the background, which is below the recommended 3:1 minimum for accessibility. This PR slightly adjusts the text color from 0xFF917FFF to 0xFF8F7FFF to meet the minimum contrast requirement while preserving the visual appearance.
This commit is contained in:
parent
60e001eeaa
commit
3e034fce05
@ -1505,7 +1505,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
|
||||
return announcements;
|
||||
}
|
||||
|
||||
static const TextStyle _messageStyle = TextStyle(color: Color(0xFF917FFF), fontSize: 40.0);
|
||||
static const TextStyle _messageStyle = TextStyle(color: Color(0xFF8F7FFF), fontSize: 40.0);
|
||||
|
||||
static const Widget _preTestMessage = Center(
|
||||
child: Text('Test starting...', style: _messageStyle, textDirection: TextDirection.ltr),
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
/// Verifies that the pre-test message shown by flutter_test
|
||||
/// meets the minimum WCAG text contrast accessibility guideline.
|
||||
testWidgets('pre-test message meets text contrast guideline', (WidgetTester tester) async {
|
||||
// The pre-test message is already attached to the render tree by the
|
||||
// TestWidgetsFlutterBinding before this test runs, so no pumpWidget is needed.
|
||||
await expectLater(tester, meetsGuideline(textContrastGuideline));
|
||||
});
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user