Skip to content

Commit c550c1a

Browse files
committed
Add syntax highlighting of JS because Dart doesnt work.
1 parent 7ef3b9e commit c550c1a

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

docs/ff-concepts/adding-customization/custom-actions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ app's `HomePage`.
7272
In our previous example, we enabled the **Return Value** of the Custom Action to return a
7373
`List<Product>` when the search keyword is valid. With this change the code will change from
7474

75-
```
75+
```js
7676
Future executeSearch(String searchItem) async {
7777
// Add your function code here!
7878
}
7979
```
8080

8181
to
8282

83-
```
83+
```js
8484
Future<List<ProductStruct>> executeSearch(String searchItem) async {
8585
// Add your function code here!
8686
}

docs/ff-concepts/adding-customization/custom-files.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ To do so, you can edit *main.dart* file by following the steps below:
4040
dart` file. For this
4141
example, here's code in a custom action named 'setStatusbarColor'.
4242

43-
```dart
43+
```js
4444
// Automatic FlutterFlow imports
4545
import '/backend/backend.dart';
4646
import '/flutter_flow/flutter_flow_theme.dart';
@@ -88,7 +88,7 @@ You might want to lock the device orientation in portrait or landscape mode to p
8888
To set the device orientation in landscape-only mode, [create a custom action](custom-actions.md) with the
8989
following code and [add it to a `main.dart`](#edit-maindart) file.
9090

91-
```dart
91+
```js
9292
// Automatic FlutterFlow imports
9393
import '/backend/backend.dart';
9494
import '/flutter_flow/flutter_flow_theme.dart';
@@ -123,7 +123,7 @@ If you want to ensure that your app appropriately manages its lifecycle and hand
123123
To do so, [create a custom action](custom-actions.md) with the following code and [add it to a `main.dart`](#edit-maindart) file.
124124

125125

126-
```dart
126+
```js
127127
// Automatic FlutterFlow imports
128128
import '/backend/backend.dart';
129129
import '/flutter_flow/flutter_flow_theme.dart';
@@ -136,21 +136,22 @@ import 'package:flutter/material.dart';
136136

137137
Future onAppBackground() async {
138138
// Add your function code here!
139-
WidgetsBinding.instance.addObserver(AppLifecycleObserver());
139+
WidgetsBinding.instance.addObserver(AppLifecycleObserver());
140140
}
141141

142142
class AppLifecycleObserver with WidgetsBindingObserver {
143143
@override
144-
void didChangeAppLifecycleState(AppLifecycleState state) {
145-
if (state == AppLifecycleState.resumed) {
144+
void didChangeAppLifecycleState(AppLifecycleState state) {
145+
if (state == AppLifecycleState.resumed) {
146146
// Do something when app is resumed
147-
print('App is in foreground');
148-
} else if (state == AppLifecycleState.paused) {
147+
print('App is in foreground');
148+
} else if (state == AppLifecycleState.paused) {
149149
// Do something when app is paused
150-
print('App is in background');
151-
}
152-
}
150+
print('App is in background');
151+
}
152+
}
153153
}
154+
154155
```
155156
<figure>
156157
![img_5.png](imgs/img_5.png)

0 commit comments

Comments
 (0)