initStripe method
void
initStripe()
Implementation
void initStripe() {
attachController(controller);
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
if (!widget.dangerouslyUpdateFullCardDetails) {
if (kDebugMode &&
controller.details !=
const CardFieldInputDetails(complete: false)) {
dev.log('WARNING! Initial card data value has been ignored. \n'
'$kDebugPCIMessage');
}
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
updateCardDetails(
const CardFieldInputDetails(complete: false),
controller,
);
element = WebStripe.js
.elements(createElementOptions())
.createCard(createOptions())
..mount('#card-element'.toJS)
..onBlur(requestBlur)
..onFocus(requestFocus)
..onChange(onCardChanged);
});
}
});
}