1

I'm currently struggling on using an AnimatedSwitcher combined with Cubit.

Here is my current code-part:

  @override
  Widget build(BuildContext context) {
    return BlocBuilder<LoginModalCubit, LoginModalState>(
      builder: (context, state) {
        return AnimatedSwitcher(
          duration: Duration(milliseconds: 500),
          child: Container(
              decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.only(
                      topLeft: Radius.circular(3 * bu),
                      topRight: Radius.circular(3 * bu))),
              child:
              Padding(padding: const EdgeInsets.all(5 * bu),
                  child: state.currentWidget)),
        );
      },
    );
  }

In the Cubit, I pass a widget with content for a BottomModalSheet. The content is changing as wanted, but I would like to animate it a little bit, but can't get it to work :(

kalinor
  • 159
  • 1
  • 11

0 Answers0