> arabic_justified_text_
arabic_justified_text
Beautiful Arabic text justification using Kashida (ـ) instead of spaces.
v1.0.2 MIT #Arabic#Text#Kashida#Justification#RTL#UI
23
LIKES
880
DOWNLOADS
100%
HEALTH
160/160
POINTS
> Overview_
Overview
Beautiful Arabic text justification using Kashida (ـ) instead of spaces.
Arabic text justification using Kashida instead of spaces.. صُممت لتكون سهلة الاستخدام مع واجهة API بسيطة وواضحة، ومُحسّنة للأداء العالي.
> Platforms_
Platforms
iOSAndroidWebmacOSWindowsLinux
> Features_
Features
Smart Kashida Distribution - Intelligently distributes Kashida across words
Diacritics Support - Properly handles Arabic diacritics (Tashkeel)
Mixed Text Support - Works with Arabic and English text together
Line Break Support - Respects newlines in text
Theme Integration - Inherits default text styles from your app theme
RichText Support - Advanced styling with ArabicJustifiedRichText
Sacred Text Handling - Automatically excludes Allah from Kashida
Customizable Exclusions - Add your own words to exclude from Kashida
Performance Optimized - Efficient text processing
RTL/LTR Support - Configurable text direction (RTL by default)
> Installation_
Installation
$ flutter pub add arabic_justified_text
dependencies:
arabic_justified_text: ^1.0.2 > Quick Start_
Quick Start
import 'package:arabic_justified_text/arabic_justified_text.dart';
ArabicJustifiedText(
'Your Arabic text here',
) > Usage_
Usage
ArabicJustifiedText(
'Arabic text here',
style: TextStyle(fontSize: 16, height: 1.8),
enableKashida: true,
maxLines: 5,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.justify,
textDirection: TextDirection.rtl,
excludedWords: ['word1', 'word2'],
) > Beautiful Arabic text justification using Kashida (ـ) instead of spaces_
Beautiful Arabic text justification using Kashida (ـ) instead of spaces
Then run: > Basic Usage_
Basic Usage
### With Custom Style > With All Options_
With All Options
<h2 id="parameters">📖 Parameters</h2>
### ArabicJustifiedText
For simple text with single style.
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `text` | `String` | **required** | The text to display |
| `style` | `TextStyle?` | `null` | Text style (inherits from theme if null) |
| `maxLines` | `int?` | `null` | Maximum number of lines |
| `overflow` | `TextOverflow?` | `null` | How to handle text overflow |
| `textDirection` | `TextDirection` | `TextDirection.rtl` | Text direction (RTL/LTR) |
| `textAlign` | `TextAlign` | `TextAlign.justify` | Text alignment |
| `enableKashida` | `bool` | `true` | Enable/disable Kashida justification |
| `excludedWords` | `List<String>?` | `null` | Words to exclude from Kashida |
### ArabicJustifiedRichText
For complex text with multiple styles.
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `textSpan` | `InlineSpan` | **required** | The text span to display |
| `maxLines` | `int?` | `null` | Maximum number of lines |
| `overflow` | `TextOverflow?` | `null` | How to handle text overflow |
| `textDirection` | `TextDirection` | `TextDirection.rtl` | Text direction (RTL/LTR) |
| `textAlign` | `TextAlign` | `TextAlign.justify` | Text alignment |
| `enableKashida` | `bool` | `true` | Enable/disable Kashida justification |
| `excludedWords` | `List<String>?` | `null` | Words to exclude from Kashida |
<h2 id="examples">💡 Examples</h2>
### 1. Simple Text > 2. Text with Diacritics (Tashkeel)_
2. Text with Diacritics (Tashkeel)
### 3. Multi-line Text with Line Breaks > 4. Mixed Arabic and English_
4. Mixed Arabic and English
### 5. With Maximum Lines > 6. Toggle Kashida On/Off_
6. Toggle Kashida On/Off
<h2 id="special-features">🕌 Special Features</h2>
### Respectful Handling of Sacred Words
The package automatically excludes the word (اللّٰه) and its variations from Kashida application, preserving its traditional appearance. > Automatically excluded variations:_
Automatically excluded variations:
#### Use cases:
- 📖 Religious texts (prophets' names, sacred terms)
- 📚 Brand names or proper nouns
- ✍️ Technical terms that should remain unchanged
<h2 id="advanced-usage">🎨 Advanced Usage</h2>
### Using ArabicJustifiedRichText
> **⚠️ Important:** `ArabicJustifiedRichText` currently does **not** support `WidgetSpan`.
> If your text contains widgets (icons, images, etc.), the Kashida justification will be
> disabled and it will fall back to standard `RichText` rendering.
For complex text with multiple styles, colors, or interactions: