cliniqally_calendar 0.0.2 cliniqally_calendar: ^0.0.2 copied to clipboard
Cliniqally Calender .
Cliniqally calendar for the Cliniqally project #
Installation #
- Add the latest version of package to your pubspec.yaml (and run
dart pub get
):
dependencies:
cliniqally_calendar: ^0.0.1
- Import the package and use it in your Flutter App.
import 'package:cliniqally_calendar/cliniqally_calendar.dart';
Example #
There are a number of properties that you can modify:
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:cliniqally_calendar/cliniqally_calendar.dart';
class CalendarView extends StatefulWidget {
const CalendarView({Key? key}) : super(key: key);
@override
State<CalendarView> createState() => _CalendarViewState();
}
class _CalendarViewState extends State<CalendarView> {
var date = Date().day;
void changeDate(Date date) {
setState(() {
date = date;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Calendar View'),
),
body: SizedBox(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height / 2,
child: _buildCalendar(changeDate),
),
);
}
}
Widget _buildCalendar(Function(Date) changeDate) {
return Calendar(
weekendOpacityEnable: false,
previous: const CircleAvatar(
radius: 14,
backgroundColor: Colors.white,
child: Icon(
Icons.arrow_back_ios,
size: 16,
color: Color(0xff189AB4),
),
),
next: const CircleAvatar(
radius: 14,
backgroundColor: Colors.white,
child: Icon(
Icons.arrow_forward_ios,
size: 16,
color: Color(0xff189AB4),
),
),
space: 20,
onSelected: (value) => changeDate(value!),
backgroundColor: const Color.fromARGB(255, 255, 255, 255),
activeColor: const Color(0xff189AB4),
textStyleDays: TextStyle(
fontWeight: FontWeight.normal,
color: Colors.grey.shade800,
fontSize: 16),
textStyleWeekDay: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Color(0xff189AB4),
),
titleStyle: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20,
),
selectedStyle: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: Color.fromARGB(255, 255, 255, 255),
),
);
}