toast_with_icon


A new toast package which can set icon as you want ,and allowed custom build.


How to Use

# add this line to your dependencies
toast_with_icon: ^1.0.0
  ToastWithIcon.toast(context,
                    showTime: 4000,
                    axis: Axis.horizontal,
                    bgColor: Colors.black45,
                    textSize: 15.0,
                    textColor: Colors.white,
                    paddingHorizontal: 10.0,
                    paddingVertical: 10.0,
                    iconWidth: 15.0,
                    iconHeight: 15.0,
                    positionedLeft: MediaQuery.of(context).size.width * 3 / 10,
                    positionedRight: MediaQuery.of(context).size.width * 3 / 10,
                    elevation: 0,
                    gravity: ToastWithIconGravity.TOP,
                    icon: 'image/success.png',
                    msg: 'iconToast on top');

API

propertydescriptiondefaultValue
iconString(Nullable)
msgString (non-null)
showTimeint2000
axisAxisAxis.horizontal
bgColorColorColors.white
textSizedouble15.0
textColorColorColors.white
paddingHorizontaldouble10.0
paddingVerticaldouble10.0
iconWidthdouble15.0
iconHeightdouble15.0
positionedLeftdoubleMediaQuery.of(context).size.width * 3 / 10
positionedRightdoubleMediaQuery.of(context).size.width * 3 / 10
elevationdouble1.0
gravityToastWithIconGravityToastWithIconGravity.CENTER

GitHub

Libraries

toast_with_icon