renderButton method

Widget renderButton({
  1. GSIButtonConfiguration? configuration,
})

Render the GSI button web experience.

Implementation

Widget renderButton({GSIButtonConfiguration? configuration}) {
  final GSIButtonConfiguration config =
      configuration ?? GSIButtonConfiguration();
  return FutureBuilder<void>(
    key: Key(config.hashCode.toString()),
    future: initialized,
    builder: (BuildContext context, AsyncSnapshot<void> snapshot) {
      if (snapshot.hasData) {
        return FlexHtmlElementView(
            viewType: 'gsi_login_button',
            onElementCreated: (Object element) {
              _gisClient.renderButton(element, config);
            });
      }
      return const Text('Getting ready');
    },
  );
}