Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Fix analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Garcia committed Dec 17, 2020
1 parent 16d759e commit d5a0ce9
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 27 deletions.
5 changes: 4 additions & 1 deletion packages/android_intent/test/android_intent_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// 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:android_intent/flag.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
Expand All @@ -11,7 +13,8 @@ import 'package:platform/platform.dart';

void main() {
AndroidIntent androidIntent;
late MockMethodChannel mockChannel;
MockMethodChannel mockChannel;

setUp(() {
mockChannel = MockMethodChannel();
when(mockChannel.invokeMethod<bool>('canResolveActivity', any))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// for details. All rights reserved. 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_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:flutter_plugin_android_lifecycle_example/main.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright 2019, the Chromium project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// ignore_for_file: public_member_api_docs

import 'package:flutter/material.dart';
Expand Down
14 changes: 6 additions & 8 deletions packages/flutter_plugin_android_lifecycle/example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
name: flutter_plugin_android_lifecycle_example
description: Demonstrates how to use the flutter_plugin_android_lifecycle plugin.
publish_to: 'none'

environment:
sdk: ">=2.12.0-0 <3.0.0"

dependencies:
flutter:
sdk: flutter
integration_test:
path: ../../integration_test
flutter_plugin_android_lifecycle:
path: ../

dev_dependencies:
integration_test:
path: ../../integration_test
flutter_test:
sdk: flutter
pedantic: ^1.8.0

flutter_plugin_android_lifecycle:
path: ../
environment:
sdk: ">=2.12.0-0 <3.0.0"

flutter:
uses-material-design: true
2 changes: 1 addition & 1 deletion packages/ios_platform_images/example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:ios_platform_images_example/main.dart';
void main() {
testWidgets('Verify loads image', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
await ;

// Verify that platform version is retrieved.
expect(
Expand Down
10 changes: 6 additions & 4 deletions packages/local_auth/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ class MyApp extends StatefulWidget {

class _MyAppState extends State<MyApp> {
final LocalAuthentication auth = LocalAuthentication();
bool _canCheckBiometrics;
List<BiometricType> _availableBiometrics;
late bool _canCheckBiometrics;
late List<BiometricType> _availableBiometrics;
String _authorized = 'Not Authorized';
bool _isAuthenticating = false;

Future<void> _checkBiometrics() async {
bool canCheckBiometrics;
late bool canCheckBiometrics;
try {
canCheckBiometrics = await auth.canCheckBiometrics;
} on PlatformException catch (e) {
canCheckBiometrics = false;
print(e);
}
if (!mounted) return;
Expand All @@ -41,10 +42,11 @@ class _MyAppState extends State<MyApp> {
}

Future<void> _getAvailableBiometrics() async {
List<BiometricType> availableBiometrics;
late List<BiometricType> availableBiometrics;
try {
availableBiometrics = await auth.getAvailableBiometrics();
} on PlatformException catch (e) {
availableBiometrics = <BiometricType>[];
print(e);
}
if (!mounted) return;
Expand Down
2 changes: 1 addition & 1 deletion packages/local_auth/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ flutter:
uses-material-design: true

environment:
sdk: ">=2.1.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0"
6 changes: 6 additions & 0 deletions packages/local_auth/integration_test/local_auth_test.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// Copyright 2017 The Chromium Authors. All rights reserved.
// 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_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

Expand Down
2 changes: 2 additions & 0 deletions packages/share/integration_test/share_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// for details. All rights reserved. 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_test/flutter_test.dart';
import 'package:share/share.dart';
import 'package:integration_test/integration_test.dart';
Expand Down
2 changes: 1 addition & 1 deletion packages/share/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ flutter:
dependencies:
meta: ^1.3.0-nullsafety.6
mime: ^1.0.0-nullsafety.0
test: ^1.16.0-nullsafety.13
flutter:
sdk: flutter

dev_dependencies:
test: ^1.16.0-nullsafety.13
mockito: ^4.1.3
flutter_test:
sdk: flutter
Expand Down
4 changes: 3 additions & 1 deletion packages/share/test/share_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// 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:io';
import 'dart:ui';

Expand All @@ -15,7 +17,7 @@ import 'package:flutter/services.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();

late MockMethodChannel mockChannel;
MockMethodChannel mockChannel;

setUp(() {
mockChannel = MockMethodChannel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,12 @@ void main() {
videoTestBase64 = base64Encode(const Utf8Encoder().convert(videoTest));
});

test('Auto media playback', () async {
testWidgets('Auto media playback', (WidgetTester tester) async {
Completer<WebViewController> controllerCompleter =
Completer<WebViewController>();
Completer<void> pageLoaded = Completer<void>();

await pumpWidget(
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: WebView(
Expand All @@ -390,7 +390,7 @@ void main() {
pageLoaded = Completer<void>();

// We change the key to re-create a new webview as we change the initialMediaPlaybackPolicy
await pumpWidget(
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: WebView(
Expand All @@ -416,13 +416,13 @@ void main() {
expect(isPaused, _webviewBool(true));
});

test('Changes to initialMediaPlaybackPolicy are ignored', () async {
testWidgets('Changes to initialMediaPlaybackPolicy are ignored', (WidgetTester tester) async {
final Completer<WebViewController> controllerCompleter =
Completer<WebViewController>();
Completer<void> pageLoaded = Completer<void>();

final GlobalKey key = GlobalKey();
await pumpWidget(
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: WebView(
Expand All @@ -447,7 +447,7 @@ void main() {

pageLoaded = Completer<void>();

await pumpWidget(
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: WebView(
Expand All @@ -474,12 +474,12 @@ void main() {
expect(isPaused, _webviewBool(false));
});

test('Video plays inline when allowsInlineMediaPlayback is true', () async {
testWidgets('Video plays inline when allowsInlineMediaPlayback is true', (WidgetTester tester) async {
Completer<WebViewController> controllerCompleter =
Completer<WebViewController>();
Completer<void> pageLoaded = Completer<void>();

await pumpWidget(
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: WebView(
Expand Down Expand Up @@ -507,7 +507,7 @@ void main() {
controllerCompleter = Completer<WebViewController>();
pageLoaded = Completer<void>();

await pumpWidget(
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: WebView(
Expand Down
2 changes: 1 addition & 1 deletion packages/webview_flutter/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: webview_flutter_example
description: Demonstrates how to use the webview_flutter plugin.

environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
sdk: ">=2.12.0-0 <3.0.0"

dependencies:
flutter:
Expand Down

0 comments on commit d5a0ce9

Please sign in to comment.