Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@

## [3.1.1]

* **FIX**: Corrected URLs in pubspec.yaml to use correct case for EnsembleUI

## [3.1.0] - Fork Release

* **BREAKING**: Package renamed from `table_calendar` to `ensemble_table_calendar`
* **NEW**: Added CustomRange support with overlay functionality
* **NEW**: Added tooltip support with customizable styling and positioning
* **NEW**: Added `markedDayPredicate` for enhanced day marking capabilities
* **NEW**: Added `rowSpanLimit` for better row control
* **NEW**: Added `topMargin` property for layout customization
* **NEW**: Added overlay builders (`overlayBuilder`, `overlayDefaultBuilder`)
* **IMPROVED**: Enhanced SDK version constraint to support newer Flutter versions
* **IMPROVED**: Added collection dependency for better compatibility
* **IMPROVED**: Comprehensive documentation and examples for new features
* This is a maintained fork of the original table_calendar package with additional features and regular updates

## [3.0.9]

* Updated intl version to 0.18.0
Expand Down
135 changes: 111 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
# TableCalendar
# Ensemble TableCalendar

[![Pub Package](https://img.shields.io/pub/v/table_calendar.svg?style=flat-square)](https://pub.dartlang.org/packages/table_calendar)
[![Pub Package](https://img.shields.io/pub/v/ensemble_table_calendar.svg?style=flat-square)](https://pub.dartlang.org/packages/ensemble_table_calendar)
[![Awesome Flutter](https://img.shields.io/badge/Awesome-Flutter-52bdeb.svg?longCache=true&style=flat-square)](https://github.com/Solido/awesome-flutter)

Highly customizable, feature-packed calendar widget for Flutter.
A highly customizable, feature-packed calendar widget for Flutter with enhanced functionality. This is a maintained fork of the original `table_calendar` package with additional features including overlay ranges, tooltips, and enhanced marking capabilities.

## ⭐ New Features in Plus Version

- **CustomRange Support**: Display custom overlay ranges on the calendar with ID and row ID support
- **Tooltip Functionality**: Add tooltips to calendar days with customizable styling
- **Enhanced Marking**: Advanced day marking capabilities with `markedDayPredicate`
- **Row Span Control**: Additional control over calendar row spanning
- **Maintained Updates**: Regular updates and bug fixes for the latest Flutter versions

| ![Image](https://raw.githubusercontent.com/aleksanderwozniak/table_calendar/assets/table_calendar_styles.gif) | ![Image](https://raw.githubusercontent.com/aleksanderwozniak/table_calendar/assets/table_calendar_builders.gif) |
| :------------: | :------------: |
| **TableCalendar** with custom styles | **TableCalendar** with custom builders |

## Features

* All original table_calendar features plus enhanced functionality
* Extensive, yet easy to use API
* Preconfigured UI with customizable styling
* Custom selective builders for unlimited UI design
Expand All @@ -21,24 +30,42 @@ Highly customizable, feature-packed calendar widget for Flutter.
* Vertical autosizing - fit the content, or fill the viewport
* Multiple calendar formats (month, two weeks, week)
* Horizontal swipe boundaries (first day, last day)
* **NEW**: Custom overlay ranges with ID support
* **NEW**: Tooltip functionality with customizable styling
* **NEW**: Enhanced day marking capabilities

## Migration from table_calendar

If you're migrating from the original `table_calendar` package, simply update your `pubspec.yaml`:

```yaml
dependencies:
ensemble_table_calendar: ^3.1.0 # instead of table_calendar
```

Then update your imports:

```dart
import 'package:ensemble_table_calendar/ensemble_table_calendar.dart'; // instead of package:table_calendar/table_calendar.dart
```

All existing APIs remain compatible, with additional features available as optional parameters.

## Usage

Make sure to check out [examples](https://github.com/aleksanderwozniak/table_calendar/tree/master/example/lib/pages) and [API docs](https://pub.dev/documentation/table_calendar/latest/) for more details.
Make sure to check out the [examples](https://github.com/ensembleUI/table_calendar/tree/master/example/lib/pages) for more details.

### Installation

Add the following line to `pubspec.yaml`:

```yaml
dependencies:
table_calendar: ^3.0.9
ensemble_table_calendar: ^3.1.0
```

### Basic setup

*The complete example is available [here](https://github.com/aleksanderwozniak/table_calendar/blob/master/example/lib/pages/basics_example.dart).*

**TableCalendar** requires you to provide `firstDay`, `lastDay` and `focusedDay`:
* `firstDay` is the first available day for the calendar. Users will not be able to access days before it.
* `lastDay` is the last available day for the calendar. Users will not be able to access days after it.
Expand All @@ -52,6 +79,68 @@ TableCalendar(
);
```

### New Features Usage

#### Custom Overlay Ranges

```dart
TableCalendar(
firstDay: DateTime.utc(2010, 10, 16),
lastDay: DateTime.utc(2030, 3, 14),
focusedDay: DateTime.now(),
overlayRanges: [
CustomRange(
id: 'vacation',
start: DateTime.now(),
end: DateTime.now().add(Duration(days: 7)),
rowId: 1,
),
],
calendarBuilders: CalendarBuilders(
overlayBuilder: (context, range) {
return Container(
decoration: BoxDecoration(
color: Colors.blue.withOpacity(0.3),
borderRadius: BorderRadius.circular(8),
),
child: Center(
child: Text(range.id),
),
);
},
),
);
```

#### Tooltip Support

```dart
TableCalendar(
firstDay: DateTime.utc(2010, 10, 16),
lastDay: DateTime.utc(2030, 3, 14),
focusedDay: DateTime.now(),
showTooltip: true,
toolTip: 'Custom tooltip text',
toolTipDate: DateTime.now(),
toolTipStyle: TextStyle(color: Colors.white),
toolTipBackgroundColor: Colors.black87,
);
```

#### Enhanced Day Marking

```dart
TableCalendar(
firstDay: DateTime.utc(2010, 10, 16),
lastDay: DateTime.utc(2030, 3, 14),
focusedDay: DateTime.now(),
markedDayPredicate: (day) {
// Mark specific days with custom logic
return day.weekday == DateTime.friday;
},
);
```

#### Adding interactivity

You will surely notice that previously set up calendar widget isn't quite interactive - you can only swipe it horizontally, to change the currently visible month. While it may be sufficient in certain situations, you can easily bring it to life by specifying a couple of callbacks.
Expand Down Expand Up @@ -97,12 +186,8 @@ onPageChanged: (focusedDay) {

It is worth noting that you don't need to call `setState()` inside `onPageChanged()` callback. You should just update the stored value, so that if the widget gets rebuilt later on, it will use the proper `focusedDay`.

*The complete example is available [here](https://github.com/aleksanderwozniak/table_calendar/blob/master/example/lib/pages/basics_example.dart). You can find other examples [here](https://github.com/aleksanderwozniak/table_calendar/tree/master/example/lib/pages).*

### Events

*The complete example is available [here](https://github.com/aleksanderwozniak/table_calendar/blob/master/example/lib/pages/events_example.dart).*

You can supply custom events to **TableCalendar** widget. To do so, use `eventLoader` property - you will be given a `DateTime` object, to which you need to assign a list of events.

```dart
Expand Down Expand Up @@ -160,11 +245,9 @@ void _onDaySelected(DateTime selectedDay, DateTime focusedDay) {
}
```

*The complete example is available [here](https://github.com/aleksanderwozniak/table_calendar/blob/master/example/lib/pages/events_example.dart).*

### Custom UI with CalendarBuilders

To customize the UI with your own widgets, use [CalendarBuilders](https://pub.dev/documentation/table_calendar/latest/table_calendar/CalendarBuilders-class.html). Each builder can be used to selectively override the UI, allowing you to implement highly specific designs with minimal hassle.
To customize the UI with your own widgets, use [CalendarBuilders](https://pub.dev/documentation/table_calendar_plus/latest/table_calendar_plus/CalendarBuilders-class.html). Each builder can be used to selectively override the UI, allowing you to implement highly specific designs with minimal hassle.

You can return `null` from any builder to use the default style. For example, the following snippet will override only the Sunday's day of the week label (Sun), leaving other dow labels unchanged:

Expand Down Expand Up @@ -206,24 +289,28 @@ void main() {
}
```

After those two steps your app should be ready to use **TableCalendar** with different languages.
#### Specifying locale

#### Specifying a language

To specify a language, simply pass it as a String code to `locale` property.

For example, this will make **TableCalendar** use Polish language:
To specify a locale, simply pass it to `TableCalendar`'s constructor:

```dart
TableCalendar(
locale: 'pl_PL',
// ...
),
```

| ![Image](https://raw.githubusercontent.com/aleksanderwozniak/table_calendar/assets/en_US.png) | ![Image](https://raw.githubusercontent.com/aleksanderwozniak/table_calendar/assets/pl_PL.png) | ![Image](https://raw.githubusercontent.com/aleksanderwozniak/table_calendar/assets/fr_FR.png) | ![Image](https://raw.githubusercontent.com/aleksanderwozniak/table_calendar/assets/zh_CN.png) |
| :------------: | :------------: | :------------: | :------------: |
| `'en_US'` | `'pl_PL'` | `'fr_FR'` | `'zh_CN'` |
| **en_US** | **pl_PL** | **fr_FR** | **zh_CN** |

## Original Credits

This package is a maintained fork of the original [table_calendar](https://github.com/aleksanderwozniak/table_calendar) created by Aleksander Woźniak. We extend our gratitude to the original author and contributors for their excellent work.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Note, that if you want to change the language of `FormatButton`'s text, you have to do this yourself. Use `availableCalendarFormats` property and pass the translated Strings there. Use i18n method of your choice.
## License

You can also hide the button altogether by setting `formatButtonVisible` to false.
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
1 change: 0 additions & 1 deletion example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols
Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/basics_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import 'package:flutter/material.dart';
import 'package:table_calendar/table_calendar.dart';
import 'package:ensemble_table_calendar/ensemble_table_calendar.dart';

import '../utils.dart';

Expand Down
4 changes: 3 additions & 1 deletion example/lib/pages/complex_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import 'dart:collection';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:ensemble_table_calendar/ensemble_table_calendar.dart';
import 'package:intl/intl.dart';
import 'package:table_calendar/table_calendar.dart';

import '../utils.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/events_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import 'package:flutter/material.dart';
import 'package:table_calendar/table_calendar.dart';
import 'package:ensemble_table_calendar/ensemble_table_calendar.dart';

import '../utils.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/multi_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import 'dart:collection';

import 'package:flutter/material.dart';
import 'package:table_calendar/table_calendar.dart';
import 'package:ensemble_table_calendar/ensemble_table_calendar.dart';

import '../utils.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/pages/range_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import 'package:flutter/material.dart';
import 'package:table_calendar/table_calendar.dart';
import 'package:ensemble_table_calendar/ensemble_table_calendar.dart';

import '../utils.dart';

Expand Down
2 changes: 1 addition & 1 deletion example/lib/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import 'dart:collection';

import 'package:table_calendar/table_calendar.dart';
import 'package:ensemble_table_calendar/ensemble_table_calendar.dart';

/// Example event class.
class Event {
Expand Down
Loading