Custom Function dependencies & package import

Resolved

Hi! Im new to FF and didnt find much to this online - I would like to implement a feature to my app where two users can only add each other as friends if they are in the same location. A user recommended for me to use geolocator pub dev.

Now I want to code a custom function for this, but , if I want to use https://pub.dev/packages/geolocator/install in a custom function, where can I add dependencies and import the package? Because custom functions doesnt have the ability to add dependencies like custom widget. Also, I can only write code within designated area, so I cannot import a package at the top of the page? I tried adding the dependencies in a random custom widget but when importing the package in the custom function outside the designated area it told me that the target URI didn't exist. Help would be very much appreciated!

2
6 replies