persian_calendar_pro 0.1.0
persian_calendar_pro: ^0.1.0 copied to clipboard
A lightweight, zero-dependency Persian (Jalali) and Gregorian calendar for Flutter: scrollable views, single/range pickers, a standalone converter, and a fluent Builder configuration API.
import 'package:flutter/material.dart';
import 'screens/calendar_demo_screen.dart';
import 'screens/converter_demo_screen.dart';
void main() => runApp(const ExampleApp());
/// Demo application for persian_calendar_pro (Note 14: a visual test of every
/// feature — both systems, all scroll modes, single/range selection, theming,
/// localization, and the standalone converter).
class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'persian_calendar_pro',
debugShowCheckedModeBanner: false,
theme: ThemeData(colorSchemeSeed: Colors.indigo, useMaterial3: true),
home: const HomePage(),
);
}
}
/// Bottom-navigation host switching between the calendar and converter demos.
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
int _index = 0;
static const List<Widget> _pages = <Widget>[
CalendarDemoScreen(),
ConverterDemoScreen(),
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('persian_calendar_pro'),
centerTitle: true,
),
body: _pages[_index],
bottomNavigationBar: NavigationBar(
selectedIndex: _index,
onDestinationSelected: (i) => setState(() => _index = i),
destinations: const <NavigationDestination>[
NavigationDestination(
icon: Icon(Icons.calendar_month_outlined),
selectedIcon: Icon(Icons.calendar_month),
label: 'Calendar',
),
NavigationDestination(
icon: Icon(Icons.swap_horiz_outlined),
selectedIcon: Icon(Icons.swap_horiz),
label: 'Converter',
),
],
),
);
}
}