Skip to main content

Text

The text theme for C2C UIKits

NAMESIZELINE HEIGHTWEIGHTTRACKING
displayLarge5764Bold-0.25
displayMedium4552Bold-0.1
displaySmall3644Bold-0.1
headlineLarge3240Bold-0.1
headlineMedium2836Bold-0.1
headlineSmall2434Bold-0.1
titleLarge2032Medium0
titleMedium1624Medium0
titleSmall1420Medium0
bodyLarge1420Regular0
bodyMedium1216Regular0
bodySmall1012Regular0
bodyXSmall812Regular0
labelLarge1620Medium0
labelMedium1416Medium0
labelSmall1216Medium0
labelXSmall1012Medium0
link1420Regular0

C2CTextThemeData

PropertyDescription
fontFamilyThe font family for the text styles.
displayLargeText style for large display text.
displayMediumText style for medium display text.
displaySmallText style for small display text.
headlineLargeText style for large headlines.
headlineMediumText style for medium headlines.
headlineSmallText style for small headlines.
titleLargeText style for large titles.
titleMediumText style for medium titles.
titleSmallText style for small titles.
labelLargeText style for large labels.
labelMediumText style for medium labels.
labelSmallText style for small labels.
labelXSmallText style for extra small labels.
bodyLargeText style for large body text.
bodyMediumText style for medium body text.
bodySmallText style for small body text.
bodyXSmallText style for extra small body text.
linkText style for link text

Accessing the Text Theme

You can access the color theme data using C2CTheme.of(context) or C2CTextTheme.of(context) method within your widgets.

Example Usage

Widget build(BuildContext context) {
final textTheme = C2CTextTheme.of(context);
return Text(
'Hello',
style: textTheme.bodyLarge,
);
}

// or

Widget build(BuildContext context) {
final c2cTheme = C2CTheme.of(context);
return Text(
'Hello',
style: c2cTheme.textTheme.bodyLarge,
);
}

Apply a default text style to its descendant widgets

C2CTextTheme(
data: const C2CTextThemeData(
bodyLarge: TextStyle(fontSize: 20),
),
child: Builder(builder: (context) {
return Text(
'Hello',
style: C2CTextTheme.of(context).bodyLarge,
);
}),
)