process method

List<RawWidgetDj> process()

Implementation

List<RawWidgetDj> process() {
  print('Processing Flutter SDK at $sdkLocation...');

  var widgetFolders = [
    'animation',
    'cupertino',
    'foundation',
    'gestures',
    'material',
    'painting',
    'physics',
    'rendering',
    'scheduler',
    'semantics',
    'services',
    'widgets',
  ];

  var baseFolder = p.join(
    sdkLocation,
    'packages',
    'flutter',
    'lib',
    'src',
  );

  // For Extracting Dart Widgets!
  // var widgetFolders = [
  //   'core',
  // ];
  // var baseFolder = p.join(
  //   sdkLocation,
  //   'bin',
  //   'cache',
  //   'pkg',
  //   'sky_engine',
  //   'lib',
  // );

  var allRawWidgets = <RawWidgetDj>[];

  widgetFolders.forEach((widgetFolder) {
    var flutterWidgetLocation = p.join(
      baseFolder,
      widgetFolder,
    );

    var folderRawWidgets = _processWidgetDirectory(flutterWidgetLocation);

    print(
      'Got ${folderRawWidgets.length} Raw Widgets from $widgetFolder widget folder',
    );

    allRawWidgets += folderRawWidgets;
  });

  print(
    'Got a Total of ${allRawWidgets.length} Raw Widgets from $baseFolder folder',
  );

  return allRawWidgets;
}