Currently, I am developing a flutter web app using Provider and Firebase. I would like to develop others apps (for example and admin console) with the same database and data providers.
My app currently have the following folders
my_app
- models
- providers
- services (firebase/firestore crud)
- pages
- utils
- widgets
I would like to have models, providers, and services as a local package or library. Something like:
my_lib
- models
- providers
- services
my_app
- pages
- utils
- widgets
my_other_app
- pages
- utils
- widgets
First, I don't know how to create a local lib, and how to make it a dependency of my_apps.
Second, since I will be using Firebase and Firestorage on my_lib, I don't know how the instances initialized in main are used by the package. Is it enough to initiate the global variables on the my_lib?