kashi

Kashi for Flutter: the Persian, RTL-first design system (kashi.sepantapouya.com).

  • KashiTheme.light() / KashiTheme.dark(): Material 3 themes built from Kashi's tokens (the same file the web uses), plus context.kashi for the semantic colors
  • KashiButton, KashiCard and KashiField: the same sizes as .k-btn, .k-card and .k-field (measured against the web in test/metrics_test.dart)
  • The Kashi typeface, 9 weights, bundled (SIL OFL 1.1)
  • A Jalali date picker: showJalaliDatePicker, JalaliCalendar, JalaliDateField (weeks start on Saturday, Fridays and holidays in red)
  • Persian fields: NationalIdField, CardNumberField (bank name), IbanField, MobileField (operator), PostalCodeField, PriceField (amount in words)
  • Persian utilities: Jalali conversion and formatting, Persian digits, national ID, card (Luhn), IBAN (mod 97), mobile, postal code, number to words
flutter pub add kashi
flutter pub add flutter_localizations --sdk=flutter
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:kashi/kashi.dart';

void main() => runApp(MaterialApp(
      theme: KashiTheme.light(),
      darkTheme: KashiTheme.dark(),
      locale: const Locale('fa'),
      supportedLocales: const [Locale('fa'), Locale('en')],
      localizationsDelegates: GlobalMaterialLocalizations.delegates,
      home: Scaffold(
        body: ListView(padding: const EdgeInsets.all(16), children: [
          const NationalIdField(),
          const SizedBox(height: 16),
          CardNumberField(onChanged: print),
          const SizedBox(height: 16),
          JalaliDateField(label: 'تاریخ تولد', onChanged: print),
        ]),
      ),
    ));

Full guide (Persian): https://kashi.sepantapouya.com/docs/flutter/ · Example app: example/

lib/src/tokens.g.dart is generated from packages/tokens/src/tokens.js: run node tool/generate_tokens.mjs.

Libraries

kashi
Kashi for Flutter: Persian, RTL-first.