thai_buddhist_date_pickers 0.1.2 copy "thai_buddhist_date_pickers: ^0.1.2" to clipboard
thai_buddhist_date_pickers: ^0.1.2 copied to clipboard

Flutter calendar and pickers (dialog/fullscreen, range, multi) for Thai Buddhist (พ.ศ.) and Gregorian (ค.ศ.), built on thai_buddhist_date.

thai_buddhist_date_pickers #

pub package

Flutter calendar and pickers for Thai Buddhist (พ.ศ.) and Gregorian (ค.ศ.), distributed separately from the core thai_buddhist_date package.

  • Month calendar header formats with BE/CE.
  • Dialog pickers: single date, date-time (with preview), range, multi-date.
  • Fullscreen single-date picker.
  • Theming knobs for dialog shape/padding.

Install #

dependencies:
  thai_buddhist_date_pickers: ^0.1.1
  thai_buddhist_date: ^0.2.2

Usage #

import 'package:thai_buddhist_date_pickers/thai_buddhist_date_pickers.dart';
import 'package:thai_buddhist_date/thai_buddhist_date.dart' as tbd;

final picked = await showThaiDatePicker(context, era: tbd.Era.be, locale: 'th_TH');

Initialize Thai locale once if you want localized month/weekday names:

await tbd.ThaiCalendar.ensureInitialized();

Example #

A minimal example app is included under example/.

// example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:thai_buddhist_date_pickers/thai_buddhist_date_pickers.dart';
import 'package:thai_buddhist_date/thai_buddhist_date.dart' as tbd;

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await tbd.ThaiCalendar.ensureInitialized();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Thai Pickers Example')),
        body: Center(
          child: Builder(
            builder: (ctx) => ElevatedButton(
              onPressed: () async {
                final d = await showThaiDatePicker(
                  ctx,
                  initialDate: DateTime.now(),
                  era: tbd.Era.be,
                  locale: 'th_TH',
                );
                ScaffoldMessenger.of(ctx).showSnackBar(
                  SnackBar(content: Text('Picked: \\${d ?? '-'}')),
                );
              },
              child: const Text('Pick a date (พ.ศ.)'),
            ),
          ),
        ),
      ),
    );
  }
}
3
likes
0
points
12
downloads

Publisher

verified publisherkidpech.app

Weekly Downloads

Flutter calendar and pickers (dialog/fullscreen, range, multi) for Thai Buddhist (พ.ศ.) and Gregorian (ค.ศ.), built on thai_buddhist_date.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, thai_buddhist_date

More

Packages that depend on thai_buddhist_date_pickers