pq / surveyor

📐 Tools for surveying Dart packages
Apache License 2.0
53 stars 12 forks source link

fix widget surveyor to work in switch statements #4

Closed pq closed 5 years ago

pq commented 5 years ago

To see where this is not working look at accident_reporting:

    MaterialApp(
      home: HomePage(),
      onGenerateRoute: (RouteSettings settings) {
        switch (settings.name) {
          case '/home':
            return PageTransition(child: HomePage(),type: PageTransitionType.leftToRight);
            break;
          case '/second':
            return PageTransition(child: PageOne(),type: PageTransitionType.leftToRight);
            break;
          case '/third':
            return PageTransition(
                child: PageTwo(
                  mapData: settings.arguments,
                ),type: PageTransitionType.leftToRight);
            break;

and notice that we do not track ~PageTransitions and~ PageOne, etc.

(EDIT: PageTransition is not a Widget...)

pq commented 5 years ago

Fixed w/ be5b836a24bb0e67d2d6219cebce8e04cb463211.

[~/src/repos/surveyor] (master) $ cat accident_reporting_widget.csv
MaterialApp, 1, flutter
HomePage, 2, *
PageOne, 1, *
PageTwo, 1, *
PageThree, 1, *
PageFour, 1, *
PageFive, 1, *
PageSeven, 1, *
SwipeButtonDemo, 1, *
FullPageRadioGroup, 2, *
TopPrograssBar, 6, *
FullPageHumanAnatomy, 1, *
FullPageAnalogTimePicker, 1, *
FullPageLocationAndImagePicker, 1, *
DataReviewAndUpload, 1, *

/fyi @jayoung-lee

jayoung-lee commented 5 years ago

This is awesome! Thank you Phil.