PlatformBuilder class

Builds a widget based on the most specific platform builder provided. Ex. If running on Android with PlatformBuilder.androidBuilder, PlatformBuilder.builder, and PlatformBuilder.nativeBuilder builders provided, the builder precedence order is as follows:

Inheritance

Constructors

PlatformBuilder({List<Platforms>? supportedPlatforms, Widget builder(BuildContext context)?, Widget webBuilder(BuildContext context)?, Widget nativeBuilder(BuildContext context)?, Widget androidBuilder(BuildContext context)?, Widget windowsBuilder(BuildContext context)?, Widget iOSBuilder(BuildContext context)?, Widget chromeExtensionBuilder(BuildContext context)?, Widget linuxBuilder(BuildContext context)?, Widget macOSBuilder(BuildContext context)?, Widget fuschiaBuilder(BuildContext context)?, dynamic key})
const

Properties

androidBuilder → (Widget Function(BuildContext context)?)
Builder for the android platform.
final
builder → (Widget Function(BuildContext context)?)
Builder for all platforms.
final
chromeExtensionBuilder → (Widget Function(BuildContext context)?)
Builder for the chrome extension platform.
final
fuschiaBuilder → (Widget Function(BuildContext context)?)
Builder for the fuschia platform.
final
hashCode int
The hash code for this object.
no setterinherited
iOSBuilder → (Widget Function(BuildContext context)?)
Builder for the iOS platform.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
linuxBuilder → (Widget Function(BuildContext context)?)
Builder for the linux platform.
final
macOSBuilder → (Widget Function(BuildContext context)?)
Builder for the macOS platform.
final
nativeBuilder → (Widget Function(BuildContext context)?)
Builder for all native platforms defined as platforms where the current platform is equal to the host platform. PlatformService.current == PlatformService.currentHost
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedPlatforms List<Platforms>?
A list of supported platforms this widget should check are covered by the provided builders. Defaults to the supported platform list specified to Platform.
final
webBuilder → (Widget Function(BuildContext context)?)
Builder for all web platforms.
final
windowsBuilder → (Widget Function(BuildContext context)?)
Builder for the windows platform.
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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}) 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