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/logo-intram.png",
                width: 70),
            SizedBox(
              height: 20,
            ),*/
            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,
            ),
            RoundedLoadingButton(
              width: size.width * 0.5,
              child: Text('Fermer',
                  style: TextStyle(color: Colors.white, fontSize: 18)),
              color: ColorConstant.fromHex(widget.color),
              controller: _btnController,
              borderRadius: 2,
              elevation: 0,
              onPressed: _doSomething,
            )
          ],
        ),
      );
    case "success":
      return Container(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            /* Image.asset(
                "packages/intram_sdk_flutter/assets/images/logo-intram.png",
                width: 70),
            SizedBox(
              height: 20,
            ),*/
            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,
            ),
            RoundedLoadingButton(
              width: size.width * 0.5,
              child: Text('Fermer',
                  style: TextStyle(color: Colors.white, fontSize: 18)),
              color: ColorConstant.fromHex(widget.color),
              controller: _btnController,
              borderRadius: 2,
              elevation: 0,
              onPressed: _doSomething,
            )
          ],
        ),
      );
  }
}