YToggleWidget function
Widget
YToggleWidget({
- required bool isShowChildA,
- required Widget childA(),
- required Widget childB(),
- int duration = 300,
- AnimatedSwitcherTransitionBuilder? transitionBuilder,
Implementation
Widget YToggleWidget({
required bool isShowChildA,
required Widget Function() childA,
required Widget Function() childB,
int duration = 300,
AnimatedSwitcherTransitionBuilder? transitionBuilder,
}) {
return AnimatedSwitcher(
transitionBuilder: transitionBuilder ?? AnimatedSwitcher.defaultTransitionBuilder,
duration: Duration(milliseconds: duration),
child: isShowChildA ? Container(child: childA()) : SizedBox(child: childB()),
);
}