kosher_dart 2.0.17 copy "kosher_dart: ^2.0.17" to clipboard
kosher_dart: ^2.0.17 copied to clipboard

This Plugin for a specialized calendar that can calculate different astronomical times for Jewish zmanim or religious times for prayers and other Jewish religious duties.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:intl/intl.dart';
import 'package:kosher_dart/kosher_dart.dart';

void main() => runApp(MaterialApp(
      debugShowCheckedModeBanner: false,
      home: MyApp(),
    ));

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  JewishDate jewishDate = JewishDate();
  JewishCalendar jewishCalendar = JewishCalendar();
  HebrewDateFormatter hebrewDateFormatter = HebrewDateFormatter();
  HebrewDateFormatter translatedDateFormatter = HebrewDateFormatter()
    ..hebrewFormat = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Kosher Dart'),
      ),
      body: GestureDetector(
        onTap: () async {
          DateTime? pickedDate = await showDatePicker(
            context: context,
            initialDate: jewishCalendar.getGregorianCalendar(),
            firstDate: DateTime(jewishCalendar.getGregorianYear() - 100),
            lastDate: DateTime(jewishCalendar.getGregorianYear() + 100),
          );

          if (pickedDate != null) {
            setState(() {
              jewishCalendar.setDate(pickedDate);
              jewishDate.setDate(pickedDate);
            });
          }
        },
        child: Container(
          width: double.infinity,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text(' תאריך לעוזי: ' +
                  DateFormat("dd.MM.yyyy")
                      .format(jewishDate.getGregorianCalendar())),
              Text('תאריך עברי: ' + hebrewDateFormatter.format(jewishDate)),
              Text('פרשת השבוע: ' +
                  hebrewDateFormatter.formatWeeklyParsha(jewishCalendar)),
              Text('Translated Hebrew Date: ' +
                  translatedDateFormatter.format(jewishDate)),
              Text('Cloned Translated Hebrew Date: ' +
                  translatedDateFormatter.format(jewishDate.clone())),
              Text('Parasha of the week: ' +
                  translatedDateFormatter.formatWeeklyParsha(jewishCalendar)),
            ],
          ),
        ),
      ),
    );
  }

  @override
  void initState() {
    hebrewDateFormatter.hebrewFormat = true;
    hebrewDateFormatter.useGershGershayim = true;
    super.initState();
  }
}
22
likes
140
pub points
76%
popularity

Publisher

verified publisherbeninsapps.com

This Plugin for a specialized calendar that can calculate different astronomical times for Jewish zmanim or religious times for prayers and other Jewish religious duties.

Repository (GitHub)
View/report issues

Documentation

API reference

License

LGPL-2.1 (license)

Dependencies

intl, pedantic, vector_math

More

Packages that depend on kosher_dart