killswitch 1.0.1 copy "killswitch: ^1.0.1" to clipboard
killswitch: ^1.0.1 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'))),
      ),
    );
  }
}
1
likes
0
pub points
0%
popularity

Publisher

verified publishermatthewtrent.me

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

License

unknown (license)

Dependencies

flutter, http, shared_preferences

More

Packages that depend on killswitch