Code
Inline Flutter code chips that preserve line breaks and wrap long tokens inside prose.
Show inline Flutter code chips that preserve line breaks and wrap long tokens.
Contract
TRCode renders short, inline machine-readable text. It accepts a string, inherits the surrounding font size, and preserves explicit line breaks. Use TRCodeBlock for standalone code samples.
Install
Add the package, then import its public library.
flutter pub add tinyrack_uiimport 'package:tinyrack_ui/tinyrack_ui.dart';Playground
Usage
import 'package:material_ui/material_ui.dart';
import 'package:tinyrack_ui/tinyrack_ui.dart';
const TRCode('pnpm verify')Examples
Content contexts permalink
Inline code keeps its visual treatment in prose, configuration values, long tokens, and multiline content.
API
TRCode exposes const TRCode(String data, {Key? key}). The required data string is rendered by Flutter Text, so explicit newlines are preserved and long tokens wrap when the parent provides a bounded width. The optional key defaults to null.
The widget uses TinyrackThemeData.surfaceMuted for its background, TinyrackThemeData.border for its border, and TinyrackThemeData.text for its foreground. It applies the bundled IBM Plex Mono family, inherits the surrounding font size, and uses the shared inline-code line height, small radius, and extra-small spacing tokens.