Dependency injection resolution of async factory

Having some issues with injecting a database connection into a class via the di.dart package. Specifically, resolving an async dependency in the toFactory option. Both attempts result in the NoSuchMethodError: Class '_Future' has no instance method...
more »

2017-01-13 01:01 (1) Answers

Navigate to a different route

is it possible to route like after an ajax call to another page? So I know it is possible inside html with Angular2 TS but does it work with Dart and how? @RouteConfig(const [ const Route(path: '/search', name: 'Search', component: SearchComponen...
more »

2017-01-12 09:01 (1) Answers

Is Dart integrated with SASS?

After finally becoming more intimate with AngularDart (2.0), I decided to throw SASS into the relationship. It appears the SASS devs are also coming over to Dart SASS to Dart (two months ago). Knowing that, the @Component( styleUrls: 'style.sass') ...
more »

2017-01-12 01:01 (1) Answers

Preloading local image assets in Flutter

I have a simple list of image assets, and I have one Image widget onscreen. I use a button to cycle through them, using setState(). const List<String> _photoData = const [ "assets/generic-cover.jpg", "assets/generic-cover2.jpg", "assets/...
more »

2017-01-05 01:01 (2) Answers

Dartweb Webstorm, 502 Bad Gateway

While running the Get Started guide for Dart and using WebStorm as per the docs, Dartium window shows "502 Bad Gateway" when trying to run index.html for the first time. When inspecting the IDE, the Pub Serve console shows an error while trying to r...
more »

2017-01-04 17:01 (1) Answers

regex nonconsecutive match

I'm trying to match a word that has 2 vowels in it (doesn't have to be consecutively) but the regex I've come up either matches nothing or not enough. This is the last iteration (dart). final vowelRegex = new RegExp(r'[aeiouy]{2}'); Here's an ex...
more »

2017-01-04 07:01 (4) Answers

Await inside for loop is admitted in Dart?

I have a program like the following: main() async { ooClass = new OoClass(1); int val = await function1(); print(val); ooClass = new OoClass(2); val = await function1(); print(val); ooClass = new OoClass(3); val = await function1(); ...
more »

2016-12-29 09:12 (1) Answers

How do I do custom validation in Polymer Dart

Similar to javascript and the implementation of IronValidatorBehavior how do I do custom validation in Polymer Dart? I can create a new custom-validator which implements IronValidatorBehavior e.g. <dom-module id="form-input"> <templa...
more »

2016-12-29 06:12 (1) Answers

Slice a Map in Dartlang

I need to slice a Map. I've got it to work like this: Map sliceMap(Map map, offset, limit) { Map result = new Map(); if (map.length < limit) { limit = map.length; } map.keys.toList().getRange(offset, limit).forEach((key) { result...
more »

2016-12-29 00:12 (2) Answers

Will google dart be part of chrome?

I followed the google dart news for a while now and noticed that google has decided months ago not to include it in chrome. The future seems uncertain now. My question for those insiders is: Will google dart eventually come to our browsers or is thi...
more »

2016-12-27 17:12 (0) Answers

How do I test if a file is writable (CLI)

I am taking my first steps in Dart today, and the first thing I am not sure about how to proceed is how to test whether a file that is passed as an argument to a CLI tool I'm writing is writable. So the idea is that I have a tool that accepts an inp...
more »

2016-12-23 20:12 (1) Answers

How to sort a MappedListIterable in Dart

I've got a MappedListIterable than I know to sort When calling the sort method , I 'm getting EXCEPTION: NoSuchMethodError: Class 'MappedListIterable' has no instance method 'sort'. Receiver: Instance of 'MappedListIterable' Tried calling:...
more »

2016-12-23 16:12 (1) Answers