calendar_quarters_month_day 0.0.7 calendar_quarters_month_day: ^0.0.7 copied to clipboard
A Flutter package that supports choosing date intervals as quarters , months or day. Supported on both Android and iOS
import 'package:calendar_quarters_month_day/calendar_quarters_month_day.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({
super.key,
});
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: const Text(""),
),
body: Center(
child: CalendarQuartersMonthDay(
activeHeadingTextStyle: GoogleFonts.montserrat(
fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white),
inActiveHeadingTextStyle: GoogleFonts.montserrat(
fontSize: 12, fontWeight: FontWeight.w500, color: Colors.blue[400]),
textStyle:
GoogleFonts.montserrat(fontSize: 12, fontWeight: FontWeight.w500),
okTextStyle:
GoogleFonts.montserrat(fontSize: 12, fontWeight: FontWeight.w500),
cancelTextStyle:
GoogleFonts.montserrat(fontSize: 12, fontWeight: FontWeight.w500),
monthsTextStyle:
GoogleFonts.montserrat(fontSize: 12, fontWeight: FontWeight.w500),
quartersTextStyle:
GoogleFonts.montserrat(fontSize: 12, fontWeight: FontWeight.w500),
selectADateTextStyle:
GoogleFonts.montserrat(fontSize: 12, fontWeight: FontWeight.w500),
monthsYearHeadingTextStyle:
GoogleFonts.montserrat(fontSize: 12, fontWeight: FontWeight.w500),
quartersYearHeadingTextStyle:
GoogleFonts.montserrat(fontSize: 12, fontWeight: FontWeight.w500),
monthsBorderRadius: 5,
quartersBorderRadius: 5,
okText: "Done",
cancelText: "Cancel",
initialDate: DateTime.now(),
activeHeadingContainerColor: Colors.blue[400],
inActiveHeadingContainerColor: Colors.white,
monthsHeadingLeftIcon:
Icon(Icons.arrow_back_ios, color: Colors.blue[400]),
monthsHeadingRightIcon:
Icon(Icons.arrow_forward_ios, color: Colors.blue[400]),
locale: "en_US",
callbackFunction: (List<DateTime> dates) {
print(dates.first);
print(dates.last);
},
)),
);
}
}