title: What does the error "Can't access this in a field initializer mean"?
body: <p>I want to create a class in flutter for displaying an Alert Box, which can take in title and Content as input to show error box. 
  But debug console says that "can't access this in a field initializer" when I used this to access a variable of the same class in AlertDialog(). </p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  void main() =&gt; runApp(MaterialApp(home: Alert("Say Hy","Hy"),));
  
  class Alert extends StatelessWidget{
  
    final String titlea;
    final String contexta;
  
    Alert(this.titlea,this.contexta);
  
    AlertDialog dialog = AlertDialog(
      title: Text(this.titlea),
      content: Text(this.contexta),
    );
  
  
  
      Widget build(BuildContext context){
          return Scaffold(
            floatingActionButton: FloatingActionButton(
              onPressed: (){
                showDialog(context: context ,builder: (BuildContext context) =&gt; dialog);
              },
            ),
          );
        }
    }
  </code></pre>
  
  <p>Error: Can't access 'this' in a field initializer.
      title: Text(this.titlea),
                  ^^^^
  Error: Can't access 'this' in a field initializer.
      content: Text(this.contexta),
                    ^^^^</p>