0 purchases
crawler detector
Helps Flutter and Dart apps detect when they are being crawled by a web crawler.
Features #
This package pattern-matches the user agent string against a list of known
patterns to detect a crawler.
The implementation can detect crawlers in all Dart web targets, including
Flutter Web apps, and DOM-based Dart
apps (e.g. those using Jaspr or
AngularDart).
Dart VM targets are not web targets, and therefore you can never detect a
crawler from within the Dart VM (e.g. command-line Dart apps, Flutter mobile or
desktop apps).
Usage #
Add a dependency to pubspec.yaml:
dependencies:
crawler_detector: any
copied to clipboard
Import the package and use it:
import 'package:crawler_detector/crawler_detector.dart';
void main() {
final bool isCrawlerUserAgent = detectCrawler();
print('The current user agent is${isCrawlerUserAgent ? '' : ' not'} a crawler.');
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.