<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import 'dart:async';

import 'package:flutter/widgets.dart';

final GlobalKey _kKey = new GlobalKey();
Future main() async {
  runApp(new Block(
      children: new List&lt;Widget&gt;.generate(
          2,
          (_) =&gt; new Padding(
              padding: const EdgeInsets.all(8.0),
              child: new Container(
                  key: _kKey,
                  width: 100.0,
                  height: 100.0,
                  decoration: new BoxDecoration(
                      backgroundColor: new Color(0xFFFFFF00)))))));
}
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s">'dart:async'</span>;

<span class="pl-k">import</span> <span class="pl-s">'package:flutter/widgets.dart'</span>;

<span class="pl-k">final</span> <span class="pl-c1">GlobalKey</span> _kKey <span class="pl-k">=</span> <span class="pl-k">new</span> <span class="pl-c1">GlobalKey</span>();
<span class="pl-c1">Future</span> <span class="pl-en">main</span>() <span class="pl-k">async</span> {
  <span class="pl-en">runApp</span>(<span class="pl-k">new</span> <span class="pl-c1">Block</span>(
      children<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">List</span>&lt;<span class="pl-c1">Widget</span>&gt;.<span class="pl-en">generate</span>(
          <span class="pl-c1">2</span>,
          (_) <span class="pl-k">=&gt;</span> <span class="pl-k">new</span> <span class="pl-c1">Padding</span>(
              padding<span class="pl-k">:</span> <span class="pl-k">const</span> <span class="pl-c1">EdgeInsets</span>.<span class="pl-en">all</span>(<span class="pl-c1">8.0</span>),
              child<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Container</span>(
                  key<span class="pl-k">:</span> _kKey,
                  width<span class="pl-k">:</span> <span class="pl-c1">100.0</span>,
                  height<span class="pl-k">:</span> <span class="pl-c1">100.0</span>,
                  decoration<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">BoxDecoration</span>(
                      backgroundColor<span class="pl-k">:</span> <span class="pl-k">new</span> <span class="pl-c1">Color</span>(<span class="pl-c1">0xFFFFFF00</span>)))))));
}
</pre></div>
<p dir="auto">If you're creating an app that has native and flutter components there is no way to share images or fonts between flutter and android/ios. This means that assets needed on both sides will have to be included in the binary twice and that could be expensive.</p>