This is the code shown during my Flutter Montreal presentation on May 22, 2024. https://www.youtube.com/live/6VpGWm6nIhY?si=hcqPY-aKPWLXVwzP&t=5790
- The app will build as is with the local DroneStatus Dart class.
- Delete drone_status_class.dart,
cd liband runprotoc --dart_out . drone_status.proto. - Delete the imports for
drone_status_class.dart, and importdrone_status.pb.dart. - App will run / build using the protobuf generated classes.
- Run
protoc --python_out . --pyi_out . drone_status.prototo create the python classes needed for drone_status.proto to run. - Create an AWS Lambda function, enabling the function URL under "Configuration".
- Copy the
drone_status_pb2.pyfile into the lambda function, and populatelambda_function.pywith the contents ofdrone_status.py. - Delete
_updateDroneStatus()and uncommentfetchDroneStatus() - Replace
<LAMBDA_URL>in the code with the function URL of the deployed lambda - Watch the app work as it now fetches the values from the remote Lambda URL
- Try performing the changes in the comments of
drone_status.proto, re-runningprotocand try integrating them in one, the other, and both environments (Dart / Python). See how it works!