killswitch 1.0.3 copy "killswitch: ^1.0.3" to clipboard
killswitch: ^1.0.3 copied to clipboard

Killswitch that listens to a URL and will kill the app if the URL returns a bad status code. You can also whitelist an app via a different status code.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:killswitch/killswitch.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Killswitch(
        killWhitelistAndIgnoreSourceUrl: "https://example.com/killswitch",
        suppressErrors: true,
        killedAppText:
            "Hi! This is the developer speaking. I killed the app. Please contact me for help by tapping this message.",
        killedAppTextClicked: () => print("user tapped the killed app text"),
        killStatusCode: 403,
        whitelistStatusCode: 202,
        doNothingStatusCode: 200,
        onKill: () => print("app was killed"),
        onWhitelist: () => print("app was whitelisted"),
        failuresToConnectToSourceBeforeWhitelist: 3,
        child: const Scaffold(body: Center(child: Text('Some example app'))),
      ),
    );
  }
}
2
likes
160
points
72
downloads

Publisher

verified publishermatthewtrent.me

Weekly Downloads

Killswitch that listens to a URL and will kill the app if the URL returns a bad status code. You can also whitelist an app via a different status code.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http, shared_preferences

More

Packages that depend on killswitch