createRenderObject method
Creates an instance of the RenderObject class that this RenderObjectWidget represents, using the configuration described by this RenderObjectWidget.
This method should not do anything with the children of the render object. That should instead be handled by the method that overrides RenderObjectElement.mount in the object rendered by this object's createElement method. See, for example, SingleChildRenderObjectElement.mount.
Implementation
@override
RenderObject createRenderObject(BuildContext context) {
final LinearGaugeScope linearGaugeScope = LinearGaugeScope.of(context);
final ThemeData themeData = Theme.of(context);
final bool isMaterial3 = themeData.useMaterial3;
final bool isDarkTheme = themeData.brightness == Brightness.dark;
final Color barPointerColor = isMaterial3
? (isDarkTheme ? const Color(0XFFFFF500) : const Color(0XFF06AEE0))
: themeData.colorScheme.primary;
return RenderLinearBarPointer(
value: value,
edgeStyle: edgeStyle,
shaderCallback: shaderCallback,
color: color ?? barPointerColor,
borderColor: borderColor ?? barPointerColor,
borderWidth: borderWidth,
thickness: thickness,
offset: offset,
position: position,
orientation: linearGaugeScope.orientation,
isAxisInversed: linearGaugeScope.isAxisInversed,
onAnimationCompleted: onAnimationCompleted,
animationController: linearGaugeScope.animationController,
pointerAnimation: linearGaugeScope.animation);
}