title: Flutter error: Error: Can't access 'this' in a field initializer to read 'computeMaxScale'
body: <p>After running <code>flutter upgrade</code> I'm facing some problems with flutter</p>
  
  <p>I have this class that stores <code>minScale</code> and <code>maxScale</code>.</p>
  
  <p>In the constructor, I want to assert the interval between them. As those values can be a double or an instance of an enum, I have to compute them before the comparison.</p>
  
  <p>Code of the constructor and asserts:</p>
  
  <pre><code>class ScaleBoundaries {
    final dynamic _minScale;
    final dynamic _maxScale;
    Size size;
    ImageInfo imageInfo;
  
    ScaleBoundaries(this._minScale, this._maxScale, { @required this.size, @required this.imageInfo}) :
          assert(_minScale is double || _minScale is PhotoViewScaleBoundary),
          assert(_maxScale is double || _maxScale is PhotoViewScaleBoundary),
          assert(computeMinScale() &lt;= computeMaxScale());
  </code></pre>
  
  <p>This gives me the following error:</p>
  
  <pre><code>compiler message: file:///.../photo_view/lib/photo_view_scale_boundaries.dart:14:37: Error: Can't access 'this' in a field initializer to read 'computeMaxScale'.
  compiler message:         assert(computeMinScale() &lt;= computeMaxScale());
  compiler message:                                     ^^^^^^^^^^^^^^^
  compiler message: file:///.../photo_view/lib/photo_view_scale_boundaries.dart:14:16: Error: Can't access 'this' in a field initializer to read 'computeMinScale'.
  compiler message:         assert(computeMinScale() &lt;= computeMaxScale());
  compiler message:                ^^^^^^^^^^^^^^^
  </code></pre>
  
  <p>That is my flutter doctor output:</p>
  
  <pre><code>Doctor summary (to see all details, run flutter doctor -v):
  [✓] Flutter (Channel master, v0.7.1-pre.15, on Linux, locale en_US.UTF-8)
  [!] Android toolchain - develop for Android devices (Android SDK 28.0.1)
      ✗ Android license status unknown.
  [✓] Android Studio (version 3.1)
  [✓] IntelliJ IDEA Community Edition (version 2018.1)
  [!] VS Code (version 1.25.1)
  [✓] Connected devices (1 available)
  
  ! Doctor found issues in 2 categories.
  </code></pre>
  
  <p>The only solution that I found out is removing the assert, but that is not okay. How can I address that?</p>
  
  <p>For more information, see the whole file and project: <a href="https://github.com/renancaraujo/photo_view/blob/ed0903a62b8de2edc5d4720fcb19b0a4a77cf659/lib/photo_view_scale_boundaries.dart" rel="nofollow noreferrer">photo_view_scale_boundaries.dart</a></p>