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.connectionState == ConnectionState.done) {
        return FlexHtmlElementView(
          viewType: 'gsi_login_button',
          onElementCreated: (Object element) {
            _gisSdkClient.renderButton(element, config);
          },
        );
      }
      return const Text('Getting ready');
    },
  );
}