CalseeKey.text constructor

CalseeKey.text(
  1. String text, {
  2. required KeyRole role,
  3. VoidCallback? onPressed,
  4. VoidCallback? onLongPress,
  5. String? semanticLabel,
  6. double sizeFactor = 0.4,
  7. bool haptics = true,
  8. Key? key,
})

A key showing text in the theme's key font.

Implementation

factory CalseeKey.text(
  String text, {
  required KeyRole role,
  VoidCallback? onPressed,
  VoidCallback? onLongPress,
  String? semanticLabel,
  double sizeFactor = 0.4,
  bool haptics = true,
  Key? key,
}) => CalseeKey(
  role: role,
  semanticLabel: semanticLabel ?? text,
  onPressed: onPressed,
  onLongPress: onLongPress,
  haptics: haptics,
  artSeed: text.hashCode & 0x7FFFFFFF,
  key: key,
  builder: (context, style, shortSide) =>
      CalseeKeyLabel(text, style: style, size: shortSide * sizeFactor),
);