title: ValueEventListener on firebase database in flutter app
body: <p>I am learning android app development in flutter.
  I have started from flutter chat app example. In the <a href="https://codelabs.developers.google.com/codelabs/flutter-firebase/#8" rel="noreferrer">Enable data syncing</a> section , It is explained to use Firebase Database like below.</p>
  
  <p><code>final DBreference = FirebaseDatabase.instance.reference().child('messages');</code></p>
  
  <p>Also the <code>push()</code> and <code>set()</code> methods are working fine.</p>
  
  <p>When i try to listen to events on child  using <code>ValueEventListener</code>.
  The <code>DBreference</code> created above has no methods like <code>addListenerForSingleValueEvent</code> or <code>addValueEventListener</code>. </p>
  
  <p>My main goal is to retrieve value of child as expalined in SO answers 
  <a href="https://stackoverflow.com/questions/38017765/retrieving-child-value-firebase">Retrieving child value -firebase-</a>
   or <a href="https://stackoverflow.com/questions/47893328/checking-if-a-particular-value-exists-in-the-firebase-database?rq=1">Checking if a particular value exists in the firebase database</a></p>
  
  <p>I m getting  <code>undefined class ValueEventListener</code><br>
  if i create a new <code>ValueEventListener</code>, i tried by importing </p>
  
  <p><code>import 'com.google.firebase.database.ValueEventListener';</code></p>
  
  <p>I m unable to import this path as well.
  Same error for <code>addListenerForSingleValueEvent</code> or <code>addValueEventListener</code>.</p>
  
  <p>I am using android studio 3.1</p>