initState method

  1. @override
void initState()
override

Initializes the state of the widget.

This is called when the widget is inserted into the tree.

It initializes the animation controller and the animation object, and then starts the animation by calling _controller.forward.

Implementation

@override
/// Initializes the state of the widget.
///
/// This is called when the widget is inserted into the tree.
///
/// It initializes the animation controller and the animation object,
/// and then starts the animation by calling [_controller.forward].
void initState() {
  super.initState();
  _controller = AnimationController(
    vsync: this,
    duration: const Duration(milliseconds: 350),
  );
  _animation = CurvedAnimation(parent: _controller, curve: Curves.easeInOut);
  _controller.forward();
}