I'm looking to implement a function to connect to SQL Server in a Flutter Desktop app and looking for some best practices on how to do this. The requirement is that this runs locally (mentioning this because I've seen the advice to build a web server and make an HTTP call from the Flutter app). Given the lack of Flutter/Dart libraries to connect to MS SQL Server, I would write that part of the code in another language and then integrate that into Flutter.
Different patterns I've considered:
- Write it in C++ as a flutter Plugin. Example
- Write it in Python, build it to an exe and call that exe from Flutter, call that exe with command line arguments, and pass the result back to Flutter/Dart. Using something like PyInstaller to package the Python
- Write it in Python but as part of a local Flask app. Launch that when Flutter starts up, and call the API Here is the SO post with the recommendation to launch a web server. DO this, but locally
Options 2 and 3 seem more hackish than the first. Is there some guidance around design patterns or for flutter apps generally, or does anyone have experience implementing something like this?
Aucun commentaire:
Enregistrer un commentaire