| // Copyright 2021 The Flutter Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| import 'package:url_launcher_platform_interface/link.dart'; |
| import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; |
| |
| class FakeUrlLauncher extends UrlLauncherPlatform { |
| final List<String> launches = <String>[]; |
| |
| @override |
| Future<bool> canLaunch(String url) { |
| throw UnimplementedError('canLaunch() has not been implemented.'); |
| } |
| |
| @override |
| LinkDelegate? get linkDelegate => throw UnimplementedError('linkDelegate has not been implemented.'); |
| |
| @override |
| Future<bool> launch( |
| String url, { |
| required bool useSafariVC, |
| required bool useWebView, |
| required bool enableJavaScript, |
| required bool enableDomStorage, |
| required bool universalLinksOnly, |
| required Map<String, String> headers, |
| String? webOnlyWindowName, |
| }) { |
| launches.add(url); |
| return Future<bool>.value(true); |
| } |
| |
| @override |
| Future<void> closeWebView() { |
| throw UnimplementedError('closeWebView() has not been implemented.'); |
| } |
| } |