Skip to main content

kashi 0.1.0 copy "kashi: ^0.1.0" to clipboard
kashi: ^0.1.0 copied to clipboard

Kashi for Flutter: the Persian, RTL-first design system. Material themes from Kashi's tokens, the Kashi typeface, a Jalali date picker and Persian fields (national ID, card, IBAN, mobile, price).

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.

0
likes
130
points
152
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Kashi for Flutter: the Persian, RTL-first design system. Material themes from Kashi's tokens, the Kashi typeface, a Jalali date picker and Persian fields (national ID, card, IBAN, mobile, price).

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#persian #rtl #design-system #jalali #farsi

License

MIT (license)

Dependencies

flutter

More

Packages that depend on kashi