call method

Widget call(
  1. Widget child,
  2. double height,
  3. double anim
)

Implementation

Widget call(Widget child, double height, double anim) {
  final self = this;
  switch (self) {
    case ToastPlacement.top:
      return Column(
        children: [
          Container(
            margin: EdgeInsets.only(top: 50),
            height: height,
            child: Opacity(
              child: child,
              opacity: anim,
            ),
          ),
          Expanded(
            child: Container(),
          ),
        ],
      );
    case ToastPlacement.center:
      return Column(
        mainAxisSize: MainAxisSize.max,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Container(
            margin: EdgeInsets.only(top: 50),
            height: height,
            child: Opacity(
              child: child,
              opacity: anim,
            ),
          ),
        ],
      );

    case ToastPlacement.bottom:
      return Column(
        children: [
          Expanded(
            child: Container(),
          ),
          Container(
            margin: EdgeInsets.only(bottom: 50),
            height: height,
            child: Opacity(
              child: child,
              opacity: anim,
            ),
          ),
        ],
      );
  }
}