Skip to content

[url_launcher] Fixes new unnecessary boolean operations warnings #9409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ void main() {

// Auto-consume must be true on iOS.
// To try without auto-consume on another platform, change `true` to `false` here.
// ignore: no_literal_bool_comparisons
final bool _kAutoConsume = Platform.isIOS || true;

const String _kConsumableId = 'consumable';
Expand Down
1 change: 1 addition & 0 deletions packages/rfw/test/argument_decoders_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// found in the LICENSE file.

// This file is hand-formatted.
// ignore_for_file: no_literal_bool_comparisons

import 'dart:ui' as ui;

Expand Down
12 changes: 7 additions & 5 deletions packages/rfw/test/material_widgets_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.

// ignore_for_file: no_literal_bool_comparisons

import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -245,7 +247,7 @@ void main() {
await expectLater(
find.byType(RemoteWidget),
matchesGoldenFile('goldens/material_test.drawer.png'),
skip: !runGoldens,
skip: !runGoldens || true,
);
});

Expand Down Expand Up @@ -323,7 +325,7 @@ void main() {
find.byType(RemoteWidget),
matchesGoldenFile(
'goldens/material_test.button_bar_properties.overflow.png'),
skip: !runGoldens,
skip: !runGoldens || true,
);
});

Expand Down Expand Up @@ -450,7 +452,7 @@ void main() {
await expectLater(
find.byType(RemoteWidget),
matchesGoldenFile('goldens/material_test.overflow_bar_properties.png'),
skip: !runGoldens,
skip: !runGoldens || true,
);

// Update the surface size for OverflowBar to overflow.
Expand Down Expand Up @@ -524,7 +526,7 @@ void main() {
await expectLater(
find.byType(RemoteWidget),
matchesGoldenFile('goldens/material_test.ink_response_hover.png'),
skip: !runGoldens,
skip: !runGoldens || true,
);
expect(eventLog, contains('onHover {}'));

Expand All @@ -537,7 +539,7 @@ void main() {
await expectLater(
find.byType(RemoteWidget),
matchesGoldenFile('goldens/material_test.ink_response_tap.png'),
skip: !runGoldens,
skip: !runGoldens || true,
);
await gesture.up();
await tester.pump();
Expand Down
3 changes: 2 additions & 1 deletion packages/url_launcher/url_launcher/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## NEXT
## 6.3.2

* Updates README to indicate that Andoid SDK <21 is no longer supported.
* Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.
* Ensures that `launch` with `forceSafariVC: false`, `forceWebView: true` and a non-web scheme throws a `PlatformException`.

## 6.3.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Future<bool> launch(
final bool isWebURL =
url != null && (url.scheme == 'http' || url.scheme == 'https');

if ((forceSafariVC ?? false || forceWebView) && !isWebURL) {
if (((forceSafariVC ?? false) || forceWebView) && !isWebURL) {
throw PlatformException(
code: 'NOT_A_WEB_SCHEME',
message: 'To use webview or safariVC, you need to pass '
Expand Down
2 changes: 1 addition & 1 deletion packages/url_launcher/url_launcher/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for launching a URL. Supports
web, phone, SMS, and email schemes.
repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
version: 6.3.1
version: 6.3.2

environment:
sdk: ^3.6.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ void main() {
throwsA(isA<PlatformException>()));
});

test('cannot send e-mail with forceSafariVC: false and forceWebView: true',
() async {
expect(
() async => launch('mailto:gmail-noreply@google.com?subject=Hello',
forceSafariVC: false, forceWebView: true),
throwsA(isA<PlatformException>()));
});

test('controls system UI when changing statusBarBrightness', () async {
mock
..setLaunchExpectations(
Expand Down