Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

57 строки
1.6 KiB

  1. // Copyright 2013 The Flutter Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. import 'package:pigeon/pigeon.dart';
  5. @ConfigurePigeon(PigeonOptions(
  6. dartOut: 'lib/src/messages.g.dart',
  7. swiftOut: 'ios/url_launcher_ios/Sources/url_launcher_ios/messages.g.swift',
  8. copyrightHeader: 'pigeons/copyright.txt',
  9. ))
  10. /// Possible outcomes of launching a URL.
  11. enum LaunchResult {
  12. /// The URL was successfully launched (or could be, for `canLaunchUrl`).
  13. success,
  14. /// There was no handler available for the URL.
  15. failure,
  16. /// The URL could not be launched because it is invalid.
  17. invalidUrl,
  18. }
  19. /// Possible outcomes of handling a URL within the application.
  20. enum InAppLoadResult {
  21. /// The URL was successfully loaded.
  22. success,
  23. /// The URL did not load successfully.
  24. failedToLoad,
  25. /// The URL could not be launched because it is invalid.
  26. invalidUrl,
  27. }
  28. @HostApi()
  29. abstract class UrlLauncherApi {
  30. /// Checks whether a URL can be loaded.
  31. @ObjCSelector('canLaunchURL:')
  32. LaunchResult canLaunchUrl(String url);
  33. /// Opens the URL externally, returning the status of launching it.
  34. @async
  35. @ObjCSelector('launchURL:universalLinksOnly:')
  36. LaunchResult launchUrl(String url, bool universalLinksOnly);
  37. /// Opens the URL in an in-app SFSafariViewController, returning the results
  38. /// of loading it.
  39. @async
  40. @ObjCSelector('openSafariViewControllerWithURL:')
  41. InAppLoadResult openUrlInSafariViewController(String url);
  42. /// Closes the view controller opened by [openUrlInSafariViewController].
  43. void closeSafariViewController();
  44. }