<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="flutter doctor -v
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en-IN)
    • Flutter version 0.8.2 at /Library/flutter
    • Framework revision 5ab9e70727 (3 weeks ago), 2018-09-07 12:33:05 -0700
    • Engine revision 58a1894a1c
    • Dart version 2.1.0-dev.3.1.flutter-760a9690c2

[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/prashant/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/prashant/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    ✗ Android license status unknown.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.0, Build version 10A255
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 28.0.2
    • Dart plugin version 181.5616
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] IntelliJ IDEA Ultimate Edition (version 2018.2.4)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 28.0.4
    • Dart plugin version 182.4323.44

[!] Connected devices
    ! No devices available"><pre class="notranslate"><code class="notranslate">flutter doctor -v
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G65, locale en-IN)
    • Flutter version 0.8.2 at /Library/flutter
    • Framework revision 5ab9e70727 (3 weeks ago), 2018-09-07 12:33:05 -0700
    • Engine revision 58a1894a1c
    • Dart version 2.1.0-dev.3.1.flutter-760a9690c2

[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/prashant/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/prashant/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    ✗ Android license status unknown.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.0, Build version 10A255
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 28.0.2
    • Dart plugin version 181.5616
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] IntelliJ IDEA Ultimate Edition (version 2018.2.4)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 28.0.4
    • Dart plugin version 182.4323.44

[!] Connected devices
    ! No devices available
</code></pre></div>
<h2 dir="auto">! Doctor found issues in 2 categories.</h2>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
export SDKMANAGER_OPTS='--add-modules java.se.ee' "><pre class="notranslate"><code class="notranslate">export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
export SDKMANAGER_OPTS='--add-modules java.se.ee' 
</code></pre></div>
<hr>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
export PATH=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin:$PATH"><pre class="notranslate"><code class="notranslate">export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
export PATH=/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/bin:$PATH
</code></pre></div>
<hr>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="./sdkmanager --update 
Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.se.ee not found"><pre class="notranslate"><code class="notranslate">./sdkmanager --update 
Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.se.ee not found
</code></pre></div>
<hr>
<p dir="auto">How to fix it..</p>
<p dir="auto">This is not meant to be a "JSX or not" question, but more a question of if there is any way to reduce boilerplate in flutter with pure dart. <em>Note: I am naiive to most of Dart's language features</em></p>
<p dir="auto">The goal of this issue is not for me to just propose my own form of shorthand, but simply to ask how something like this could work today, and to throw an idea into the wind and see if it goes anywhere.</p>
<p dir="auto">Is it possible for us to roll our own modifiers? (like async, await)</p>
<p dir="auto">StatelessWidget today</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class MyText extends StatelessWidget {
  final String title;

  MyText(this.title);

  @override
  Widget build(BuildContext context) {
    return Text('title');
  }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-c1">MyText</span> <span class="pl-k">extends</span> <span class="pl-c1">StatelessWidget</span> {
  <span class="pl-k">final</span> <span class="pl-c1">String</span> title;

  <span class="pl-c1">MyText</span>(<span class="pl-c1">this</span>.title);

  <span class="pl-k">@override</span>
  <span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {
    <span class="pl-k">return</span> <span class="pl-c1">Text</span>(<span class="pl-s">'title'</span>);
  }
}</pre></div>
<p dir="auto">tomorrow?</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="MyText (String title) widget {
  build =&gt; Text('title');
}"><pre class="notranslate"><span class="pl-c1">MyText</span> (<span class="pl-c1">String</span> title) widget {
  build <span class="pl-k">=&gt;</span> <span class="pl-c1">Text</span>(<span class="pl-s">'title'</span>);
}</pre></div>
<p dir="auto">StatefulWidget today</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class MyOtherText extends StatefulWidget {
  String title;

  MyOtherText(this.title);

  @override
  _MyOtherTextState createState() =&gt; _MyOtherTextState();
}

class _MyOtherTextState extends State&lt;MyOtherText&gt; {
  bool isShown;

  _handlePressed(){
    setState(() {
      isShown = !isShown;
    });
  }

