material-components / material-components-flutter-codelabs

Codelabs for Material Components for Flutter
212 stars 244 forks source link

MDC-104 backdrop.dat - Cannot assign Animation<double> to Listenable #256

Closed d029940 closed 3 years ago

d029940 commented 3 years ago

In class _BackdropTitle, in the constructor, the type Listenable for the parameter listenable won't work, because it is initialized with _listenable, which is of type Animation. That's simply not possible.

On https://codelabs.developers.google.com/codelabs/mdc-104-flutter?continue=https%3A%2F%2Fdevelopers.google.com%2Flearn%2Fpathways%2Fmdc-flutter%3Fhl%3Den%23codelab-%2Fcodelabs%2Fmdc-104-flutter&hl=en#7

code snippet should be updated.

` const _BackdropTitle({ Key? key, required Listenable listenable, <-------------- required this.onPress, required this.frontTitle, required this.backTitle, }) : _listenable = listenable, super(key: key, listenable: listenable);

final Animation _listenable;`

guidezpl commented 3 years ago

Thanks for filing, this will be fixed shortly