flutter_design library

Classes

ComponentParamBuilder
An interface indicating it is a parameter builder used by a DataBuilder.
Design
Flags a class as needing to be processed by flutter_design_codegen to generate into an importable design system viewer page. It also allows passing options to customize the builder's behavior.
DesignExample
An example description.
DesignExamples
Provide examples based on a specific constructor. The generated examples will be displayed as subsections following the section of the constructor widget designer.
DesignField
Provide a viewer data builder parameter for the field (be it a class field, or a method/ctor parameter field).
DesignParamPublisher
Configures a dynamic publisher generator. It should be used along with a DesignParamSubscriber with the same key.
DesignParamStringLorem
Configures a lorem ipsum string generator
DesignParamSubscriber
Configures a dynamic subscriber generator. It should be used along with a DesignParamPublisher with the same key.
DesignParamWidgetPlaceholder
Configures a widget placeholder generator
DesignParamWidgetPlaceholderList
Configures a widget placeholder list generator. Each placeholder will take a MaterialColor from Colors.primaries
FieldMetaData
Meta data on a widget constructor field
Searchable
Searchable object
SearchableElement
Searchable element
SearchResultItem
Represents a single found search result item.
TDataBuilder<TWidget, TBuildContext, TData, TParameter>
Interface of a data builder
TDataBuilderFactory<TBuildContext>
Interface of a data builder factory
ViewerApiDocsSection
ViewerCollectionItemUnion
Union class for paragraph item to be used in a ViewerParagraphSection.
ViewerComponentExample
Component example for a specific widget constructor
ViewerComponentSection
ViewerDocumentPage
ViewerGroupPage
ViewerImageCollectionItem
ViewerPageUnion
Union class that represents a "Page" in the design system viewer catalog.
ViewerParagraphSection
ViewerSectionUnion
Union class for sections on ViewerDocumentPage.
ViewerSourceCode
Source code information
ViewerTextCollectionItem
ViewerWidgetBuilder
Widget builder with meta data to construct a widget.
ViewerWidgetCollectionItem

Enums

SearchableHitType
Type of the item found by the search
SearchableType
Type of the searchable object
SearchResultContext
Context of the search result
SearchResultItemPageType
Type of the search result page
SearchResultItemType
Type of the search result item
ViewerImageCollectionItemStyle
Image style of the item

Constants

design → const Design
Annotation: Parameterless annotation

Functions

buildComponentPageTree({required List<ViewerDocumentPage> componentPages, String id = 'components', bool compressLeaf = true, bool sortById = true}) ViewerGroupPage
Take a list of flat document pages and group & layer them into a single component tree. Typically you can pass the generated generatedComponentPages via flutter_design_codegen.
buildGroupedPageTrees(List<ViewerDocumentPage> documentPages, {bool compressLeaf = false, bool sortById = false}) List<ViewerGroupPage>
Generate a list of ViewerGroupPage by grouping and layering document pages with group pages based on the namespace. The returned results will be the first children nodes in a tree structure.

Typedefs

ComponentBuilder<TWidget, TBuildContext> = TWidget Function(TBuildContext context, TDataBuilderFactory<TBuildContext> factory)
DataBuilder<TData, TParameter> = TDataBuilder<Widget, BuildContext, TData, TParameter>
Data builder for a specific type T
DataBuilderFactory = TDataBuilderFactory<BuildContext>
Data builder factory
TUpdateDataBuilder<TWidget, TBuildContext, TData, TParameter> = void Function(TDataBuilder<TWidget, TBuildContext, TData, TParameter> builder)
UpdateDataBuilder<TData, TParameter> = TUpdateDataBuilder<Widget, BuildContext, TData, TParameter>
Function to update a data builder of type T with new values
VoidBoolCallback = void Function(bool)
VoidCallback = void Function()
VoidDoubleCallback = void Function(double)
VoidDynamicCallback = void Function(dynamic)
VoidIntCallback = void Function(int)
VoidStringCallback = void Function(String)
WidgetBuilder = Widget Function(BuildContext)
WidgetDynamicBuilder = Widget Function(BuildContext context, DataBuilderFactory data)
Function to build a widget with the context and a data builder factory