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

Flutter package for easy integration of Persian (Jalali) calendar widgets. Customize appearance, filter dates, and simplify date selection.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_persian_calendar/flutter_persian_calendar.dart';
import 'package:shamsi_date/shamsi_date.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        fontFamily: 'Vazirmatn',
      ),
      home: const MyHomePage(
        title: 'Flutter Persian Calendar',
      ),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  Jalali selectedDate = Jalali(1360, 1, 1);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const Text(
              'Persian Calendar Widgets',
              style: TextStyle(
                fontSize: 20,
                fontWeight: FontWeight.bold,
              ),
            ),
            const SizedBox(height: 16),
            Text(
              'selected Date: $selectedText',
            ),
            const SizedBox(height: 16),
            PersianCalendar(
              initialDate: selectedDate,
              onDateChanged: (value) => setState(() => selectedDate = value),
            ),
          ],
        ),
      ),
    );
  }

  String get selectedText =>
      '${selectedDate.year}/${selectedDate.month}/${selectedDate.day}';
}
copied to clipboard
22
likes
160
points
50
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.29 - 2025.04.13

Flutter package for easy integration of Persian (Jalali) calendar widgets. Customize appearance, filter dates, and simplify date selection.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, shamsi_date

More

Packages that depend on flutter_persian_calendar