Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

how to use with flutter? #38

Closed
droundy opened this issue Nov 3, 2016 · 2 comments
Closed

how to use with flutter? #38

droundy opened this issue Nov 3, 2016 · 2 comments

Comments

@droundy
Copy link

droundy commented Nov 3, 2016

I'm new to dart and new to flutter, but I know that flutter doesn't work with mirrors, and that dartson doesn't require mirrors. However, I don't know how to use dartson with flutter. I get the following errors:

$ flutter build apk
Building APK in release mode (android-arm-release)...      
Dart snapshot generator failed with exit code 254
Errors encountered while loading: 'dart:mirrors': error: line 1 pos 1: unexpected token 'Unhandled'
Unhandled exception:
^
'package:dartson/dartson.dart': error: line 10 pos 1: library handler failed
import 'dart:mirrors';
^
'file:///home/droundy/src/student-pairs/lib/main.dart': error: line 5 pos 1: library handler failed
import 'package:dartson/dartson.dart';
^
Error: 'dart:mirrors': error: line 1 pos 1: unexpected token 'Unhandled'
Unhandled exception:
^
'package:dartson/dartson.dart': error: line 10 pos 1: library handler failed
import 'dart:mirrors';
^
'file:///home/droundy/src/student-pairs/lib/main.dart': error: line 5 pos 1: library handler failed
import 'package:dartson/dartson.dart';
^
Failed to build AOT snapshot

I expect that this is simple to manage, but am not sure how to tell flutter that I want the non-mirrors version of dartson.

Thanks!

@eredo
Copy link
Owner

eredo commented May 23, 2017

There's currently no option to use dartson with flutter, because dartson relies on pub transformers in order to provide a static (no mirrors) way. Take a look at built_value and it's serialization implementation.

@eredo
Copy link
Owner

eredo commented Feb 27, 2018

Will be taken in account for #48 . Just out of interest what was your solution / package for your project?

@eredo eredo closed this as completed Feb 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants