0.0.10
This commit is contained in:
parent
dcc5cf010f
commit
3e140d6310
@ -1,6 +1,7 @@
|
|||||||
## 0.0.10
|
## 0.0.10
|
||||||
|
|
||||||
- One little 'Y' I missed
|
- One little 'Y' I missed
|
||||||
|
- Fixed out of range error with `_adjustSelection`
|
||||||
|
|
||||||
## 0.0.9
|
## 0.0.9
|
||||||
|
|
||||||
|
@ -1073,7 +1073,7 @@ 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());
|
||||||
|
|
||||||
@ -1095,27 +1095,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user