Enable avoid_print lint. (#91332)

This commit is contained in:
Ian Hickson
2021-10-07 09:53:03 -07:00
committed by GitHub
parent 3c6c2aa50a
commit cb378edc9e
85 changed files with 359 additions and 246 deletions

View File

@@ -38,21 +38,21 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
KeyEventResult _handleKeyPress(FocusNode node, RawKeyEvent event) {
if (event is RawKeyDownEvent) {
print('Focus node ${node.debugLabel} got key event: ${event.logicalKey}');
debugPrint('Focus node ${node.debugLabel} got key event: ${event.logicalKey}');
if (event.logicalKey == LogicalKeyboardKey.keyR) {
print('Changing color to red.');
debugPrint('Changing color to red.');
setState(() {
_color = Colors.red;
});
return KeyEventResult.handled;
} else if (event.logicalKey == LogicalKeyboardKey.keyG) {
print('Changing color to green.');
debugPrint('Changing color to green.');
setState(() {
_color = Colors.green;
});
return KeyEventResult.handled;
} else if (event.logicalKey == LogicalKeyboardKey.keyB) {
print('Changing color to blue.');
debugPrint('Changing color to blue.');
setState(() {
_color = Colors.blue;
});

View File

@@ -115,7 +115,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
// This button would be not visible, but still focusable from
// the foreground pane without the FocusScope.
ElevatedButton(
onPressed: () => print('You pressed the other button!'),
onPressed: () => debugPrint('You pressed the other button!'),
child: const Text('ANOTHER BUTTON TO FOCUS'),
),
DefaultTextStyle(