bidi
2.0.13, released 2 years ago by pwa.ir
Converts logical RTL strings to their visual representation using the Unicode Bidirectional Algorithm.
What it does
The package implements the Unicode Bidirectional Algorithm to transform logical order text (e.g., Persian, Arabic, Hebrew) into the visual order required for display. It works entirely in Dart and supports null‑safety.
AI-written summary of version 2.0.13, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to display RTL text correctly in a Flutter or Dart app without native dependencies
- You want a lightweight, pure‑Dart solution for logical‑to‑visual conversion
Skip it when
- You need full layout handling or complex script shaping
- Performance is critical for very large texts
- You require a native Rust implementation for maximum speed
Strengths
- Pure Dart, no platform-specific setup
- Null‑safe and easy to import
- Supports major RTL languages out of the box
Weaknesses
- Only handles string conversion, not full rendering
- May be slower than the Rust counterpart for large workloads
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:bidi/bidi.dart' as bidi;
final visual = bidi.logicalToVisual('نوشته پارسی اینجا گذارده شود.');
print(visual);Alternatives
Packages that do the same job and could replace bidi.
- validators2
String validation and sanitization for Dart.
83Compare - characters
Unicode and grapheme cluster aware string manipulation operations for Dart.
86Compare - string_to_color
Convert strings to colors, hex strings, or hex integers in Dart and Flutter.
42Compare - alphanum_comparator
Sorts string lists alphanumerically using The Alphanum Algorithm.
55Compare
Works with
Packages commonly used together with bidi: ones it builds on, ones built on it, and its own family.