Skip to content
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

Use sharezone_lints for url_launcher_extended #416

Merged
merged 2 commits into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions lib/url_launcher_extended/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2023 Sharezone UG (haftungsbeschränkt)
# Licensed under the EUPL-1.2-or-later.
#
# You may obtain a copy of the Licence at:
# https://joinup.ec.europa.eu/software/page/eupl
#
# SPDX-License-Identifier: EUPL-1.2

include: package:sharezone_lints/analysis_options.yaml
26 changes: 13 additions & 13 deletions lib/url_launcher_extended/lib/src/url_launcher_extended.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class UrlLauncherExtended {
WebViewConfiguration webViewConfiguration = const WebViewConfiguration(),
String? webOnlyWindowName,
}) async {
final _canLaunch = await canLaunchUrl(url);
if (!_canLaunch) {
final canLaunch = await canLaunchUrl(url);
if (!canLaunch) {
throw CouldNotLaunchUrlException(url);
}

Expand Down Expand Up @@ -116,8 +116,8 @@ class UrlLauncherExtended {
},
);

final _canLaunch = await canLaunchUrl(emailLaunchString);
if (!_canLaunch) {
final canLaunch = await canLaunchUrl(emailLaunchString);
if (!canLaunch) {
throw CouldNotLaunchMailException(address, subject: subject, body: body);
}

Expand All @@ -133,13 +133,13 @@ class CouldNotLaunchMailException implements Exception {
CouldNotLaunchMailException(this.address, {this.subject, this.body});

@override
bool operator ==(Object o) {
if (identical(this, o)) return true;
bool operator ==(Object other) {
if (identical(this, other)) return true;

return o is CouldNotLaunchMailException &&
o.address == address &&
o.subject == subject &&
o.body == body;
return other is CouldNotLaunchMailException &&
other.address == address &&
other.subject == subject &&
other.body == body;
}

@override
Expand All @@ -157,10 +157,10 @@ class CouldNotLaunchUrlException implements Exception {
CouldNotLaunchUrlException(this.url);

@override
bool operator ==(Object o) {
if (identical(this, o)) return true;
bool operator ==(Object other) {
if (identical(this, other)) return true;

return o is CouldNotLaunchUrlException && o.url == url;
return other is CouldNotLaunchUrlException && other.url == url;
}

@override
Expand Down
23 changes: 23 additions & 0 deletions lib/url_launcher_extended/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_lints:
dependency: transitive
description:
name: flutter_lints
sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c
url: "https://pub.dev"
source: hosted
version: "2.0.1"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -168,6 +176,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.5"
lints:
dependency: transitive
description:
name: lints
sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
logging:
dependency: transitive
description:
Expand Down Expand Up @@ -256,6 +272,13 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.3"
sharezone_lints:
dependency: "direct dev"
description:
path: "../sharezone_lints"
relative: true
source: path
version: "1.0.0"
shelf:
dependency: transitive
description:
Expand Down
2 changes: 2 additions & 0 deletions lib/url_launcher_extended/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ dev_dependencies:
flutter_test:
sdk: flutter
test: ^1.22.0
sharezone_lints:
path: ../sharezone_lints
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import 'package:test/test.dart';
import 'package:url_launcher_extended/mock_url_launcher_extended.dart';

import '../lib/url_launcher_extended.dart';
import 'package:url_launcher_extended/url_launcher_extended.dart';

void main() {
group('MockUrlLauncherExtended', () {
Expand Down