I'm starting to work with Appwrite and would like to better understand the execution context of Functions;
Could I make a shared folder between functions and place them in a single repository?
For example, in the following structure:
└── functions ├── make_dove_appear │ └── main.dart ├── make_rabbit_appear │ └── main.dart └── shared └── my_magic_hat.dart
The main.dart file from my make_rabbit_appear folder/function, could you import my_magic_hat.dart from a subfolder of the directory?
import '../shared/my_magic_hat.dart';
void main() {
// Loaded from the shared sub-folder?
final magicHat = MyMagicHat();
magicHat.makeAnimalAppear(
AnimalAvailable.rabbit,
);
}
See that I will register two different functions. They will be called from different places and will have different functions.
But they used some common resource.
If you deploy function and specify make_dove_appear as the folder, only that folder is added into the container for building
That said, you can share code by using symlinks to make it as if the common folder was in the folder being deployed
And then put an entry in your pub spec that points to that path
So something like:
- functions
- dependencies
- common <--- symlink
- lib
- main.dart
- pubspec.yaml
- dependencies
And pubspec has
dependencies:
common:
path: dependencies/common
It's pretty clear now! Thank you for your time and tip!
Recommended threads
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...
- Function domain not available
Hello, even tho in docs you clearly describe that every function has its domain, I can not see it anywhere in any of my projects. How do I reveal the url of th...