Compare commits
3 Commits
713f35c692
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ffeb2d199 | |||
| 3e140d6310 | |||
| dcc5cf010f |
@@ -1,3 +1,8 @@
|
|||||||
|
## 0.0.10
|
||||||
|
|
||||||
|
- One little 'Y' I missed
|
||||||
|
- Fixed out of range error with `_adjustSelection`
|
||||||
|
|
||||||
## 0.0.9
|
## 0.0.9
|
||||||
|
|
||||||
- Drastically improved usability and performance with flutter web and canvaskit renderer, especially on mobile
|
- Drastically improved usability and performance with flutter web and canvaskit renderer, especially on mobile
|
||||||
|
|||||||
@@ -498,7 +498,7 @@ class CardTextFieldState extends State<CardTextField> {
|
|||||||
if (_isMobile &&
|
if (_isMobile &&
|
||||||
_expirationController.text ==
|
_expirationController.text ==
|
||||||
'\u200b')
|
'\u200b')
|
||||||
Text('MM/YYY', style: _hintTextSyle),
|
Text('MM/YY', style: _hintTextSyle),
|
||||||
TextFormField(
|
TextFormField(
|
||||||
key: const Key('expiration_field'),
|
key: const Key('expiration_field'),
|
||||||
focusNode: expirationFocusNode,
|
focusNode: expirationFocusNode,
|
||||||
@@ -914,9 +914,10 @@ class CardTextFieldState extends State<CardTextField> {
|
|||||||
// Makes an http call to stripe API with provided card credentials and returns the result
|
// Makes an http call to stripe API with provided card credentials and returns the result
|
||||||
Future<Map<String, dynamic>?> getStripeResponse() async {
|
Future<Map<String, dynamic>?> getStripeResponse() async {
|
||||||
if (widget.stripePublishableKey == null) {
|
if (widget.stripePublishableKey == null) {
|
||||||
if (kDebugMode)
|
if (kDebugMode) {
|
||||||
print(
|
print(
|
||||||
'***ERROR tried calling `getStripeResponse()` but no stripe key provided');
|
'***ERROR tried calling `getStripeResponse()` but no stripe key provided');
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1073,9 +1074,10 @@ class CardTextFieldState extends State<CardTextField> {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Make the selection adjustment after first frame builds
|
// Make the selection adjustment only on web, other platforms dont select on focus change
|
||||||
if (kIsWeb)
|
if (kIsWeb) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) => _adjustSelection());
|
WidgetsBinding.instance.addPostFrameCallback((_) => _adjustSelection());
|
||||||
|
}
|
||||||
|
|
||||||
if (!isWideFormat) {
|
if (!isWideFormat) {
|
||||||
_scrollRow(step);
|
_scrollRow(step);
|
||||||
@@ -1095,27 +1097,23 @@ class CardTextFieldState extends State<CardTextField> {
|
|||||||
switch (_currentStep) {
|
switch (_currentStep) {
|
||||||
case CardEntryStep.number:
|
case CardEntryStep.number:
|
||||||
final len = _cardNumberController.text.length;
|
final len = _cardNumberController.text.length;
|
||||||
final offset = len == 0 ? 1 : len;
|
|
||||||
_cardNumberController.value = _cardNumberController.value.copyWith(
|
_cardNumberController.value = _cardNumberController.value.copyWith(
|
||||||
selection: TextSelection(baseOffset: offset, extentOffset: offset));
|
selection: TextSelection(baseOffset: len, extentOffset: len));
|
||||||
break;
|
break;
|
||||||
case CardEntryStep.exp:
|
case CardEntryStep.exp:
|
||||||
final len = _expirationController.text.length;
|
final len = _expirationController.text.length;
|
||||||
final offset = len == 0 ? 0 : len;
|
|
||||||
_expirationController.value = _expirationController.value.copyWith(
|
_expirationController.value = _expirationController.value.copyWith(
|
||||||
selection: TextSelection(baseOffset: offset, extentOffset: offset));
|
selection: TextSelection(baseOffset: len, extentOffset: len));
|
||||||
break;
|
break;
|
||||||
case CardEntryStep.cvc:
|
case CardEntryStep.cvc:
|
||||||
final len = _securityCodeController.text.length;
|
final len = _securityCodeController.text.length;
|
||||||
final offset = len == 0 ? 0 : len;
|
|
||||||
_securityCodeController.value = _securityCodeController.value.copyWith(
|
_securityCodeController.value = _securityCodeController.value.copyWith(
|
||||||
selection: TextSelection(baseOffset: offset, extentOffset: offset));
|
selection: TextSelection(baseOffset: len, extentOffset: len));
|
||||||
break;
|
break;
|
||||||
case CardEntryStep.postal:
|
case CardEntryStep.postal:
|
||||||
final len = _postalCodeController.text.length;
|
final len = _postalCodeController.text.length;
|
||||||
final offset = len == 0 ? 0 : len;
|
|
||||||
_postalCodeController.value = _postalCodeController.value.copyWith(
|
_postalCodeController.value = _postalCodeController.value.copyWith(
|
||||||
selection: TextSelection(baseOffset: offset, extentOffset: offset));
|
selection: TextSelection(baseOffset: len, extentOffset: len));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
name: stripe_native_card_field
|
name: stripe_native_card_field
|
||||||
description: A native flutter implementation of the elegant Stripe Card Field.
|
description: A native flutter implementation of the elegant Stripe Card Field.
|
||||||
version: 0.0.9
|
version: 0.0.10
|
||||||
repository: https://git.fosscat.com/n8r/stripe_native_card_field
|
repository: https://git.fosscat.com/n8r/stripe_native_card_field
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user