Skip to content

Commit

Permalink
Remove dead code (#126266)
Browse files Browse the repository at this point in the history
Dead code was flagged by `unreachable_from_main` lint, which is still experimental and not ready to be enabled yet.
  • Loading branch information
goderbauer committed May 9, 2023
1 parent 5b87e4f commit 58454e9
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 30 deletions.
Expand Up @@ -74,9 +74,7 @@ class _MyHomePageState extends State<MyHomePage> {
}

abstract class DeltaMode {
static const int kPixel = 0x00;
static const int kLine = 0x01;
static const int kPage = 0x02;
}

void dispatchMouseWheelEvent(int mouseX, int mouseY,
Expand Down
Expand Up @@ -8,7 +8,6 @@ import 'package:flutter/material.dart';
const Widget divider = SizedBox(height: 10);
const double narrowScreenWidthThreshold = 400;
const double imageSize = 150;

void main() => runApp(DynamicColorExample());

Expand Down
1 change: 0 additions & 1 deletion examples/api/lib/widgets/magnifier/magnifier.0.dart
Expand Up @@ -8,7 +8,6 @@ void main() => runApp(const MagnifierExampleApp());

class MagnifierExampleApp extends StatefulWidget {
const MagnifierExampleApp({super.key});
static const Size loupeSize = Size(200, 200);

@override
State<MagnifierExampleApp> createState() => _MagnifierExampleAppState();
Expand Down
2 changes: 0 additions & 2 deletions examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart
Expand Up @@ -17,8 +17,6 @@ class TextMagnifierExampleApp extends StatelessWidget {
final TextDirection textDirection;
final String text;

static const Size loupeSize = Size(200, 200);

@override
Widget build(BuildContext context) {
return MaterialApp(
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/test/gestures/gesture_binding_test.dart
Expand Up @@ -64,7 +64,7 @@ void main() {
);

final List<PointerEvent> events = <PointerEvent>[];
binding.onHandleEvent = events.add;
TestGestureFlutterBinding.instance.onHandleEvent = events.add;

GestureBinding.instance.platformDispatcher.onPointerDataPacket?.call(packet);
expect(events.length, 2);
Expand Down
2 changes: 0 additions & 2 deletions packages/flutter/test/widgets/app_test.dart
Expand Up @@ -14,8 +14,6 @@ class TestIntent extends Intent {
class TestAction extends Action<Intent> {
TestAction();

static const LocalKey key = ValueKey<Type>(TestAction);

int calls = 0;

@override
Expand Down
15 changes: 0 additions & 15 deletions packages/flutter/test/widgets/render_object_element_test.dart
Expand Up @@ -51,17 +51,6 @@ class SwapperWithProperOverrides extends Swapper {
SwapperElement createElement() => SwapperElementWithProperOverrides(this);
}

class SwapperWithNoOverrides extends Swapper {
const SwapperWithNoOverrides({
super.key,
super.stable,
super.swapper,
});

@override
SwapperElement createElement() => SwapperElementWithNoOverrides(this);
}

abstract class SwapperElement extends RenderObjectElement {
SwapperElement(Swapper super.widget);

Expand Down Expand Up @@ -147,10 +136,6 @@ class SwapperElementWithProperOverrides extends SwapperElement {
}
}

class SwapperElementWithNoOverrides extends SwapperElement {
SwapperElementWithNoOverrides(super.widget);
}

class RenderSwapper extends RenderBox {
RenderBox? _stable;
RenderBox? get stable => _stable;
Expand Down
2 changes: 0 additions & 2 deletions packages/flutter/test/widgets/shortcuts_test.dart
Expand Up @@ -1909,8 +1909,6 @@ class TestAction extends CallbackAction<Intent> {
TestAction({
required super.onInvoke,
});

static const LocalKey key = ValueKey<Type>(TestAction);
}

/// An activator that accepts down events that has [key] as the logical key.
Expand Down
Expand Up @@ -2,14 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:io';

import 'package:flutter/widgets.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_test/flutter_test.dart';

final String rootDirectoryPath = Directory.current.path;

void main() {
for (final String language in kWidgetsSupportedLanguages) {
testWidgets('translations exist for $language', (WidgetTester tester) async {
Expand Down

0 comments on commit 58454e9

Please sign in to comment.