/dart-classgraph

将dart源码的继承(extends)关系图用JSON格式展现出来

Primary LanguageDart

解析包内类图

这是一个无聊的工具

功能

给我个目录,我就能把保内的所有类爬行一遍,告诉你类之间的继承关系,然后用JSON输出出来

例如,我输入一个目录: /Users/etiantian/flutter/flutter-0.10.0/packages/flutter/lib/ 对于项目依赖的package,我可以直接指定包名

程序输出:

{"Diagnosticable":{"DiagnosticableTree":{"SemanticsHintOverrides":{},"SemanticsProperties":{},"TextSpan":{},"Widget":{"_WidgetForTypeTests":{},"StatelessWidget":{"CupertinoActionSheet":{},"CupertinoActionSheetAction":{},"_CupertinoAlertContentSection":{},"CupertinoAlertDialog":{},"CupertinoDialog":{},"CupertinoPopupSurface":{},"CupertinoDialogAction":{},"CupertinoTabBar":{},"CupertinoPageTransition":{},"CupertinoFullscreenDialogTransition":{},"CupertinoPageScaffold":{},"_TextSelectionToolbar":{},"_PersistentNavigationBar":{},"CupertinoNavigationBarBackButton":{},"_BackChevron":{},"_BackLabel":{},"_TransitionableNavigationBar":{},"_NavigationBarTransition":{},"DrawerHeader":{},"MaterialButton":{"RaisedButton":{"_RaisedButtonWithIcon":{}},"OutlineButton":{"_OutlineButtonWithIcon":{}},"FlatButton":{"_FlatButtonWithIcon":{}}},"GridTile":{},"_ShapeBorderPaint":{},"BackButtonIcon":{},"BackButton":{},"CloseButton":{},"AboutListTile":{},"AboutDialog":{},"RadioListTile":{},"GridTileBar":{},"CircleAvatar":{},"ButtonBar":{},"_FadeUpwardsPageTransition":{},"_OpenUpwardsPageTransition":{},"SnackBar":{},"_AffixText":{},"Card":{},"DataTable":{},"Dialog":{},"AlertDialog":{},"SimpleDialogOption":{},"SimpleDialog":{},"_DayPeriodControl":{},"_HourControl":{},"_StringFragment":{},"_MinuteControl":{},"_TimePickerHeader":{},"CheckboxListTile":{},"Tab":{},"TabPageSelectorIndicator":{},"TabPageSelector":{},"_DatePickerHeader":{},"_DateHeaderButton":{},"DayPicker":{},"_PopupMenu":{},"_AccountPictures":{},"Chip":{},"InputChip":{},"ChoiceChip":{},"FilterChip":{},"ActionChip":{},"FlutterLogo":{},"_TooltipOverlay":{},"SwitchListTile":{},"DropdownMenuItem":{},"ListTile":{},"Divider":{},"VerticalDivider":{},"Drawer":{},"AnimatedIcon":{},"TwoLevelListItem":{},"TwoLevelList":{},"_BottomNavigationTile":{},"Theme":{},"IconButton":{},"SingleChildScrollView":{},"GridPaper":{},"SliverPersistentHeader":{},"PageStorage":{},"PositionedDirectional":{},"KeyedSubtree":{},"Builder":{},"GestureDetector":{},"Text":{},"NavigationToolbar":{},"PreferredSize":{},"Container":{},"Placeholder":{},"Icon":{},"ImageIcon":{},"OrientationBuilder":{},"Title":{},"Visibility":{},"Banner":{},"CheckedModeBanner":{},"NotificationListener":{},"ModalBarrier":{},"SafeArea":{},"SliverSafeArea":{},"Spacer":{},"ScrollView":{"CustomScrollView":{"_NestedScrollViewCustomScrollView":{}},"BoxScrollView":{"ListView":{},"GridView":{}}}},"StatefulWidget":{"CupertinoTabView":{},"CupertinoTextField":{},"CupertinoSegmentedControl":{},"_CupertinoActionSheetCancelButton":{},"_CupertinoAlertActionSection":{},"_PressableActionButton":{},"CupertinoButton":{},"CupertinoTabScaffold":{},"_TabSwitchingView":{},"CupertinoDatePicker":{},"CupertinoTimerPicker":{},"CupertinoSliverRefreshControl":{},"CupertinoPicker":{},"_CupertinoBackGestureDetector":{},"CupertinoActivityIndicator":{},"CupertinoSlider":{},"CupertinoSwitch":{},"CupertinoScrollbar":{},"CupertinoApp":{},"CupertinoNavigationBar":{},"CupertinoSliverNavigationBar":{},"Material":{},"_FloatingActionButtonTransition":{},"Scaffold":{},"_PersistentBottomSheet":{},"TextField":{},"LicensePage":{},"RefreshIndicator":{},"Ink":{},"SnackBarAction":{},"_BorderContainer":{},"_HelperError":{},"InputDecorator":{},"ReorderableListView":{},"_ReorderableListContent":{},"RawMaterialButton":{},"_SortArrow":{},"DefaultTabController":{},"InkResponse":{"TableRowInkWell":{},"InkWell":{}},"Checkbox":{},"_Dial":{},"_TimePickerDialog":{},"Radio":{},"Stepper":{},"TabBar":{},"TabBarView":{},"MonthPicker":{},"YearPicker":{},"_DatePickerDialog":{},"FloatingActionButton":{},"PopupMenuEntry":{"PopupMenuDivider":{},"PopupMenuItem":{"CheckedPopupMenuItem":{}}},"PopupMenuButton":{},"ExpandIcon":{},"AppBar":{},"_FloatingAppBar":{},"SliverAppBar":{},"BottomAppBar":{},"_AccountDetails":{},"UserAccountsDrawerHeader":{},"RawChip":{},"PaginatedDataTable":{},"Tooltip":{},"_DropdownMenu":{},"DropdownButton":{},"Slider":{},"ProgressIndicator":{"LinearProgressIndicator":{},"CircularProgressIndicator":{"RefreshProgressIndicator":{}}},"ExpansionTile":{},"BottomSheet":{},"_ModalBottomSheet":{},"MergeableMaterial":{},"DrawerController":{},"FlexibleSpaceBar":{},"Switch":{},"TwoLevelSublist":{},"Scrollbar":{},"BottomNavigationBar":{},"MaterialApp":{},"_SearchPage":{},"ExpansionPanelList":{},"_OutlineButton":{},"ImplicitlyAnimatedWidget":{"_MaterialInterior":{},"AnimatedTheme":{},"AnimatedContainer":{},"AnimatedPadding":{},"AnimatedAlign":{},"AnimatedPositioned":{},"AnimatedPositionedDirectional":{},"AnimatedOpacity":{},"AnimatedDefaultTextStyle":{},"AnimatedPhysicalModel":{}},"AnimatedCrossFade":{},"AnimatedWidget":{"_Shaker":{},"_TabStyle":{},"SlideTransition":{},"ScaleTransition":{},"RotationTransition":{},"SizeTransition":{},"PositionedTransition":{},"RelativePositionedTransition":{},"DecoratedBoxTransition":{},"AlignTransition":{},"DefaultTextStyleTransition":{},"AnimatedBuilder":{},"AnimatedModalBarrier":{}},"_ModalScope":{},"StatefulBuilder":{},"RawGestureDetector":{},"StreamBuilderBase":{"StreamBuilder":{}},"FutureBuilder":{},"Form":{},"FormField":{"DropdownButtonFormField":{},"TextFormField":{}},"Image":{},"NestedScrollView":{},"Navigator":{},"ValueListenableBuilder":{},"EditableText":{},"Scrollable":{"_FixedExtentScrollable":{}},"AnimatedSwitcher":{},"PageView":{},"Draggable":{"LongPressDraggable":{}},"DragTarget":{},"GlowingOverscrollIndicator":{},"Hero":{},"WidgetInspector":{},"AutomaticKeepAlive":{},"SemanticsDebugger":{},"_TextSelectionHandleOverlay":{},"AnimatedList":{},"FadeInImage":{},"FocusScope":{},"UniqueWidget":{},"ListWheelScrollView":{},"Dismissible":{},"WillPopScope":{},"StatusTransitionWidget":{},"AndroidView":{},"UiKitView":{},"WidgetsApp":{},"_OverlayEntry":{},"Overlay":{},"RawKeyboardListener":{},"Localizations":{}},"ProxyWidget":{"ParentDataWidget":{"_ActionButtonParentDataWidget":{},"LayoutId":{},"Positioned":{},"Flexible":{"Expanded":{}},"TableCell":{},"KeepAlive":{}},"InheritedWidget":{"_ScaffoldScope":{},"_TabControllerScope":{},"DropdownButtonHideUnderline":{},"ButtonTheme":{},"ListTileTheme":{},"SliderTheme":{},"ChipTheme":{},"FlexibleSpaceBarSettings":{},"_InheritedTheme":{},"_ModalScopeStatus":{},"Directionality":{},"DefaultAssetBundle":{},"DefaultTextStyle":{},"_FormScope":{},"_InheritedNestedScrollView":{},"MediaQuery":{},"PrimaryScrollController":{},"_ScrollableScope":{},"InheritedModel":{},"InheritedNotifier":{},"ScrollConfiguration":{},"IconTheme":{},"TickerMode":{},"_FocusScopeMarker":{},"_LocalizationsScope":{}}},"RenderObjectWidget":{"_CupertinoAlertRenderWidget":{},"_CupertinoDialogRenderWidget":{},"_Decorator":{},"_ChipRenderWidget":{},"_ListTile":{},"_SliverPersistentHeaderRenderObjectWidget":{"_SliverScrollingPersistentHeader":{},"_SliverPinnedPersistentHeader":{},"_SliverFloatingPersistentHeader":{},"_SliverFloatingPinnedPersistentHeader":{}},"LayoutBuilder":{},"Table":{},"LeafRenderObjectWidget":{"_CupertinoSliderRenderObjectWidget":{},"_CupertinoSwitchRenderObjectWidget":{},"_CheckboxRenderObjectWidget":{},"_RadioRenderObjectWidget":{},"_SliderRenderObjectWidget":{},"_SwitchRenderObjectWidget":{},"RichText":{},"RawImage":{},"WidgetToRenderBoxAdapter":{},"Texture":{},"_Editable":{},"PerformanceOverlay":{},"_InspectorOverlay":{},"ErrorWidget":{},"_AndroidPlatformView":{},"_UiKitPlatformView":{}},"SingleChildRenderObjectWidget":{"_CupertinoSliverRefresh":{},"_CupertinoPickerSemantics":{},"_InkFeatures":{},"_InputPadding":{},"_ChildOverflowBox":{},"_ChipRedirectingHitDetectionWidget":{},"_SingleChildViewport":{},"FadeTransition":{},"Opacity":{},"ShaderMask":{},"BackdropFilter":{},"CustomPaint":{},"ClipRect":{},"ClipRRect":{},"ClipOval":{},"ClipPath":{},"PhysicalModel":{},"PhysicalShape":{},"Transform":{},"CompositedTransformTarget":{},"CompositedTransformFollower":{},"FittedBox":{},"FractionalTranslation":{},"RotatedBox":{},"Padding":{},"Align":{"Center":{}},"CustomSingleChildLayout":{},"SizedBox":{},"ConstrainedBox":{},"UnconstrainedBox":{},"FractionallySizedBox":{},"LimitedBox":{},"OverflowBox":{},"SizedOverflowBox":{},"Offstage":{},"AspectRatio":{},"IntrinsicWidth":{},"IntrinsicHeight":{},"Baseline":{},"SliverToBoxAdapter":{},"SliverPadding":{},"Listener":{},"RepaintBoundary":{},"IgnorePointer":{},"AbsorbPointer":{},"MetaData":{},"Semantics":{},"MergeSemantics":{},"BlockSemantics":{},"ExcludeSemantics":{},"IndexedSemantics":{},"_GestureSemantics":{},"SliverOverlapAbsorber":{},"SliverOverlapInjector":{},"DecoratedBox":{},"_ScrollSemantics":{},"AnnotatedRegion":{},"SizeChangedLayoutNotifier":{},"SliverFillRemaining":{},"AnimatedSize":{}},"MultiChildRenderObjectWidget":{"_SegmentedControlRenderWidget":{},"_CupertinoAlertActionsRenderWidget":{},"_CupertinoDialogActionsRenderWidget":{},"CustomMultiChildLayout":{},"ListBody":{"_MergeableMaterialListBody":{}},"Stack":{"IndexedStack":{}},"Flex":{"_TabLabelBar":{},"Row":{},"Column":{}},"Wrap":{},"Flow":{},"Viewport":{"NestedScrollViewViewport":{}},"ShrinkWrappingViewport":{}},"ListWheelViewport":{},"SliverWithKeepAliveWidget":{"SliverMultiBoxAdaptorWidget":{"SliverPrototypeExtentList":{},"SliverList":{},"SliverFixedExtentList":{},"SliverGrid":{},"SliverFillViewport":{}}},"_Theatre":{},"RenderObjectToWidgetAdapter":{}}},"Element":{"ComponentElement":{"StatelessElement":{},"StatefulElement":{},"ProxyElement":{"ParentDataElement":{},"InheritedElement":{"InheritedModelElement":{},"_InheritedNotifierElement":{}}}},"RenderObjectElement":{"_CupertinoAlertRenderElement":{},"_CupertinoDialogRenderElement":{},"_RenderDecorationElement":{},"_RenderChipElement":{},"_ListTileElement":{},"_SliverPersistentHeaderElement":{},"_LayoutBuilderElement":{},"_TableElement":{},"RootRenderObjectElement":{"RenderObjectToWidgetElement":{}},"LeafRenderObjectElement":{},"SingleChildRenderObjectElement":{"_OffstageElement":{}},"MultiChildRenderObjectElement":{"_ViewportElement":{}},"ListWheelElement":{},"SliverMultiBoxAdaptorElement":{"_SliverPrototypeExtentListElement":{}},"_TheatreElement":{}}}},"SemanticsData":{},"SemanticsSortKey":{"OrdinalSortKey":{"_MonthPickerSortKey":{}}},"TextStyle":{},"Decoration":{"FlutterLogoDecoration":{},"BoxDecoration":{},"ShapeDecoration":{},"_CupertinoEdgeShadowDecoration":{},"UnderlineTabIndicator":{}},"ImageStream":{},"ImageStreamCompleter":{"OneFrameImageStreamCompleter":{},"MultiFrameImageStreamCompleter":{}},"SliverGeometry":{},"TextTheme":{},"TabBarTheme":{},"PageTransitionsTheme":{},"InputDecorationTheme":{},"ColorScheme":{},"DialogTheme":{},"ButtonThemeData":{},"Typography":{},"SliderThemeData":{},"ChipThemeData":{},"ThemeData":{},"IconThemeData":{},"State":{"_CupertinoTabViewState":{},"_CupertinoTextFieldState":{},"_SegmentedControlState":{},"_CupertinoActionSheetCancelButtonState":{},"_CupertinoAlertActionSectionState":{},"_PressableActionButtonState":{},"_CupertinoButtonState":{},"_CupertinoTabScaffoldState":{},"_TabSwitchingViewState":{},"_CupertinoDatePickerDateTimeState":{},"_CupertinoDatePickerDateState":{},"_CupertinoTimerPickerState":{},"_CupertinoSliverRefreshControlState":{},"_CupertinoPickerState":{},"_CupertinoBackGestureDetectorState":{},"_CupertinoActivityIndicatorState":{},"_CupertinoSliderState":{},"_CupertinoSwitchState":{},"_CupertinoScrollbarState":{},"_CupertinoAppState":{},"_CupertinoNavigationBarState":{},"_CupertinoSliverNavigationBarState":{},"_MaterialState":{},"_FloatingActionButtonTransitionState":{},"ScaffoldState":{},"_PersistentBottomSheetState":{},"_TextFieldState":{},"_LicensePageState":{},"RefreshIndicatorState":{},"_InkState":{},"_SnackBarActionState":{},"_BorderContainerState":{},"_HelperErrorState":{},"_InputDecoratorState":{},"_ReorderableListViewState":{},"_ReorderableListContentState":{},"_RawMaterialButtonState":{},"_SortArrowState":{},"_DefaultTabControllerState":{},"_InkResponseState":{},"_CheckboxState":{},"_DialState":{},"_TimePickerDialogState":{},"_RadioState":{},"_StepperState":{},"_TabBarState":{},"_TabBarViewState":{},"_MonthPickerState":{},"_YearPickerState":{},"_DatePickerDialogState":{},"_FloatingActionButtonState":{},"_PopupMenuDividerState":{},"PopupMenuItemState":{"_CheckedPopupMenuItemState":{}},"_PopupMenuButtonState":{},"_ExpandIconState":{},"_AppBarState":{},"_FloatingAppBarState":{},"_SliverAppBarState":{},"_BottomAppBarState":{},"_AccountDetailsState":{},"_UserAccountsDrawerHeaderState":{},"_RawChipState":{},"PaginatedDataTableState":{},"_TooltipState":{},"_DropdownMenuState":{},"_DropdownButtonState":{},"_SliderState":{},"_LinearProgressIndicatorState":{},"_CircularProgressIndicatorState":{"_RefreshProgressIndicatorState":{}},"_ExpansionTileState":{},"_BottomSheetState":{},"_ModalBottomSheetState":{},"_MergeableMaterialState":{},"DrawerControllerState":{},"_FlexibleSpaceBarState":{},"_SwitchState":{},"_TwoLevelSublistState":{},"_ScrollbarState":{},"_BottomNavigationBarState":{},"_MaterialAppState":{},"_SearchPageState":{},"_ExpansionPanelListState":{},"_OutlineButtonState":{},"ImplicitlyAnimatedWidgetState":{"AnimatedWidgetBaseState":{"_MaterialInteriorState":{},"_AnimatedThemeState":{},"_AnimatedContainerState":{},"_AnimatedPaddingState":{},"_AnimatedAlignState":{},"_AnimatedPositionedState":{},"_AnimatedPositionedDirectionalState":{},"_AnimatedDefaultTextStyleState":{},"_AnimatedPhysicalModelState":{}},"_AnimatedOpacityState":{}},"_AnimatedCrossFadeState":{},"_AnimatedState":{},"_ModalScopeState":{},"_StatefulBuilderState":{},"RawGestureDetectorState":{},"_StreamBuilderBaseState":{},"_FutureBuilderState":{},"FormState":{},"FormFieldState":{"_DropdownButtonFormFieldState":{},"_TextFormFieldState":{}},"_ImageState":{},"_NestedScrollViewState":{},"NavigatorState":{},"_ValueListenableBuilderState":{},"EditableTextState":{},"ScrollableState":{"_FixedExtentScrollableState":{}},"_AnimatedSwitcherState":{},"_PageViewState":{},"_DraggableState":{},"_DragTargetState":{},"_GlowingOverscrollIndicatorState":{},"_HeroState":{},"_WidgetInspectorState":{},"_AutomaticKeepAliveState":{},"_SemanticsDebuggerState":{},"_TextSelectionHandleOverlayState":{},"AnimatedListState":{},"_FadeInImageState":{},"_FocusScopeState":{},"_ListWheelScrollViewState":{},"_DismissibleState":{},"_WillPopScopeState":{},"_StatusTransitionState":{},"_AndroidViewState":{},"_UiKitViewState":{},"_WidgetsAppState":{},"_OverlayEntryState":{},"OverlayState":{},"_RawKeyboardListenerState":{},"_LocalizationsState":{}}}}

在JSON viewer awesome (一个查看JSON的chrome 扩展)上查看: JSON normal效果图

AND

JSON Tree效果图