setDefaultValue method

dynamic setDefaultValue({
  1. Map? defaultValue,
  2. bool isInitState = false,
})

Implementation

setDefaultValue({Map? defaultValue, bool isInitState = false}) {
  setState(() {
    sizeController = AnimationController(
      vsync: this,
      duration:
          au.isAnimation(status: true, duration: Duration(milliseconds: 300)),
    );
    textWidth = CurvedAnimation(
      parent: sizeController,
      curve: Curves.fastOutSlowIn,
    );
    this.selectedItem = defaultValue ?? widget.defaultValue;
  });
  WidgetsBinding.instance!.addPostFrameCallback((_) {
    sizeController.forward();
  });
}