Skip to content

Commit 51b3d27

Browse files
committed
Added creditcard form
1 parent d49d999 commit 51b3d27

File tree

7 files changed

+86
-0
lines changed

7 files changed

+86
-0
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
slug: creditcardform
3+
title: CreditCardForm
4+
tags: []
5+
description: Learn how to add CreditCardForm in your FlutterFlow app.
6+
sidebar_position: 7
7+
---
8+
# CreditCardForm
9+
The CreditCardForm widget allows users to enter their credit card details such as card number, expiry date, and CVV.
10+
11+
You can use this widget when you want to accept payment via credit card while using the [Braintree payment](#) method.
12+
13+
## Adding CreditCardForm widget
14+
15+
Here's an example of how you can add the CreditCardForm widget to your project:
16+
17+
1. First, drag the **CreditCardForm** widget from the **Form Elements** tab (in the Widget Panel) or add it directly from the widget tree.
18+
2. When you type in, the card number gets obscured (number becomes •, i.e., dot). To disable this feature and allows users to see the full number, move to the properties panel, find the **Obscure Card Number** toggle and turn it off.
19+
20+
![Adding CreditCardForm widget](imgs/adding-credit-card-form.gif)
21+
22+
## Customizing
23+
24+
You can customize the behavior and appearance of this widget using the various properties available under the properties panel.
25+
26+
### Obscuring CVV
27+
28+
By default, the CVV number is visible when you type in. It's essential that you obscure (number becomes •, i.e. dot) it.
29+
30+
To obscure the CVV:
31+
32+
1. Select the **CreditCardForm** widget from the widget tree or the canvas area.
33+
2. Move to the properties panel, find the **Obscure CVV** toggle and turn it on.
34+
35+
![Obscuring CVV](imgs/obscure-cvv.gif)
36+
37+
### Adding background color
38+
39+
To change the background color of the fields:
40+
41+
1. Select **CreditCardForm** from the widget tree or the canvas area.
42+
2. Move to the Properties panel and scroll down to the **Input Decoration Properties** section.
43+
3. Find the **Fill** toggle and turn it on.
44+
4. Now find the **Fill Color** property, click on the box next to **Unset**, select the color, and then click **Use Color** or click on **Unset** and enter a Hex Code directly. You can also choose the color by clicking on the Palette and Simple buttons.
45+
46+
![Adding background color](imgs/background-color.gif)
47+
48+
### Customizing border
49+
50+
To customize the border around the credit card fields:
51+
52+
1. Select **CreditCardForm** from the widget tree or the canvas area.
53+
2. Move to the Properties panel and scroll down to the **Input Decoration Properties** section.
54+
3. Select from the **Input Border Type** dropdown.
55+
1. Choose **Outline** to place a border around the entire field.
56+
2. Choose **Underline** to place a border only on the bottom of the field.
57+
3. Choose **None** to eradicate the border.
58+
4. Scroll down a bit to find the **Border Color** property, click on the box next to the already selected color, select the color, and then click **Use Color** or click on an already selected color and enter a Hex Code directly. You can also choose the color by clicking on the Palette and Simple buttons.
59+
5. Find the **Border Width** property below, and enter the desired value.
60+
6. Now, Enter the **Border Radius** property and enter the value as 50. By default, the value 50 will be set for all corners, which are TL (Top left), TR (top right), BL (bottom left), and BR (bottom right). Click on the lock icon to change each corner separately.
61+
62+
![Customizing border](imgs/ccf-border.gif)
63+
64+
### Add content padding
65+
66+
Content padding adds space between the field text and the border.
67+
68+
To add the content padding:
69+
70+
1. Select **CreditCardForm** from the widget tree or the canvas area.
71+
2. Move to the Properties panel (on the right side of your screen) and scroll down to the **Input Decoration Properties** section.
72+
3. Find the **Content Padding** property and enter the values for L(left), T(top), R(right), and B(bottom) input boxes.
73+
74+
![Add content padding](imgs/ccf-content-padding.gif)
75+
76+
### Reducing field height
77+
78+
You might want to reduce the field height to match your design. Using the dense property, you can reduce the field height to a predefined size.
79+
80+
To reduce the field height:
81+
82+
1. Select **CreditCardForm** from the widget tree or the canvas area.
83+
2. Move to the Properties panel (on the right side of your screen) and scroll down to the **Input Decoration Properties** section.
84+
3. Find the **Dense** toggle and turn it on.
85+
86+
![Reducing field height](imgs/ccf-reduce-height.gif)
1.48 MB
Loading
3.13 MB
Loading
2.39 MB
Loading
1.51 MB
Loading
1.68 MB
Loading
1.58 MB
Loading

0 commit comments

Comments
 (0)