diff --git a/dev/benchmarks/macrobenchmarks/test/picture_cache_perf_e2e.dart b/dev/benchmarks/macrobenchmarks/test/picture_cache_perf_e2e.dart index c0addf1c86..c356c4fe53 100644 --- a/dev/benchmarks/macrobenchmarks/test/picture_cache_perf_e2e.dart +++ b/dev/benchmarks/macrobenchmarks/test/picture_cache_perf_e2e.dart @@ -16,7 +16,7 @@ void main() { body: (WidgetController controller) async { final Finder nestedScroll = find.byKey(const ValueKey('tabbar_view')); expect(nestedScroll, findsOneWidget); - Future _scrollOnce(double offset) async { + Future scrollOnce(double offset) async { await controller.timedDrag( nestedScroll, Offset(-offset, 0.0), @@ -25,10 +25,10 @@ void main() { await Future.delayed(const Duration(milliseconds: 500)); } for (int i = 0; i < 3; i += 1) { - await _scrollOnce(-300.0); - await _scrollOnce(-300.0); - await _scrollOnce(300.0); - await _scrollOnce(300.0); + await scrollOnce(-300.0); + await scrollOnce(-300.0); + await scrollOnce(300.0); + await scrollOnce(300.0); } }, ); diff --git a/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_complexity_scoring_perf_test.dart b/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_complexity_scoring_perf_test.dart index e5172fd9ae..38c6b4b1c9 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_complexity_scoring_perf_test.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_complexity_scoring_perf_test.dart @@ -14,7 +14,7 @@ void main() { pageDelay: const Duration(seconds: 1), driverOps: (FlutterDriver driver) async { final SerializableFinder tabBarView = find.byValueKey('tabbar_view_complexity'); - Future _scrollOnce(double offset) async { + Future scrollOnce(double offset) async { // Technically it's not scrolling but moving await driver.scroll(tabBarView, offset, 0.0, const Duration(milliseconds: 300)); await Future.delayed(const Duration(milliseconds: 500)); @@ -22,8 +22,8 @@ void main() { // When we eventually add more test panes we will want to tweak these // to go through all the panes for (int i = 0; i < 6; i += 1) { - await _scrollOnce(-300.0); - await _scrollOnce(300.0); + await scrollOnce(-300.0); + await scrollOnce(300.0); } }, ); diff --git a/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_perf_test.dart b/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_perf_test.dart index 31445b2df9..2d68ec069d 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_perf_test.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_perf_test.dart @@ -14,16 +14,16 @@ void main() { pageDelay: const Duration(seconds: 1), driverOps: (FlutterDriver driver) async { final SerializableFinder tabBarView = find.byValueKey('tabbar_view'); - Future _scrollOnce(double offset) async { + Future scrollOnce(double offset) async { // Technically it's not scrolling but moving await driver.scroll(tabBarView, offset, 0.0, const Duration(milliseconds: 300)); await Future.delayed(const Duration(milliseconds: 500)); } for (int i = 0; i < 3; i += 1) { - await _scrollOnce(-300.0); - await _scrollOnce(-300.0); - await _scrollOnce(300.0); - await _scrollOnce(300.0); + await scrollOnce(-300.0); + await scrollOnce(-300.0); + await scrollOnce(300.0); + await scrollOnce(300.0); } }, ); diff --git a/dev/benchmarks/microbenchmarks/lib/geometry/matrix_utils_transform_bench.dart b/dev/benchmarks/microbenchmarks/lib/geometry/matrix_utils_transform_bench.dart index 0800f5254f..4cf25ff0ae 100644 --- a/dev/benchmarks/microbenchmarks/lib/geometry/matrix_utils_transform_bench.dart +++ b/dev/benchmarks/microbenchmarks/lib/geometry/matrix_utils_transform_bench.dart @@ -15,7 +15,7 @@ void main() { assert(false, "Don't run benchmarks in checked mode! Use 'flutter run --release'."); print('MatrixUtils.transformRect and .transformPoint benchmark...'); - Matrix4 _makePerspective(double radius, double angle, double perspective) { + Matrix4 makePerspective(double radius, double angle, double perspective) { return MatrixUtils.createCylindricalProjectionTransform( radius: radius, angle: angle, @@ -29,9 +29,9 @@ void main() { Matrix4.identity()..scale(1.2, 1.3, 1.0)..translate(12.0, 13.0, 10.0), ]; final List perspectiveTransforms = [ - _makePerspective(10.0, math.pi / 8.0, 0.3), - _makePerspective( 8.0, math.pi / 8.0, 0.2), - _makePerspective( 1.0, math.pi / 4.0, 0.1)..rotateX(0.1), + makePerspective(10.0, math.pi / 8.0, 0.3), + makePerspective( 8.0, math.pi / 8.0, 0.2), + makePerspective( 1.0, math.pi / 4.0, 0.1)..rotateX(0.1), ]; final List rectangles = [ const Rect.fromLTRB(1.1, 1.2, 1.5, 1.8), diff --git a/dev/bots/analyze.dart b/dev/bots/analyze.dart index f18b1a7f2f..098bc5ad4b 100644 --- a/dev/bots/analyze.dart +++ b/dev/bots/analyze.dart @@ -822,21 +822,21 @@ Future verifyNoRuntimeTypeInToString(String workingDirectory) async { for (int index = 0; index < lines.length; index++) { if (toStringRegExp.hasMatch(lines[index])) { final int sourceLine = index + 1; - bool _checkForRuntimeType(String line) { + bool checkForRuntimeType(String line) { if (line.contains(r'$runtimeType') || line.contains('runtimeType.toString()')) { problems.add('${file.path}:$sourceLine}: toString calls runtimeType.toString'); return true; } return false; } - if (_checkForRuntimeType(lines[index])) { + if (checkForRuntimeType(lines[index])) { continue; } if (lines[index].contains('=>')) { while (!lines[index].contains(';')) { index++; assert(index < lines.length, 'Source file $file has unterminated toString method.'); - if (_checkForRuntimeType(lines[index])) { + if (checkForRuntimeType(lines[index])) { break; } } @@ -845,7 +845,7 @@ Future verifyNoRuntimeTypeInToString(String workingDirectory) async { while (!lines[index].contains('}') && openBraceCount > 0) { index++; assert(index < lines.length, 'Source file $file has unbalanced braces in a toString method.'); - if (_checkForRuntimeType(lines[index])) { + if (checkForRuntimeType(lines[index])) { break; } openBraceCount += '{'.allMatches(lines[index]).length; diff --git a/dev/integration_tests/flutter_gallery/lib/demo/animation/home.dart b/dev/integration_tests/flutter_gallery/lib/demo/animation/home.dart index 64fc5031e3..6804386ad2 100644 --- a/dev/integration_tests/flutter_gallery/lib/demo/animation/home.dart +++ b/dev/integration_tests/flutter_gallery/lib/demo/animation/home.dart @@ -300,15 +300,15 @@ class _AllSectionsView extends AnimatedWidget { 1.0 - ((size.height - minHeight!) / (midHeight! - minHeight!)).clamp(0.0, 1.0); - double _indicatorOpacity(int index) { + double indicatorOpacity(int index) { return 1.0 - _selectedIndexDelta(index) * 0.5; } - double _titleOpacity(int index) { + double titleOpacity(int index) { return 1.0 - _selectedIndexDelta(index) * tColumnToRow * 0.5; } - double _titleScale(int index) { + double titleScale(int index) { return 1.0 - _selectedIndexDelta(index) * tColumnToRow * 0.15; } @@ -320,8 +320,8 @@ class _AllSectionsView extends AnimatedWidget { id: 'title$index', child: SectionTitle( section: section, - scale: _titleScale(index), - opacity: _titleOpacity(index), + scale: titleScale(index), + opacity: titleOpacity(index), ), )); } @@ -330,7 +330,7 @@ class _AllSectionsView extends AnimatedWidget { children.add(LayoutId( id: 'indicator$index', child: SectionIndicator( - opacity: _indicatorOpacity(index), + opacity: indicatorOpacity(index), ), )); } diff --git a/examples/api/lib/material/reorderable_list/reorderable_list_view.1.dart b/examples/api/lib/material/reorderable_list/reorderable_list_view.1.dart index 35445b2773..f5c7253991 100644 --- a/examples/api/lib/material/reorderable_list/reorderable_list_view.1.dart +++ b/examples/api/lib/material/reorderable_list/reorderable_list_view.1.dart @@ -40,7 +40,7 @@ class _ReorderableExampleState extends State { final Color evenItemColor = colorScheme.secondary.withOpacity(0.15); final Color draggableItemColor = colorScheme.secondary; - Widget _proxyDecorator(Widget child, int index, Animation animation) { + Widget proxyDecorator(Widget child, int index, Animation animation) { return AnimatedBuilder( animation: animation, builder: (BuildContext context, Widget? child) { @@ -59,7 +59,7 @@ class _ReorderableExampleState extends State { return ReorderableListView( padding: const EdgeInsets.symmetric(horizontal: 40), - proxyDecorator: _proxyDecorator, + proxyDecorator: proxyDecorator, children: [ for (int index = 0; index < _items.length; index += 1) ListTile( diff --git a/examples/api/test/cupertino/slider/cupertino_slider.0_test.dart b/examples/api/test/cupertino/slider/cupertino_slider.0_test.dart index 1d626d976e..c5a270698c 100644 --- a/examples/api/test/cupertino/slider/cupertino_slider.0_test.dart +++ b/examples/api/test/cupertino/slider/cupertino_slider.0_test.dart @@ -7,7 +7,7 @@ import 'package:flutter_api_samples/cupertino/slider/cupertino_slider.0.dart' as import 'package:flutter_test/flutter_test.dart'; void main() { - Future _dragSlider(WidgetTester tester, Key sliderKey) { + Future dragSlider(WidgetTester tester, Key sliderKey) { final Offset topLeft = tester.getTopLeft(find.byKey(sliderKey)); const double unit = CupertinoThumbPainter.radius; const double delta = 3.0 * unit; @@ -22,7 +22,7 @@ void main() { // Check for the initial slider value. expect(find.text('0.0'), findsOneWidget); - await _dragSlider(tester, const Key('slider')); + await dragSlider(tester, const Key('slider')); await tester.pumpAndSettle(); // Check for the updated slider value.