CustomExpansionTileWidget

A CustomExpansionTileWidget is An edited version of Expansion Tile that allows you customize header tile and expanded list.

Example

CustomExpansionTileWidget(
        headerTitle: "Overview",
        headerDecoration: BoxDecoration(
          borderRadius: BorderRadius.all(Radius.circular(12)),
          border: Border.all(color: Colors.blueAccent),
          color: Colors.yellow
          ),
        children: [
          Container(
            height: 50,
            decoration: BoxDecoration(
              border: Border.all(color: Colors.black),
              color: Colors.green,
            ),
            child: const Center(
              child: Text("List1"),
            ),
          ),
          Container(
            height: 50,
            decoration: BoxDecoration(
              border: Border.all(color: Colors.black),
              color: Colors.red,
            ),
            child: const Center(
              child: Text("List2"),
            ),
          ),
          Container(
            height: 50,
            decoration: BoxDecoration(
              border: Border.all(color: Colors.black),
              color: Colors.blueAccent,
            ),
            child: const Center(
              child: Text("List3"),
            ),
          ),
          Container(
            height: 50,
            decoration: BoxDecoration(
              border: Border.all(color: Colors.black),
              color: Colors.orangeAccent,
            ),
            child: const Center(
              child: Text("List4"),
            ),
          ),
        ],
      ),

Parameters

AttributeData typeDescription
headerLeadingWidget?A widget to display before the title
headerTitleStringPrimary title for List view
headerDecorationDecoration?It allows you to decorate the header tile
headerPaddingEdgeInsets?Specifies padding for header tile
headerHeightdouble?height parameter for Header tile ,default height is 50px
headerTextStyleTextStyle?It allows you to customize default style of headerTitle
onExpansionChangedValueChangedWhen the widget starts expanding, this function is called with the value true. When the tile starts collapsing, this function is called with the value false
childrenListThe widgets that are displayed when the tile expands
headerTileColorColor?The color of the header tile
headerTrailingWidget?A widget to display after the headerTitle
isHeaderTrailingAnimationbooldefault animation added to headerTrailing Widget if it is true.
initiallyExpandedboolSpecifies if the expansionWidget is initially expanded (true) or collapsed, default is false
animationDurationDuration?The length of time of animation ,default is 200 ms

Libraries

expansion_tile_widget