install static method

ClikgateFake install({
  1. String? customerId,
  2. String? identityToken,
})

Installs a fake for the current test and returns it. Call it in setUp or at the start of a test; it's removed when the test ends (addTearDown).

customerId / identityToken: start as if Clikgate.identifyUser was already called (a signed-in user). Without them the installation isn't identified, and Engage calls that act for a user throw ClikgateException(not_identified) until the app calls identifyUser, as they do on a device.

Implementation

static ClikgateFake install({String? customerId, String? identityToken}) {
  TestWidgetsFlutterBinding.ensureInitialized();
  final fake = ClikgateFake._(customerId: customerId, identityToken: identityToken);
  fake._install();
  addTearDown(fake.uninstall);
  return fake;
}