CountryTileThemeData class final
A theme extension data class that holds theme data for country/phone code tiles.
This class is specific to tiles that display world country information and
extends BaseTileThemeData
with a specified type of WorldCountry. It
introduces the ability to customize the appearance and interaction of
country and/or phone code tiles within the app's theme, including the style
of emoji flags displayed.
Usage: To use this theme data, you should provide a builder function capable of rendering a tile given WorldCountry item properties. Additionally, you can specify the family of emoji flags to be used with the tiles.
Example:
final countryTileThemeData = CountryTileThemeData(
emojiFamily: EmojiFamily.twemoji,
builder: (itemProperties, {isDense}) => MyCountryTile(
title: itemProperties.item.translations.first.common,
isDense: isDense,
),
);
MyCountryTile
is a hypothetical widget that uses the WorldCountry
properties to create a UI component representing a country, including an
emoji flag based on the specified family.
- Inheritance
-
- Object
- ThemeExtension<
BaseTileThemeData< WorldCountry> > - CountryTileThemeData
Constructors
-
CountryTileThemeData({EmojiFamily? emojiFamily, Widget builder(ItemProperties<
WorldCountry> itemProperties, {bool? isDense})?}) -
Constructs a CountryTileThemeData with an optional emoji flag family and
builder function.
const
Properties
-
builder
→ (Widget Function(ItemProperties<
WorldCountry> itemProperties, {bool? isDense})?) -
A builder function that takes ItemProperties and an optional density
flag, and returns a widget for the tile.
finalinherited
- emojiFamily → EmojiFamily?
-
The family of emoji flag to be used when rendering country flags in tiles.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → Object
-
The extension's type.
no setterinherited
Methods
-
copyWith(
{Widget builder(ItemProperties< WorldCountry> itemProperties, {bool? isDense})?}) → BaseTileThemeData<WorldCountry> -
Creates a copy of this theme extension with the given fields
replaced by the non-null parameter values.
inherited
-
lerp(
covariant ThemeExtension< BaseTileThemeData< ? other, double t) → BaseTileThemeData<WorldCountry> >WorldCountry> -
Linearly interpolate with another ThemeExtension object.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited