getView method

dynamic getView(
  1. dynamic context
)

Implementation

getView(context) {
  switch (page) {
    case "loading":
      return LoadingWidget(
        text: "Création de la demande de paiement",
        color: widget.color,
      );
    case "make_pay":
      return viewMakePay(context);
    case "error":
      return Container(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Image.asset("packages/intram_sdk_flutter/assets/images/error.png",
                width: 180),
            SizedBox(
              height: 10,
            ),
            SizedBox(
              width: size.width * 0.8,
              child: Text(
                "Le paiement a échoué. Veuillez vérifier que les informations de paiement que vous avez fournies sont correctes. ",
                style: TextStyle(color: Colors.black, fontSize: 15),
                textAlign: TextAlign.center,
              ),
            ),
            SizedBox(
              height: 25,
            ),
            ButtonWidget(
              text: 'FERMER',
              textColor: ColorConstant.white,
              bgColor: ColorConstant.fromHex(widget.color),
              brdColor: ColorConstant.fromHex(widget.color),
              width: size.width * 0.5,
              tap: () async {
                _doSomething();
              },
            ),
          ],
        ),
      );
    case "success":
      return Container(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            Image.asset(
                "packages/intram_sdk_flutter/assets/images/success.png",
                width: 180),
            SizedBox(
              height: 10,
            ),
            SizedBox(
              width: size.width * 0.8,
              child: Text(
                "Félicitations ! Votre paiement a été effectué avec succès. Vous pouvez maintenant profiter des avantages ou des produits que vous avez achetés.",
                style: TextStyle(color: Colors.black, fontSize: 15),
                textAlign: TextAlign.center,
              ),
            ),
            SizedBox(
              height: 25,
            ),
            ButtonWidget(
              text: 'FERMER',
              textColor: ColorConstant.white,
              bgColor: ColorConstant.fromHex(widget.color),
              brdColor: ColorConstant.fromHex(widget.color),
              width: size.width * 0.5,
              tap: () async {
                _doSomething();
              },
            ),
          ],
        ),
      );
  }
}