GsiButtonConfiguration constructor

GsiButtonConfiguration({
  1. ButtonType? type,
  2. ButtonTheme? theme,
  3. ButtonSize? size,
  4. ButtonText? text,
  5. ButtonShape? shape,
  6. ButtonLogoAlignment? logo_alignment,
  7. double? width,
  8. String? locale,
  9. GsiButtonClickListenerFn? click_listener,
})

Constructs an options object for the renderButton method.

Implementation

factory GsiButtonConfiguration({
  /// The button type.
  ButtonType? type,

  /// The button theme.
  ButtonTheme? theme,

  /// The button size.
  ButtonSize? size,

  /// The button text.
  ButtonText? text,

  /// The button shape.
  ButtonShape? shape,

  /// The Google logo alignment in the button.
  ButtonLogoAlignment? logo_alignment,

  /// The minimum button width, in pixels.
  ///
  /// The maximum width is 400 pixels.
  double? width,

  /// The pre-set locale of the button text.
  ///
  /// If not set, the browser's default locale or the Google session user's
  /// preference is used.
  String? locale,

  /// A function to be called when the button is clicked.
  GsiButtonClickListenerFn? click_listener,
}) {
  return GsiButtonConfiguration._toJS(
    type: type.toString().toJS,
    theme: theme.toString().toJS,
    size: size.toString().toJS,
    text: text?.toString().toJS,
    shape: shape?.toString().toJS,
    logo_alignment: logo_alignment?.toString().toJS,
    width: width?.toJS,
    locale: locale?.toJS,
    click_listener: click_listener?.toJS,
  );
}