Undefined name 'SQLiteManager' in a custom function.

Custom Code

I am trying to access an SQLite database within a custom function using the following code:

final db = SQLiteManager.instance.database;

However, I receive the following error when validating the function (see attached screenshot):

Undefined name 'SQLiteManager'. Try correcting the name to one that is defined, or defining the name.

I have ensured that the correct import (/backend/sqlite/sqlite_manager.dart) is included. This code works and validates fine in a custom action, but not in a custom function.

Any ideas on why this might be happening?

What have you tried so far?
  • Checked that correct import (/backend/sqlite/sqlite_manager.dart) is included.

  • Check contents of sqlite_manager.dart the SQLiteManager is defined there.

  • Tried the same code in a custom action and it validates / works...

Did you check FlutterFlow's Documentation for this topic?
No
2
1 reply