Search posts, tags, users, and pages
How things working out with AngularDart for you? I am in same situation as you OP but it is 2017.
Working out great!
Wrote a Kotlin->Dart converter which generates Dart models for me from my Kotlin code - so Dart can share the models created in Kotlin which means I can see at compile time if the backend and frontend models are out of sync.
Otherwise, busy with my third 100k+ LOC Angular Dart project; for large UI projects, Angular Dart is amazing.
Amazing..thanks for the reply. I am newbie to dart & kotlin (love both coming from Java) but never knew you can use dart with kotlin. I am thinking of using kotlin on backend to create RESTful api for angulardart 4 front end. Flutter looks good for mobile apps. I got deployment ready "Tip calculator" app in first hour of studying flutter for IOS & android (no prior knowledge of flutter or dart)
Can you tell me which UI library you're using for angular dart projects? I don't see many libraries apart from official angular_components 0.6. My biggest worry is adoption of dart on front end as I hate typescript & JS even more after doing a little prototype in angular dart. If possible please share your experience on kotlin to dart conversion project in another blog...interesting for sure
Currently using Foundation as a base, then everything else is custom-built. Haven't had time to go deep into the material design components that you get with Dart, Foundation seems good enough for now, it's very minimalistic and doesn't get in your way when you want to build custom things.
For my Kotlin REST API, I use VertX with my own library of extension methods on top of it to make it easier to use
The dart generator is currently semi-proprietary, but I can explain how it is done so you can easily build your own one. It's mostly using reflection to traverse through a Kotlin class and then simply spit out strings in a .dart file. If the Kotlin model is updated, the Dart model gets updated as well when you compile the Kotlin code.
generateDartClass(CompanyCreate::class)
fun generateDartClass(clazz: KClass<*>): List<String> {
clazz.declaredMemberProperties.forEach { property ->
when (property.returnType.toString()) {
"kotlin.String" -> {
// generate Dart String declaration here
}
"kotlin.Int" -> {
// generate Dart Int declaration here
}
...
}
}
}
Now when you serialize to and from JSON, both sides have proper models you can work against which should give you some nice autocomplete assistance.