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

Missing constructors #22

Open
portno opened this issue Mar 22, 2018 · 2 comments
Open

Missing constructors #22

portno opened this issue Mar 22, 2018 · 2 comments

Comments

@portno
Copy link

portno commented Mar 22, 2018

I am facing a problem using the github repository instead of the pub package (v0.3.2). I believe that the same problem exists for version 0.4.0+1.

It looks like the external factory constructors are not getting generated or just missing.

Example is ChartXAxe class which was:

@anonymous
@JS()
abstract class ChartXAxe implements CommonAxe {
  external num get categoryPercentage;
  external set categoryPercentage(num v);
  external num get barPercentage;
  external set barPercentage(num v);
  external TimeScale get time;
  external set time(TimeScale v);
  external factory ChartXAxe(
      {num categoryPercentage,
      num barPercentage,
      TimeScale time,
      String /*'category'|'linear'|'logarithmic'|'time'|'radialLinear'|String*/ type,
      bool display,
      String id,
      bool stacked,
      String position,
      TickOptions ticks,
      GridLineOptions gridLines,
      num barThickness,
      ScaleTitleOptions scaleLabel});
}

and changed in dd29e3a (link to line) to:

@anonymous
@JS()
abstract class ChartXAxe implements CommonAxe {
  external num get categoryPercentage;
  external set categoryPercentage(num v);
  external num get barPercentage;
  external set barPercentage(num v);
  external TimeScale get time;
  external set time(TimeScale v);
}

The same applies for other classes as well, for example LinearTickOptions, ChartYAxe, ChartLegendLabelOptions, ChartLegendOptions.

I can take those constructors and move them to the latest code, carefully add any new options that were added and push another PR, unless they can be auto generated them somehow.

@danielmcquillen
Copy link

danielmcquillen commented May 29, 2018

Experiencing same issue. Is 0.5.0-dev broken?

When I switch to this version in pubspec.yml, Dart Analysis complains with errors like Abstract classes can't be created with a 'new' expresssion., referring to (for example) abstract class TickOptions<T>.

@joe776
Copy link

joe776 commented Aug 20, 2018

dart-archive/js_facade_gen#26 seems to be the underlying issue for this.

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

3 participants