errorAnimate static method

Widget errorAnimate({
  1. required String message,
  2. String source = AssetHelper.failed,
  3. bool useButton = false,
})

Implementation

static Widget errorAnimate({
  required String message,
  String source = AssetHelper.failed,
  bool useButton = false,
}) {
  return Container(
    decoration: BoxDecoration(
      borderRadius: BorderRadius.all(
        Radius.circular(15.r),
      ),
      color: Get.theme.colorScheme.background,
    ),
    padding: EdgeInsets.all(20.spMin),
    child: Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        Align(
          alignment: Alignment.center,
          child: Lottie.asset(
            source,
            height: 100.h,
          ),
        ),
        Padding(
          padding: EdgeInsets.only(top: 10.h),
          child: Align(
            alignment: Alignment.center,
            child: Texts.caption(
              message,
              textAlign: TextAlign.center,
              textOverflow: TextOverflow.visible,
            ),
          ),
        ),
        SizedBox(
          height: 20.h,
        ),
        useButton
            ? Align(
                alignment: Alignment.center,
                child: Buttons.defaultButton(
                  widget: Texts.subtitle2(
                    'OK',
                  ),
                  handler: () {
                    Get.back();
                  },
                ),
              )
            : const SizedBox(),
      ],
    ),
  );
}