angulardart/angular_components

Material Stepper - Exception when some method(AsyncAction) and cancellIf(Future<bool>) are called

supermuka opened this issue · 1 comments

Before upgrade Dart SDK and Angular packages, the material-stepper was working nice. But now, it is not clear because this exception is being raised:

EXCEPTION: Type 'List<dynamic>' should be 'List<bool>' to implement expected type 'FutureOr<List<bool>>'.
STACKTRACE: 
dart:sdk_internal                                                                wait
package:angular_components/src/model/action/async_action_controller.dart 117:20  <fn>
package:stack_trace  

Line 117 on async_action_controller.dart where the exception is thrown:

https://github.com/dart-lang/angular_components/blob/c644746d2824df7cfaf0a34f900b1f8557caddbc/angular_components/lib/src/model/action/async_action_controller.dart#L117

Environment:

Windows 10 x64
Dart 2.2.1-dev.3.1
Angular 0.5.3
Angular Components 0.12.0

Code (view):

<material-stepper legalJumps="backwards"
                 orientation="vertical"
                 size="default">
   <template step name="Login"
             (continue)="authenticateAuthorizate($event)" // METHOD CALLED
              #stepA="step">                  
// HIDE CODE HERE, TO OPTIMIZE THIS EXAMPLE
   </template>
   <template [summary]="stepA">
// HIDE CODE HERE, TO OPTIMIZE THIS EXAMPLE
   </template>
</material-stepper>

Code (controller):

  void authenticateAuthorizate(AsyncAction<bool> action) async {

    action.cancelIf(Future<bool>.delayed(const Duration(seconds: 1), () {
      // Don't cancel
      return false;
    }));

This code is based in this: Angular Componentes Examples

Is a bug/incompatible version or am I doing something wrong?

I update to SDK Dart 2.2.1-dev.4.0 and it works now.