  @override
  void initState() {
    super.initState();
    isShown = false;
  }

  @override
  Widget build(BuildContext context) {

    return isShown ? 
      RaisedButton(
        child: Text(&quot;Click me&quot;),
        onPressed: ()=&gt;_handlePressed
      )
    : Container();
  }

  @override
  void dispose() {
    isShown = null;
    super.dispose();
  }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-c1">MyOtherText</span> <span class="pl-k">extends</span> <span class="pl-c1">StatefulWidget</span> {
  <span class="pl-c1">String</span> title;

  <span class="pl-c1">MyOtherText</span>(<span class="pl-c1">this</span>.title);

  <span class="pl-k">@override</span>
  <span class="pl-c1">_MyOtherTextState</span> <span class="pl-en">createState</span>() <span class="pl-k">=&gt;</span> <span class="pl-c1">_MyOtherTextState</span>();
}

<span class="pl-k">class</span> <span class="pl-c1">_MyOtherTextState</span> <span class="pl-k">extends</span> <span class="pl-c1">State</span>&lt;<span class="pl-c1">MyOtherText</span>&gt; {
  <span class="pl-c1">bool</span> isShown;

  <span class="pl-en">_handlePressed</span>(){
    <span class="pl-en">setState</span>(() {
      isShown <span class="pl-k">=</span> <span class="pl-k">!</span>isShown;
    });
  }

  <span class="pl-k">@override</span>
  <span class="pl-k">void</span> <span class="pl-en">initState</span>() {
    <span class="pl-c1">super</span>.<span class="pl-en">initState</span>();
    isShown <span class="pl-k">=</span> <span class="pl-c1">false</span>;
  }

  <span class="pl-k">@override</span>
  <span class="pl-c1">Widget</span> <span class="pl-en">build</span>(<span class="pl-c1">BuildContext</span> context) {

    <span class="pl-k">return</span> isShown <span class="pl-k">?</span> 
      <span class="pl-c1">RaisedButton</span>(
        child<span class="pl-k">:</span> <span class="pl-c1">Text</span>(<span class="pl-s">"Click me"</span>),
        onPressed<span class="pl-k">:</span> ()<span class="pl-k">=&gt;</span>_handlePressed
      )
    <span class="pl-k">:</span> <span class="pl-c1">Container</span>();
  }

  <span class="pl-k">@override</span>
  <span class="pl-k">void</span> <span class="pl-en">dispose</span>() {
    isShown <span class="pl-k">=</span> <span class="pl-c1">null</span>;
    <span class="pl-c1">super</span>.<span class="pl-en">dispose</span>();
  }
}</pre></div>
<p dir="auto">tomorrow?</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="MyOtherText (String title) widget* {
  bool isShown;

  initState =&gt; isShown = false;

  build =&gt; isShown ? 
    RaisedButton(
      child: Text('Click me'),
      onPressed: ()=&gt; setState=&gt; isShown = !isShown
    )
  : Container();

  dispose =&gt; isShown = null;
}"><pre class="notranslate"><span class="pl-c1">MyOtherText</span> (<span class="pl-c1">String</span> title) widget<span class="pl-k">*</span> {
  <span class="pl-c1">bool</span> isShown;

  initState <span class="pl-k">=&gt;</span> isShown <span class="pl-k">=</span> <span class="pl-c1">false</span>;

  build <span class="pl-k">=&gt;</span> isShown <span class="pl-k">?</span> 
    <span class="pl-c1">RaisedButton</span>(
      child<span class="pl-k">:</span> <span class="pl-c1">Text</span>(<span class="pl-s">'Click me'</span>),
      onPressed<span class="pl-k">:</span> ()<span class="pl-k">=&gt;</span> setState<span class="pl-k">=&gt;</span> isShown <span class="pl-k">=</span> <span class="pl-k">!</span>isShown
    )
  <span class="pl-k">:</span> <span class="pl-c1">Container</span>();

  dispose <span class="pl-k">=&gt;</span> isShown <span class="pl-k">=</span> <span class="pl-c1">null</span>;
}</pre></div>