cloudflare_interceptor 0.0.2 copy "cloudflare_interceptor: ^0.0.2" to clipboard
cloudflare_interceptor: ^0.0.2 copied to clipboard

A flutter package to handle cloudflare challenges using webview and dio

A flutter package to handle cloudflare challenges using webview and dio

Features #

The handler widget will automatically open a webview for cloudflare when a challenge is detected.

Getting started #

To use the package, add cloudflare_interceptor to your pubspec.yaml file.

dependencies:
  cloudflare_interceptor: ^1.0.0

Then import the package to your dart file.

import 'package:cloudflare_interceptor/cloudflare_interceptor.dart';

Usage #

The package provides a CloudflareChallengeHandler widget that will handle the cloudflare challenge. The widget should be added as a parent of any area of ui code where you intend on using a cloudflare protected api / website. Ensure you use the same dio and cookie jar instance for the handler and the api / website.

CloudflareChallengeHandler(
  dio: dio,
  cookieJar: cookieJar,
  child: Scaffold(
    appBar: AppBar(
      title: Text('Cloudflare Challenge Handler Example'),
    ),
    body: Center(
      child: ElevatedButton(
        onPressed: () async {
          final response = await dio.get('https://example.com');
          print(response.data);
        },
        child: Text('Get Data'),
      ),
    ),
  ),
)
1
likes
140
points
83
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A flutter package to handle cloudflare challenges using webview and dio

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

cookie_jar, dio, dio_cookie_manager, flutter, flutter_inappwebview, html

More

Packages that depend on cloudflare_interceptor