disableWarningPrompt function

Future disableWarningPrompt(
  1. BuildContext context,
  2. String namespace
)

Implementation

Future<dynamic> disableWarningPrompt(BuildContext context, String namespace) {
  return showDialog(
      builder: (ctx) => AlertDialog(
            title: Text('Warning: Are you sure?'),
            content: Text(
                'Disabling a feature that is currently active can result in breakage. E.g. if your Route becomes unavailable. Please confirm before continuing'),
            actions: [
              MaterialButton(
                onPressed: () {
                  Navigator.of(context).pop();
                },
                child: Text('Cancel'),
              ),
              MaterialButton(
                onPressed: () {
                  DartBoardCore.instance
                      .setFeatureImplementation(namespace, null);
                  Navigator.of(context).pop();
                },
                child: Text('OK'),
              )
            ],
          ),
      context: context);
}