Skip to content

Commit ff2c00b

Browse files
committed
add disclaimer about custom functions
1 parent 7e1c0ab commit ff2c00b

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

docs/ff-concepts/adding-customization/common-examples.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,33 @@ keywords: [FlutterFlow, Custom Actions, Customizations, Flutter, Dart, Pub.dev,
1111

1212
The custom code feature in FlutterFlow allows you to extend functionality by accessing generated classes and modifying global variables like App States and FlutterFlow themes. This guide covers common scenarios where you can leverage custom code to enhance your project by working directly with data models and other resources within your code.
1313

14+
:::warning[Disclaimer]
15+
Custom Functions cannot import new files or packages outside of the default dedicated imports. Therefore, most of the suggestions below that involve adding a new import will not work in Custom Functions due to this restriction. However, they will work for Custom Widgets and Custom Actions.
16+
17+
For example, a new [**Custom Function**](custom-functions.md) typically includes the following packages and files. Your custom function code changes should use only these packages & files:
18+
19+
```js
20+
import 'dart:convert';
21+
import 'dart:math' as math;
22+
23+
import 'package:flutter/material.dart';
24+
import 'package:google_fonts/google_fonts.dart';
25+
import 'package:intl/intl.dart';
26+
import 'package:timeago/timeago.dart' as timeago;
27+
import 'lat_lng.dart';
28+
import 'place.dart';
29+
import 'uploaded_file.dart';
30+
import '/backend/backend.dart';
31+
import 'package:cloud_firestore/cloud_firestore.dart';
32+
import '/backend/schema/structs/index.dart';
33+
import '/backend/schema/enums/enums.dart';
34+
import '/auth/firebase_auth/auth_util.dart';
35+
```
36+
37+
:::
1438
### Accessing FlutterFlow Generated Classes
1539

16-
Most custom FlutterFlow classes are prefixed with `FF<ClassName>` or `FlutterFlow<ClassName>`. If you need to access these classes in your custom code, simply type "FF" or "FlutterFlow" in the code editor to locate them easily.
40+
Most custom FlutterFlow classes in the generated code are prefixed with `FF<ClassName>` or `FlutterFlow<ClassName>`. If you need to access these classes in your custom code, simply type "FF" or "FlutterFlow" in the code editor to locate them easily.
1741

1842
![suggestions-dropdown.png](imgs/suggestions-dropdown.png)
1943

0 commit comments

Comments
 (0)