title: Dart compare two strings return false
body: <p>Im new to dart and have a problem during building my Flutter application.</p>
  
  <p>I have a firestore database as a backend and im getting data from there.</p>
  
  <p>When i want to compare part of the data called status with the text 'CREATED', using == comparator, dart will return false.</p>
  
  <p>Can someone explain why and how to check it properly?</p>
  
  <p>rideObject is a Map</p>
  
  <p><a href="https://i.stack.imgur.com/8szbk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8szbk.png" alt="enter image description here"></a></p>
  
  <p>Update:</p>
  
  <p>Here is the function that has the condition in it:</p>
  
  <pre><code>Widget _getPage() {
   if (rideObject == null) {
        return OrderRidePage(
            address: address,
            ridesReference: reference,
            setRideReference: this._setRideReference);
      } else {
        print(rideObject['status']);
        if (rideObject['status'] == "CREATED") {
          return LoadingPage(
              removeRideReference: this._removeRideReference,
              rideReference: rideReference);
        } else {
          return RidePage(
              address: address,
              ridesReference: reference,
              setRideReference: _setRideReference);
        }
      }
    }
  </code></pre>
  
  <p>The print statement returns to output:</p>
  
  <blockquote>
    <p>I/flutter (15469): CREATED</p>
  </blockquote>
  
  <p>Here you can see the structure of the rideObject</p>
  
  <p><a href="https://i.stack.imgur.com/ZXnMl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZXnMl.png" alt="enter image description here"></a></p>
  
  <p>Funnily enough, the rideObject["status"] is String type as shown in here in console:</p>
  
  <pre><code>rideObject["status"] is String
  true
  "CREATED" is String
  true
  rideObject["status"]
  "CREATED"
  rideObject["status"] == "CREATED"
  false
  </code></pre>