flutter_stripe: CardField doesn't update data onCardChanged

83 Views Asked by At

I use flutter_stripe and flutter_stripe_web. When I try to print CardInputDetails it's always null, I don't get where is my mistake. Am I forgetting anything ?

Container(
  margin: EdgeInsets.only(
    top: mobile(context) ? 20 : 40,
  ),
  height: 45,
  width: sizeWidth(context),
  child: CardField(
    onCardChanged: (cardFieldInputDetails) {
      if(cardFieldInputDetails != null && cardFieldInputDetails.complete) {
        print(cardFieldInputDetails.number);
      }
    },
  ),
),

And here's what I saw in my console :

Height of Platform View type: [stripe_card] may not be set. Defaulting to height: 100%. Set style.height to any appropriate value to stop this message. Width of Platform View type: [stripe_card] may not be set. Defaulting to width: 100%. Set style.width to any appropriate value to stop this message. null

Somebody knows what I'm doing wrong ?

0

There are 0 best solutions below