HorizontalFeaturedList class
{@tool snippet} This is a sample of a HorizontalFeaturedList widget.
HorizontalFeaturedList(
itemColorBuilder: (context, index) => colors[index],
itemCount: colors.length,
itemBuilder: (BuildContext context, int index) {
return Column(
children: [
Row(
children: <Widget>[
Icon(
Icons.face,
size: 24,
color: Colors.black45,
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text(
'($index) What is Lorem Ipsum?',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
),
),
),
),
],
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'($index) Lorem Ipsum is simply dummy text of the printing and typesetting industry.',
style: TextStyle(
fontSize: 12,
),
),
),
),
],
);
},
onPressedItem: () {},
onPressedSeeAll: () {},
titleText: 'Ongoing Projects',
seeAllText: 'See All',
)
{@end-tool}
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- HorizontalFeaturedList
Constructors
- HorizontalFeaturedList({Key? key, double itemHeight = 120, TextStyle titleTextStyle = const TextStyle(fontSize: 18, fontWeight: FontWeight.bold, color: Colors.black87), TextStyle seeAllTextStyle = const TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Colors.black54), required dynamic onPressedSeeAll(), double margin = 24, EdgeInsets itemPadding = const EdgeInsets.all(12), Color overlayColor = const Color(0x1F000000), BorderRadius itemBorderRadius = const BorderRadius.all(Radius.circular(22)), required dynamic onPressedItem(), required Widget itemBuilder(BuildContext context, int index), required int itemCount, Color itemColorBuilder(BuildContext context, int index)?, required String titleText, required String seeAllText, double? itemWidth, Duration animationDuration = const Duration(milliseconds: 400)})
-
Create a Horizontal Featured List.
This widget contains:
const
Properties
- animationDuration → Duration
-
to run the default animation.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- itemBorderRadius → BorderRadius
-
is the ListView item border radius.
final
- itemBuilder → Widget Function(BuildContext context, int index)
-
See also ListView.builder
final
- itemColorBuilder → (Color Function(BuildContext context, int index)?)
-
build the ListView item background color if needed.
final
- itemCount → int
-
See also ListView.builder
final
- itemHeight → double
-
lets the ListView knows its children size, caused by it is placed inside a Column.
final
- itemPadding → EdgeInsets
-
is the padding inside each of ListView items.
final
- itemWidth → double?
-
lets the horizontal ListView knows its children size.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- margin → double
-
is the spacing from parent to the left side of
final
- onPressedItem → dynamic Function()
-
action to navigate to a detail screen.
final
- onPressedSeeAll → dynamic Function()
-
final
- overlayColor → Color
-
is used for pressing animation on ListView items.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- seeAllText → String
-
final
- seeAllTextStyle → TextStyle
-
is the TextStyle use for
final
- titleText → String
-
final
- titleTextStyle → TextStyle
-
is the TextStyle use for
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _HorizontalFeaturedListState -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited