@@ -15,18 +15,18 @@ Below is a preview of what your app will look like once completed:
15
15
![ flutterflow-quick-start-app-demo.avif] ( ../../static/img/flutterflow-quick-start-app-demo.avif )
16
16
17
17
## ** What you'll learn**
18
- > - Creating layouts (add widgets)
19
- > - Adding interactivity to UI elements
20
- > - Handle app behavior in response to user interactions (manage state).
21
- > - Running your app
18
+ - Creating layouts (add widgets)
19
+ - Adding interactivity to UI elements
20
+ - Handle app behavior in response to user interactions (manage state).
21
+ - Running your app
22
22
23
23
<br />
24
24
The steps to build the app are as follows:
25
25
26
26
1 . [ Clone or create project] ( #clone-project )
27
27
2 . [ Building UI] ( #build-ui )
28
28
3 . [ Customize style] ( #customize-style )
29
- 4 . [ Add state] ( #add -state )
29
+ 4 . [ Manage state] ( #manage -state )
30
30
5 . [ Run the app] ( #run-app )
31
31
32
32
## 1. Clone or create project {#clone-project}
@@ -45,10 +45,34 @@ In this section, we'll see how to build the user interface (UI) for this feature
45
45
46
46
To build the UI:
47
47
48
- <iframe src =" https://demo.arcade.software/5CNFKTzhvnHPrLyZNzgZ?embed&show_copy_link=true " title =" Update product quantity " frameborder =" 0 " loading =" lazy " webkitallowfullscreen mozallowfullscreen allowfullscreen allow =" clipboard-write " width =" 100% " height =" 500 " ></iframe >
48
+ <div style={{
49
+ position: 'relative',
50
+ paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
51
+ height: 0,
52
+ width: '100%'
53
+ }}>
54
+ <iframe
55
+ src="https://demo.arcade.software/5CNFKTzhvnHPrLyZNzgZ?embed&show_copy_link=true "
56
+ title="Sharing a Project with a User"
57
+ style={{
58
+ position: 'absolute',
59
+ top: 0,
60
+ left: 0,
61
+ width: '100%',
62
+ height: '100%',
63
+ colorScheme: 'light'
64
+ }}
65
+ frameborder="0"
66
+ loading="lazy"
67
+ webkitAllowFullScreen
68
+ mozAllowFullScreen
69
+ allowFullScreen
70
+ allow="clipboard-write">
71
+ </iframe >
72
+ </div >
49
73
50
74
::: info
51
- You can learn more about creating layouts [here](#).
75
+ You can learn more about creating layouts [ here] ( # ) .
52
76
:::
53
77
54
78
## 3. Customize Style {#customize-style}
@@ -57,24 +81,129 @@ The next step is to customize the style of UI elements. This includes changing t
57
81
58
82
To customize the style:
59
83
60
- <iframe src =" https://demo.arcade.software/MGpg8TSzMGBusCGyOk89?embed&show_copy_link=true " title =" Update product quantity " frameborder =" 0 " loading =" lazy " webkitallowfullscreen mozallowfullscreen allowfullscreen allow =" clipboard-write " width =" 100% " height =" 600 " ></iframe >
61
-
62
- ## 4. Add State {#add-state}
84
+ <div style={{
85
+ position: 'relative',
86
+ paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
87
+ height: 0,
88
+ width: '100%'
89
+ }}>
90
+ <iframe
91
+ src="https://demo.arcade.software/MGpg8TSzMGBusCGyOk89?embed&show_copy_link=true "
92
+ title="Sharing a Project with a User"
93
+ style={{
94
+ position: 'absolute',
95
+ top: 0,
96
+ left: 0,
97
+ width: '100%',
98
+ height: '100%',
99
+ colorScheme: 'light'
100
+ }}
101
+ frameborder="0"
102
+ loading="lazy"
103
+ webkitAllowFullScreen
104
+ mozAllowFullScreen
105
+ allowFullScreen
106
+ allow="clipboard-write">
107
+ </iframe >
108
+ </div >
109
+
110
+ ## 4. Manage State {#manage-state}
63
111
64
112
Once your UI is set up, it's time to make your app interactive by adding a state. This means setting up your app to respond to user interactions. For example, when a user clicks the button to increase the quantity, the number displayed on the label should increase accordingly.
65
113
114
+ ### 4.1 Add state variable
115
+
66
116
We can achieve this behavior by adding state variables. A state variable stores data that can change over time. For this specific use case, let's add a [ page state variable] ( # ) that will hold the current quantity value. When a user interacts with the buttons, we update this variable, which in turn updates the UI.
67
117
68
118
Here's how to add and use state variables:
69
119
70
- <iframe src =" https://demo.arcade.software/UI92tJF6DX0lOVuidaSH?embed&show_copy_link=true " title =" Update product quantity " frameborder =" 0 " loading =" lazy " webkitallowfullscreen mozallowfullscreen allowfullscreen allow =" clipboard-write " width =" 100% " height =" 600 " ></iframe >
120
+ <div style={{
121
+ position: 'relative',
122
+ paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
123
+ height: 0,
124
+ width: '100%'
125
+ }}>
126
+ <iframe
127
+ src="https://demo.arcade.software/UI92tJF6DX0lOVuidaSH?embed&show_copy_link=true "
128
+ title="Sharing a Project with a User"
129
+ style={{
130
+ position: 'absolute',
131
+ top: 0,
132
+ left: 0,
133
+ width: '100%',
134
+ height: '100%',
135
+ colorScheme: 'light'
136
+ }}
137
+ frameborder="0"
138
+ loading="lazy"
139
+ webkitAllowFullScreen
140
+ mozAllowFullScreen
141
+ allowFullScreen
142
+ allow="clipboard-write">
143
+ </iframe >
144
+ </div >
145
+
146
+ ### 4.2 Update state variable
147
+
148
+ To update the state variable, we will need to add actions. Actions are essentially functions that are triggered by the user's interaction, in this case, by clicking either the "Increase" or "Decrease" buttons. You can add actions to your buttons via the [ actions panel] ( # ) .
149
+
150
+ Here's how to add actions to your buttons and update the state variable:
151
+
152
+ <div style={{
153
+ position: 'relative',
154
+ paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
155
+ height: 0,
156
+ width: '100%'
157
+ }}>
158
+ <iframe
159
+ src="https://demo.arcade.software/6UIpWtPzuhEmK3rdZ7QI?embed&show_copy_link=true "
160
+ title="Sharing a Project with a User"
161
+ style={{
162
+ position: 'absolute',
163
+ top: 0,
164
+ left: 0,
165
+ width: '100%',
166
+ height: '100%',
167
+ colorScheme: 'light'
168
+ }}
169
+ frameborder="0"
170
+ loading="lazy"
171
+ webkitAllowFullScreen
172
+ mozAllowFullScreen
173
+ allowFullScreen
174
+ allow="clipboard-write">
175
+ </iframe >
176
+ </div >
71
177
72
178
## 5. Run the App {#run-app}
73
179
74
180
Now that you've built and customized your app, it's time to run it. FlutterFlow allows you to test a fully-functional version of your app in [ Test] ( # ) and [ Run] ( # ) mode. The Run mode requires 2-4 minutes (or more, depending on the size of your project). However, to see your changes immediately, you can run your app in a Test mode that uses Flutter's "[ Hot Reload] ( # ) " feature.
75
181
76
-
77
- <iframe src =" https://demo.arcade.software/TxetiPgtHe50ZcLsHyFH?embed&show_copy_link=true " title =" Update product quantity " frameborder =" 0 " loading =" lazy " webkitallowfullscreen mozallowfullscreen allowfullscreen allow =" clipboard-write " width =" 100% " height =" 600 " ></iframe >
182
+ <div style={{
183
+ position: 'relative',
184
+ paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
185
+ height: 0,
186
+ width: '100%'
187
+ }}>
188
+ <iframe
189
+ src="https://demo.arcade.software/TxetiPgtHe50ZcLsHyFH?embed&show_copy_link=true "
190
+ title="Sharing a Project with a User"
191
+ style={{
192
+ position: 'absolute',
193
+ top: 0,
194
+ left: 0,
195
+ width: '100%',
196
+ height: '100%',
197
+ colorScheme: 'light'
198
+ }}
199
+ frameborder="0"
200
+ loading="lazy"
201
+ webkitAllowFullScreen
202
+ mozAllowFullScreen
203
+ allowFullScreen
204
+ allow="clipboard-write">
205
+ </iframe >
206
+ </div >
78
207
79
208
Congratulations! You've built your first app with FlutterFlow.
80
209
0 commit comments