safe_browsing 0.0.4 copy "safe_browsing: ^0.0.4" to clipboard
safe_browsing: ^0.0.4 copied to clipboard

Using google safe browsing API to detect whether the URL is safe.

Safe Browsing #

Using google safe browsing API to detect whether the URL is safe.

Required #

Make sure that you're enabled the SafeBrowsing API in your google cloud console:

Usage #

This plugin requires you to use flutterfire_cli to create the DefaultFirebaseOptions for your project. Read more.

Create the instance

/// Create the instance from the `DefaultFirebaseOptions`
/// This class is created by `flutterfire_cli`
final safeBrowsing = SafeBrowsing(
  options: DefaultFirebaseOptions.currentPlatform,
  isDebug: !kReleaseMode,
);

/// The URL you want to check
final url = 'https://example.com';

/// Check whether the URL is safe and return `SafeBrowsingState`
final result = await safeBrowsing.check(url);

/// Check whether the URL is safe and return `bool`
final isSafe = await safeBrowsing.isSafe(url);

Additional #

Use this method to validate the URL

SafeBrowsing.validateUrl(url);
1
likes
0
points
45
downloads

Publisher

verified publisherlamnhan.dev

Weekly Downloads

Using google safe browsing API to detect whether the URL is safe.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

firebase_core, firebase_core_web, flutter, http, url_launcher

More

Packages that depend on safe_browsing