testing library

Test support for apps that show a OneTapLocationButton.

Tests that run on the host, such as widget tests, do not run the platform code of the plugin, so a OneTapLocationButton shows nothing that can be tapped, and OneTapLocationButton.checkAvailability cannot determine the availability on iOS and Android. Install a FakeOneTapLocation before pumping the widgets under test:

late FakeOneTapLocation location;

setUp(() {
  location = FakeOneTapLocation.install();
  addTearDown(location.uninstall);
});

Classes

FakeLocationRequest
A request for location access, made by a tap on a OneTapLocationButton that uses a FakeOneTapLocation.
FakeOneTapLocation
Stands in for the platform in tests of apps that show a OneTapLocationButton.