-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Added input decoration class (#153)
Co-authored-by: ManojPadiya <“manoj.p@simformsolutions.com”>
- Loading branch information
1 parent
7111fa2
commit ac89a76
Showing
6 changed files
with
128 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_credit_card/src/utils/constants.dart'; | ||
|
||
class InputConfiguration { | ||
/// Provides [InputDecoration] and [TextStyle] to [CreditCardForm]'s [TextField]. | ||
const InputConfiguration({ | ||
this.cardHolderDecoration = const InputDecoration( | ||
labelText: AppConstants.cardHolder, | ||
), | ||
this.cardNumberDecoration = const InputDecoration( | ||
labelText: AppConstants.cardNumber, | ||
hintText: AppConstants.sixteenX, | ||
), | ||
this.expiryDateDecoration = const InputDecoration( | ||
labelText: AppConstants.expiryDate, | ||
hintText: AppConstants.expiryDateShort, | ||
), | ||
this.cvvCodeDecoration = const InputDecoration( | ||
labelText: AppConstants.cvv, | ||
hintText: AppConstants.threeX, | ||
), | ||
this.cardNumberTextStyle, | ||
this.cardHolderTextStyle, | ||
this.expiryDateTextStyle, | ||
this.cvvCodeTextStyle, | ||
}); | ||
|
||
/// Provides decoration to card number text field. | ||
final InputDecoration cardNumberDecoration; | ||
|
||
/// Provides decoration to card holder text field. | ||
final InputDecoration cardHolderDecoration; | ||
|
||
/// Provides decoration to expiry date text field. | ||
final InputDecoration expiryDateDecoration; | ||
|
||
/// Provides decoration to cvv code text field. | ||
final InputDecoration cvvCodeDecoration; | ||
|
||
/// Provides textStyle to card number text field. | ||
final TextStyle? cardNumberTextStyle; | ||
|
||
/// Provides textStyle to card holder text field. | ||
final TextStyle? cardHolderTextStyle; | ||
|
||
/// Provides textStyle to expiry date text field. | ||
final TextStyle? expiryDateTextStyle; | ||
|
||
/// Provides textStyle to cvv code text field. | ||
final TextStyle? cvvCodeTextStyle; | ||
} |