GF Flutter List Tile

GF Flutter List Tile

GFListTile is a Flutter ListTile that is a widget used to populate a ListView in an application. It generally has a title, and one to three lines of description or subtitle, and a trailing icon. The ListTile background color can be changed using the color property.

GF Flutter ListTile Example

The simple GF ListTile code is as shown below

import 'package:getwidget/getwidget.dart';

GFListTile(
  titleText:'Title',
  subTitleText:'Lorem ipsum dolor sit amet, consectetur adipiscing',
  icon: Icon(Icons.favorite)
),

GF Flutter ListTile With Avatar

listtile with avatar

GFListTile can have an avatar in the starting position in it. The avatar is usually a background image or just a profile image.

The simple code of GF Flutter ListTile with the avatar is as shown below

import 'package:getwidget/getwidget.dart';

GFListTile(
  avatar:GFAvatar(),
  titleText:'Title',
  subTitleText:'Lorem ipsum dolor sit amet, consectetur adipiscing',
  icon: Icon(Icons.favorite)
),

GF FlutterListTile Custom Properties

GF ListTile has some of its custom properties to create a smooth look and feel for the application. The below table shows the custom properties:

NameDescription
colorThe GFListTile's background color. Can be given [Color] or [GFColors]
descriptionThe description to display inside the [GFListTile]. see [Text]
paddingdefines the padding of GFListTile
margindefines the margin of GFListTile
titleTexttype of [String] used to pass text, alternative to title property and gets higher priority than the title
subTitleTexttype of [String] used to pass text, alternative to subtitle property and gets higher priority than the subtitle
avatartype of [Widget] or [GFAvatar] used to create a rounded user profile
titleThe title to display inside the [GFListTile]. see [Text]
subTitleThe subtitle to display inside the [GFListTile]. see [Text]
iconThe icon to display inside the [GFListTile]. see [Icon]
enabledWhether this list tile is interactive. If false, this list tile is styled with the disabled color from the current [Theme] and the [onTap] and [onLongPress] callbacks are inoperative.
onTapCalled when the user taps this list tile. Inoperative if [enabled] is false.
onLongPressCalled when the user long-presses on this list tile. Inoperative if [enabled] is false.
selectedIf this tile is also [enabled] then icons and text are rendered with the same color. By default the selected color is the theme's primary color. The selected color can be overridden with a [ListTileTheme].
focusColorThe color for the tile's [Material] when it has the input focus.
hoverColorThe color for the tile's [Material] when a pointer is hovering over it.
focusNodeDefines the keyboard focus for this widget.
autofocusOn true state, it should focus itself if nothing else is already focused. Defaults to false

Last Updated: September 27, 2023