google_my_business 0.2.1 copy "google_my_business: ^0.2.1" to clipboard
google_my_business: ^0.2.1 copied to clipboard

outdated

Flutter package to work with Google My Business API. Simplifies communication & interaction with GMB API endpoints.

Google My Business for Flutter #

Coverage Build

Dart / Flutter package to work with Google My Business API. Simplifies communication & interaction with GMB API endpoints.

More info on GMB API at Google My Business

Getting Started #

Authentication #

Uses a Flutter plugin Google Sign In for authentication.

API #

Supported endpoints:

Examples #

Example simple app can be found at /examples

Login

Init (subscribes for user changes, e.g. user signed in / signed out):

GoogleMyBusiness.instance.init((user) {
  setState(() {
    _currentUser = user;
  });
});

In case you would like to sign in manually:

GoogleMyBusiness.instance.signIn().then((user) {
  setState(() {
    _currentUser = user;

    // Use other API, open a new page or whatever
    // to access user, use GoogleMyBusiness.instance.currentUser()
  });
});

To sign out current user:

GoogleMyBusiness.instance.signOut();

Locations

Retrieve locations:

_locationsManager = LocationsManager(accountId: "my-account-id");

// ...

await _locationsManager.fetchLocations((locations) {
  print("Total locations: ${locations.length}");

  setState(() {
    _locations = locations;
    _isLoading = false;
  });
}, (error) {
  print('Google My Business API: ${error.code} - ${error.message}');
  setState(() {
    _isLoading = false;
  });
});
7
likes
0
points
21
downloads

Publisher

verified publisherolegnovosad.com

Weekly Downloads

Flutter package to work with Google My Business API. Simplifies communication & interaction with GMB API endpoints.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, google_sign_in, http, mockito

More

Packages that depend on google_my_business