Simple Close Button Handling for Flutter Snackbar

Adding a close button to a snackbar in Flutter is simple, however there is one subtlety to be aware of. If the view closes before the snackbar does then you can no longer get the ScaffoldMessenger from context in the close handler. Instead you need to pass the ScaffoldMessenger into the closure so that it remains available after the view closes. Wrong Way This approach will work most of the time, unless the view has already been disposed when the close button is clicked. Since snackbars are often used for errors or other termination handlers it is fairly common for [Read on…]

Success With AWS Web Socket Endpoint Configuration

I had a lot of trouble getting the API Gateway socket management calls to work using the AWS SDK V2 version of the Golang SDK. The problem was that I was not invoking the right endpoint. So that I remember in the future how to do this and to help anyone having similar problems here’s the magic formula I finally learned. Endpoint Value First you need to know the endpoint to use to make calls against. You can either look it up in the AWS console or get it dynamically from the request. I chose to get it from the [Read on…]