kashi 0.1.0
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), pluscontext.kashifor the semantic colorsKashiButton,KashiCardandKashiField: the same sizes as.k-btn,.k-cardand.k-field(measured against the web intest/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.