Using SplayTreeMap to order keys

Custom Code
Resolved

I wrote a code in dart (with vscode) that order a map using SplayTreeMap from 'dart:collection'.

But when inside flutterflow in a Custom Code function show error "The name 'SplayTreeMap' isn't a class."

I tried to import (in custom code function) with no sucess. Receiving the error above.

Has anyone been able to use SplayTreeMap successfully? Or can visualize the solution to this problem.

Here the code part that flutterflow show error:

final sortedMapCrescente = SplayTreeMap<DateTime,String>.from(varMapDateAndString);

What have you tried so far?

I tried to import (in custom code function) with:

import 'dart:collection'; //from dart

import 'package:collection/collection.dart'; //from flutter

No one worked for me. I also followed the steps in the manual in Custom Functions | FlutterFlow Docs . But also not worked.

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