title: In Flutter, How can I detect the change if the headset is suddenly plugged
body: <p>I'm trying to find the method about detecting headset in Flutter.
  I want to hide AlertDialog when the headset is connected.
  I know that I can detect connection by using 'Initstate()'.
  But, I think It's not appropriate using Initstate.
  Because If user see the Alertdialog, they can plug their headset anytime and then allowed to close the Alertdialog.
  I use GetX. Is there any method for this situation?</p>