kashida 0.0.3 copy "kashida: ^0.0.3" to clipboard
kashida: ^0.0.3 copied to clipboard

Finding kashida (tatweel) insertion points and priorities, driven by a small pattern language.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:kashida_example/demo_state.dart';
import 'package:kashida_example/insert_page.dart';
import 'package:kashida_example/justify_page.dart';
import 'package:kashida_example/rules_page.dart';

void main() {
  runApp(const KashidaExampleApp());
}

class KashidaExampleApp extends StatelessWidget {
  const KashidaExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Kashida example',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: const Color(0xFF1B5E4B)),
        useMaterial3: true,
      ),
      home: const KashidaDemoPage(),
    );
  }
}

class KashidaDemoPage extends StatefulWidget {
  const KashidaDemoPage({super.key});

  @override
  State<KashidaDemoPage> createState() => _KashidaDemoPageState();
}

class _KashidaDemoPageState extends State<KashidaDemoPage> {
  final _demo = DemoController();
  int _index = 0;

  @override
  void dispose() {
    _demo.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return ListenableBuilder(
      listenable: _demo,
      builder: (context, _) {
        return Scaffold(
          appBar: AppBar(
            title: Text(switch (_index) {
              1 => 'Find and insert',
              2 => 'Pattern rules',
              _ => 'Justify',
            }),
          ),
          body: IndexedStack(
            index: _index,
            children: [
              JustifyPage(controller: _demo),
              InsertPage(controller: _demo),
              RulesPage(controller: _demo),
            ],
          ),
          bottomNavigationBar: NavigationBar(
            selectedIndex: _index,
            onDestinationSelected: (value) => setState(() => _index = value),
            destinations: const [
              NavigationDestination(
                icon: Icon(Icons.format_align_justify_outlined),
                selectedIcon: Icon(Icons.format_align_justify),
                label: 'Justify',
              ),
              NavigationDestination(
                icon: Icon(Icons.search_outlined),
                selectedIcon: Icon(Icons.search),
                label: 'Find & insert',
              ),
              NavigationDestination(
                icon: Icon(Icons.rule_outlined),
                selectedIcon: Icon(Icons.rule),
                label: 'Rules',
              ),
            ],
          ),
        );
      },
    );
  }
}
1
likes
0
points
233
downloads

Publisher

verified publisherbaselhadrous.com

Weekly Downloads

Finding kashida (tatweel) insertion points and priorities, driven by a small pattern language.

Repository (GitHub)
View/report issues

Topics

#arabic #rtl #i18n #text #unicode

License

unknown (license)

Dependencies

characters, flutter

More

Packages that depend on kashida