[flutter_web_plugins] Migrate to null safety. (#69844)
This commit is contained in:
@@ -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.8
|
||||
|
||||
import 'dart:html';
|
||||
|
||||
@TestOn('chrome') // Uses web-only Flutter SDK
|
||||
@@ -13,16 +11,12 @@ import 'package:flutter_web_plugins/flutter_web_plugins.dart';
|
||||
|
||||
void main() {
|
||||
group('$HashUrlStrategy', () {
|
||||
TestPlatformLocation location;
|
||||
late TestPlatformLocation location;
|
||||
|
||||
setUp(() {
|
||||
location = TestPlatformLocation();
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
location = null;
|
||||
});
|
||||
|
||||
test('leading slash is optional', () {
|
||||
final HashUrlStrategy strategy = HashUrlStrategy(location);
|
||||
|
||||
@@ -48,16 +42,12 @@ void main() {
|
||||
});
|
||||
|
||||
group('$PathUrlStrategy', () {
|
||||
TestPlatformLocation location;
|
||||
late TestPlatformLocation location;
|
||||
|
||||
setUp(() {
|
||||
location = TestPlatformLocation();
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
location = null;
|
||||
});
|
||||
|
||||
test('validates base href', () {
|
||||
location.baseHref = '/';
|
||||
expect(
|
||||
@@ -153,7 +143,7 @@ class TestPlatformLocation extends PlatformLocation {
|
||||
String hash = '';
|
||||
|
||||
@override
|
||||
dynamic state;
|
||||
Object? Function() state = () => null;
|
||||
|
||||
/// Mocks the base href of the document.
|
||||
String baseHref = '';
|
||||
|
||||
@@ -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.8
|
||||
|
||||
@TestOn('browser') // Uses web-only Flutter SDK
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
Reference in New Issue
Block a user