title: JSON ObjectMapper in Flutter
body: <p>I'd like to have <strong>objects</strong> serialized/deserialized from <strong>JSON</strong> in Flutter. I know I can use <code>JsonDecoder</code> from <code>json.dart</code> which gives me string-key based LinkedHashMap but I'm more interested in <strong>ObjectMapper</strong> approach so that I'm able to get <strong>typed</strong> response from deserialization.</p>
  
  <p>I tried <em>redstone mapper</em> (<a href="https://pub.dartlang.org/packages/redstone_mapper" rel="nofollow noreferrer">link</a>) and <em>exportable library</em> (<a href="https://github.com/Leksat/dart-exportable" rel="nofollow noreferrer">link</a>) with Flutter - both of which I'm not able to compile properly. I believe the problem is connected with the reflection library from Dart.</p>
  
  <p>How can I achieve a working Object-Json Mapper using Flutter?</p>
  
  <p>Sample code:</p>
  
  <pre><code>class A {
  
    @Field()
    String b;
  }
  
  import 'package:redstone_mapper/mapper.dart';
  import 'package:redstone_mapper/mapper_factory.dart';
  
  bootstrapMapper();
  var desObj = decodeJson(jsonString, A);
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Starting device daemon...
  Running lib/main.dart on Nexus 5X...
  Dart snapshot generator failed with exit code 254
  Errors encountered while loading: 'dart:mirrors': error: line 1 pos 1: unexpected token 'Unhandled'
  </code></pre>
  
  <p>or this one:</p>
  
  <pre><code>Error detected in application source code:
  error: Failed to load main script:
  'package:redstone_mapper/mapper_factory.dart': error: line 4 pos 1: import of dart:mirrors with --enable-mirrors=false
  import 'dart:mirrors';
  </code></pre>