MicrosoftSignInWidget class
A widget that provides Microsoft Sign-In functionality for all platforms.
The widget can manage its own authentication state, or you can provide an external controller for advanced use cases like sharing state across multiple widgets or integrating with state management solutions.
When controller is not provided, you must supply client and optionally onAuthenticated and onError callbacks. When controller is provided, those callbacks are handled by the controller itself.
Example with managed state:
MicrosoftSignInWidget(
client: client,
onAuthenticated: () => Navigator.push(...),
onError: (error) => showSnackBar(...),
)
Example with external controller:
MicrosoftSignInWidget(
controller: controller,
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MicrosoftSignInWidget
Constructors
-
MicrosoftSignInWidget({MicrosoftAuthController? controller, ServerpodClientShared? client, VoidCallback? onAuthenticated, dynamic onError(Object error)?, List<
String> scopes = MicrosoftAuthController.defaultScopes, MicrosoftButtonStyle style = MicrosoftButtonStyle.light, SignInButtonSize size = SignInButtonSize.large, SignInButtonTextVariant text = SignInButtonTextVariant.continueWith, SignInButtonShape shape = SignInButtonShape.pill, SignInButtonLogoAlignment logoAlignment = SignInButtonLogoAlignment.center, double minimumWidth = 240, TextStyle? textStyle, Key? key}) -
Creates a Microsoft Sign-In widget.
const
Properties
- client → ServerpodClientShared?
-
The Serverpod client instance.
final
- controller → MicrosoftAuthController?
-
Controls the authentication state and behavior.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- logoAlignment → SignInButtonLogoAlignment
-
The Microsoft logo alignment: left or center.
final
- minimumWidth → double
-
The minimum button width, in pixels.
final
- onAuthenticated → VoidCallback?
-
Callback when authentication is successful.
final
- onError → dynamic Function(Object error)?
-
Callback when an error occurs during authentication.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
scopes
→ List<
String> -
Scopes to request from Microsoft.
final
- shape → SignInButtonShape
-
The button shape.
final
- size → SignInButtonSize
-
The button size.
final
- style → MicrosoftButtonStyle
-
The brand color preset (light or dark).
final
- text → SignInButtonTextVariant
-
The button label variant.
final
- textStyle → TextStyle?
-
The text style applied to the button label.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MicrosoftSignInWidget> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited