build method

  1. @override
Widget build(
  1. BuildContext context,
  2. Spotlight element
)
override

Returns a Widget which gives element a visual representation in the Window.

This method is called when an element needs a visual representation for the first time and whenever the element notifies its listeners that it has changed.

Implementation

@override
Widget build(BuildContext context, Spotlight element) {
  final style = element.style.merge(this.style);

  return SizedBox.fromSize(
    size: style._size,
    child: DecoratedBox(
      decoration: BoxDecoration(
        shape: BoxShape.circle,
        gradient: style.gradient,
      ),
    ),
  );
}