GetX has been a blessing for us so far in terms of dependency injection and state management. However, we've come across an issue where we can't get built in animation Widgets to work,
These are built in widgets that require a vsync value. In our case, an AnimatedSize, but it could be others.
Those that don't require a vsync property, like AnimatedContainer, work fine with a controller that looks like this:
class BottomNavigationController extends GetxController with SingleGetTickerProviderMixin {
final height = 0.0.obs;
...
}
and then use it like this...
final BottomNavigation controller = Get.put(BottomNavigationController());
...
AnimatedContainer(
duration: Duration(seconds: 1),
child: PopUpMenu(),
height: controller.height.value
)
but in the case of, for instance, an AnimatedSize, the widget requires a vsync value... Any ideas on how I would do this?
if (navigationController.isMenuOpen.value)
AnimatedSize(
vsync: **value here can't be null**,
duration: Duration(seconds: 1),
child: PopUpMenu(),
)