title: Error: The operator '[]' isn't defined for the class 'Object'
body: <p>I am getting this error not sure where the problem is the codes look ok but</p>
  <hr />
  <pre><code>
    ActivityFeedItem(
        {this.username,
  
        this.userId,
        this.type,
        this.mediaUrl,
        this.mediaId,
        this.userProfileImg,
        this.commentData});
  
    factory ActivityFeedItem.fromDocument(DocumentSnapshot document) {
  
      var data = document.data();
      return ActivityFeedItem(
        username: data['username'],
        userId: data['userId'],
        type: data['type'],
        mediaUrl: data['mediaUrl'],
        mediaId: data['postId'],
        userProfileImg: data['userProfileImg'],
        commentData: data[&quot;commentData&quot;],
      );
  </code></pre>
  <p>lib/comment_screen.dart:164:21: Error: The operator '[]' isn't defined for the class 'Object'.</p>
  <ul>
  <li>'Object' is from 'dart:core'.
  Try correcting the operator to an existing operator, or defining a '[]' operator.
  username: data['username'],
  ^
  lib/comment_screen.dart:165:19: Error: The operator '[]' isn't defined for the class 'Object'.</li>
  <li>'Object' is from 'dart:core'.
  Try correcting the operator to an existing operator, or defining a '[]' operator.
  userId: data['userId'],
  ^
  lib/comment_screen.dart:166:20: Error: The operator '[]' isn't defined for the class 'Object'.</li>
  <li>'Object' is from 'dart:core'.
  Try correcting the operator to an existing operator, or defining a '[]' operator.
  comment: data[&quot;comment&quot;],
  ^
  lib/comment_screen.dart:167:22: Error: The operator '[]' isn't defined for the class 'Object'.</li>
  <li>'Object' is from 'dart:core'.
  Try correcting the operator to an existing operator, or defining a '[]' operator.
  timestamp: data[&quot;timestamp&quot;],
  ^
  lib/comment_screen.dart:168:22: Error: The operator '[]' isn't defined for the class 'Object'.</li>
  <li>'Object' is from 'dart:core'.
  Try correcting the operator to an existing operator, or defining a '[]' operator.
  avatarUrl: data[&quot;avatarUrl&quot;],
  ^</li>
  </ul>
  <p>FAILURE: Build failed with an exception.</p>
  <ul>
  <li><p>Where:
  Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991</p>
  </li>
  <li><p>What went wrong:
  Execution failed for task ':app:compileFlutterBuildDebug'.</p>
  </li>
  </ul>
  <blockquote>
  <p>Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1</p>
  </blockquote>
  <ul>
  <li>Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.</li>
  </ul>