Skip to content

Commit

Permalink
fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
polina-c committed Mar 16, 2022
1 parent e2d4dab commit 5781d2c
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 28 deletions.
2 changes: 0 additions & 2 deletions packages/devtools_app/test/fixtures/flutter_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';

// ignore: unused_import
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';

import 'missing_material_error.dart';
Expand All @@ -25,7 +23,7 @@ class MyApp extends StatelessWidget {
}

class MyHomePage extends StatefulWidget {
const MyHomePage({Key key, this.title}) : super(key: key);
const MyHomePage({Key? key, required this.title}) : super(key: key);

final String title;

Expand Down Expand Up @@ -85,5 +83,5 @@ Map<String, Function> navigateCallbacks = {};

// Hook to navigate to a specific screen.
void navigateToScreen(String title) {
navigateCallbacks[title]();
navigateCallbacks[title]!();
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'package:flutter/material.dart';

class MissingMaterialError extends StatelessWidget {
Expand All @@ -21,7 +19,7 @@ class MissingMaterialError extends StatelessWidget {

/// Opens an [AlertDialog] showing what the user typed.
class ExampleWidget extends StatefulWidget {
const ExampleWidget({Key key}) : super(key: key);
const ExampleWidget({Key? key}) : super(key: key);

@override
_ExampleWidgetState createState() => _ExampleWidgetState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

// ignore: unused_import, allows the tests to use functions from tester.dart

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:provider/single_child_widget.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'dart:async';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

// ignore: unused_import, allows the tests to use functions from tester.dart

// @dart=2.9

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9

import 'dart:async';
import 'dart:developer';
import 'package:flutter/widgets.dart';
Expand All @@ -12,7 +10,7 @@ import 'package:flutter_test/flutter_test.dart';
export 'package:flutter_test/flutter_test.dart';

class _Tester extends WidgetController {
_Tester() : super(WidgetsBinding.instance);
_Tester() : super(WidgetsBinding.instance!);

@override
Future<List<Duration>> handlePointerEventRecord(
Expand All @@ -22,8 +20,8 @@ class _Tester extends WidgetController {
}

@override
Future<void> pump([Duration duration]) {
binding.renderViewElement.markNeedsBuild();
Future<void> pump([Duration? duration]) {
binding.renderViewElement!.markNeedsBuild();

final completer = Completer<void>();
binding.addPostFrameCallback((timeStamp) => completer.complete());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart=2.9
// ignore_for_file: import_of_legacy_library_into_null_safe

import 'package:devtools_app/src/screens/provider/instance_viewer/instance_details.dart';
import 'package:devtools_app/src/screens/provider/instance_viewer/instance_providers.dart';
Expand Down Expand Up @@ -70,8 +70,8 @@ final emptyMapInstance = AsyncValue.data(

final map2Instance = AsyncValue.data(
InstanceDetails.map([
stringInstance.data.value,
list2Instance.data.value,
stringInstance.data!.value,
list2Instance.data!.value,
], hash: 0, instanceRefId: '0', setter: null),
);

Expand Down Expand Up @@ -129,7 +129,7 @@ void main() {
(tester) async {
const objPath = InstancePath.fromInstanceId('obj');

InstancePath pathForProperty(String name) {
InstancePath? pathForProperty(String name) {
return objPath.pathForChild(
PathToProperty.objectProperty(
name: name,
Expand Down Expand Up @@ -191,13 +191,13 @@ void main() {
),
),
),
rawInstanceProvider(pathForProperty('first'))
rawInstanceProvider(pathForProperty('first')!)
.overrideWithValue(int42Instance),
rawInstanceProvider(pathForProperty('_second'))
rawInstanceProvider(pathForProperty('_second')!)
.overrideWithValue(int42Instance),
rawInstanceProvider(pathForProperty('third'))
rawInstanceProvider(pathForProperty('third')!)
.overrideWithValue(int42Instance),
rawInstanceProvider(pathForProperty('_forth'))
rawInstanceProvider(pathForProperty('_forth')!)
.overrideWithValue(int42Instance),
],
child: const MaterialApp(
Expand Down

0 comments on commit 5781d2c

Please sign in to comment.