diff --git a/CHANGELOG.md b/CHANGELOG.md index 540af589..14e5cb70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 5c7f72a2..6ba5938a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,17 @@ -# 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) | | :------------: | :------------: | @@ -11,6 +19,7 @@ Highly customizable, feature-packed calendar widget for Flutter. ## 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 @@ -21,10 +30,30 @@ 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 @@ -32,13 +61,11 @@ 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. @@ -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. @@ -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 @@ -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: @@ -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. diff --git a/example/.gitignore b/example/.gitignore index b4e3d223..13e9ddcb 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -30,7 +30,6 @@ /build/ # Web related -lib/generated_plugin_registrant.dart # Symbolication related app.*.symbols diff --git a/example/lib/pages/basics_example.dart b/example/lib/pages/basics_example.dart index 6a8f91b6..75314d20 100644 --- a/example/lib/pages/basics_example.dart +++ b/example/lib/pages/basics_example.dart @@ -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'; diff --git a/example/lib/pages/complex_example.dart b/example/lib/pages/complex_example.dart index 61635b3c..ef18f455 100644 --- a/example/lib/pages/complex_example.dart +++ b/example/lib/pages/complex_example.dart @@ -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'; diff --git a/example/lib/pages/events_example.dart b/example/lib/pages/events_example.dart index ce00dca2..9099f7ae 100644 --- a/example/lib/pages/events_example.dart +++ b/example/lib/pages/events_example.dart @@ -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'; diff --git a/example/lib/pages/multi_example.dart b/example/lib/pages/multi_example.dart index 0be4a10d..61d06c94 100644 --- a/example/lib/pages/multi_example.dart +++ b/example/lib/pages/multi_example.dart @@ -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'; diff --git a/example/lib/pages/range_example.dart b/example/lib/pages/range_example.dart index 7cd7d771..90bee2df 100644 --- a/example/lib/pages/range_example.dart +++ b/example/lib/pages/range_example.dart @@ -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'; diff --git a/example/lib/utils.dart b/example/lib/utils.dart index c3f6e7d0..38272702 100644 --- a/example/lib/utils.dart +++ b/example/lib/utils.dart @@ -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 { diff --git a/example/pubspec.lock b/example/pubspec.lock index 9b2fbc34..bd8e10ad 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,42 +5,42 @@ packages: dependency: transitive description: name: async - sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.13.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.1" characters: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.3.0" clock: dependency: transitive description: name: clock - sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.1" collection: dependency: transitive description: name: collection - sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.19.1" + version: "1.19.0" cupertino_icons: dependency: "direct main" description: @@ -49,14 +49,21 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.8" + ensemble_table_calendar: + dependency: "direct main" + description: + path: ".." + relative: true + source: path + version: "3.1.0" fake_async: dependency: transitive description: name: fake_async - sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" url: "https://pub.dev" source: hosted - version: "1.3.3" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -79,18 +86,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: @@ -103,10 +110,10 @@ packages: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: @@ -119,18 +126,18 @@ packages: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.15.0" path: dependency: transitive description: name: path - sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.9.0" simple_gesture_detector: dependency: transitive description: @@ -148,57 +155,50 @@ packages: dependency: transitive description: name: source_span - sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.10.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.12.1" + version: "1.12.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.4.1" - table_calendar: - dependency: "direct main" - description: - path: ".." - relative: true - source: path - version: "3.0.9" + version: "1.3.0" term_glyph: dependency: transitive description: name: term_glyph - sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.3" vector_math: dependency: transitive description: @@ -211,10 +211,10 @@ packages: dependency: transitive description: name: vm_service - sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "15.0.0" + version: "14.3.0" sdks: - dart: ">=3.7.0-0 <4.0.0" + dart: ">=3.4.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index d72ead8a..84180042 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,5 +1,5 @@ -name: table_calendar_example -description: A short demo of table_calendar package. +name: ensemble_table_calendar_example +description: A short demo of ensemble_table_calendar package. # The following line prevents the package from being accidentally published to # pub.dev using `pub publish`. This is preferred for private packages. @@ -28,7 +28,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 - table_calendar: + ensemble_table_calendar: path: ../ dev_dependencies: diff --git a/lib/table_calendar.dart b/lib/ensemble_table_calendar.dart similarity index 100% rename from lib/table_calendar.dart rename to lib/ensemble_table_calendar.dart diff --git a/lib/src/customization/calendar_builders.dart b/lib/src/customization/calendar_builders.dart index 7bcfbdae..b7e466e7 100644 --- a/lib/src/customization/calendar_builders.dart +++ b/lib/src/customization/calendar_builders.dart @@ -1,10 +1,10 @@ // Copyright 2019 Aleksander Woźniak // SPDX-License-Identifier: Apache-2.0 -import 'package:flutter/widgets.dart'; -import 'package:table_calendar/table_calendar.dart'; +import 'package:flutter/material.dart'; -import '../shared/utils.dart' show DayBuilder, FocusedDayBuilder; +import '../shared/utils.dart' + show DayBuilder, FocusedDayBuilder, OverlayBuilder, OverlayDefaultBuilder; /// Signature for a function that creates a single event marker for a given `day`. /// Contains a single `event` associated with that `day`. diff --git a/lib/src/shared/utils.dart b/lib/src/shared/utils.dart index 78f8a6e3..3b145e4b 100644 --- a/lib/src/shared/utils.dart +++ b/lib/src/shared/utils.dart @@ -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/src/table_calendar.dart'; /// Signature for a function that creates a widget for a given `day`. typedef DayBuilder = Widget? Function(BuildContext context, DateTime day); diff --git a/lib/src/table_calendar_base.dart b/lib/src/table_calendar_base.dart index 6efb0f0a..a83d82c1 100644 --- a/lib/src/table_calendar_base.dart +++ b/lib/src/table_calendar_base.dart @@ -3,7 +3,8 @@ import 'package:flutter/material.dart'; import 'package:simple_gesture_detector/simple_gesture_detector.dart'; -import 'package:table_calendar/table_calendar.dart'; +import 'shared/utils.dart'; +import 'table_calendar.dart'; import 'widgets/calendar_core.dart'; diff --git a/lib/src/widgets/calendar_core.dart b/lib/src/widgets/calendar_core.dart index 5fd44b73..1b407226 100644 --- a/lib/src/widgets/calendar_core.dart +++ b/lib/src/widgets/calendar_core.dart @@ -2,7 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 import 'package:flutter/material.dart'; -import 'package:table_calendar/table_calendar.dart'; +import 'package:ensemble_table_calendar/src/shared/utils.dart'; +import 'package:ensemble_table_calendar/src/table_calendar.dart'; import 'calendar_page.dart'; diff --git a/lib/src/widgets/calendar_page.dart b/lib/src/widgets/calendar_page.dart index 27d2dffc..d1f36e97 100644 --- a/lib/src/widgets/calendar_page.dart +++ b/lib/src/widgets/calendar_page.dart @@ -5,8 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'dart:math' as math; -import 'package:table_calendar/table_calendar.dart'; -import 'package:collection/collection.dart'; +import 'package:ensemble_table_calendar/src/table_calendar.dart'; class CalendarPage extends StatelessWidget { final Widget Function(BuildContext context, CustomRange range)? diff --git a/pubspec.lock b/pubspec.lock index d0ea224f..8a9b8fc4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,50 +5,50 @@ packages: dependency: transitive description: name: async - sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.13.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.1" characters: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.3.0" clock: dependency: transitive description: name: clock - sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.1" collection: - dependency: transitive + dependency: "direct main" description: name: collection - sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf url: "https://pub.dev" source: hosted - version: "1.19.1" + version: "1.19.0" fake_async: dependency: transitive description: name: fake_async - sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" url: "https://pub.dev" source: hosted - version: "1.3.3" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -71,18 +71,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" url: "https://pub.dev" source: hosted - version: "10.0.9" + version: "10.0.7" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" url: "https://pub.dev" source: hosted - version: "3.0.9" + version: "3.0.8" leak_tracker_testing: dependency: transitive description: @@ -95,10 +95,10 @@ packages: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: @@ -111,18 +111,18 @@ packages: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.15.0" path: dependency: transitive description: name: path - sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.9.0" simple_gesture_detector: dependency: "direct main" description: @@ -140,50 +140,50 @@ packages: dependency: transitive description: name: source_span - sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.10.1" + version: "1.10.0" stack_trace: dependency: transitive description: name: stack_trace - sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" url: "https://pub.dev" source: hosted - version: "1.12.1" + version: "1.12.0" stream_channel: dependency: transitive description: name: stream_channel - sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.2" string_scanner: dependency: transitive description: name: string_scanner - sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.3.0" term_glyph: dependency: transitive description: name: term_glyph - sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.3" vector_math: dependency: transitive description: @@ -196,10 +196,10 @@ packages: dependency: transitive description: name: vm_service - sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b url: "https://pub.dev" source: hosted - version: "15.0.0" + version: "14.3.0" sdks: - dart: ">=3.7.0-0 <4.0.0" + dart: ">=3.4.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index 0b381f8b..206df4e2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,22 @@ -name: table_calendar -description: Highly customizable, feature-packed calendar widget for Flutter. -version: 3.0.9 -author: Aleksander Woźniak -homepage: https://github.com/aleksanderwozniak/table_calendar +name: ensemble_table_calendar +description: Highly customizable, feature-packed calendar widget for Flutter with enhanced overlay ranges, tooltips, and marking capabilities. A maintained fork with additional features. +version: 3.1.1 +# Remove deprecated author field - will use publishers in pub.dev +homepage: https://github.com/EnsembleUI/table_calendar +repository: https://github.com/EnsembleUI/table_calendar +issue_tracker: https://github.com/EnsembleUI/ensemble/issues +documentation: https://github.com/EnsembleUI/table_calendar#readme + +platforms: + android: + ios: + linux: + macos: + web: + windows: environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.12.0 <4.0.0" flutter: ">=1.17.0" dependencies: @@ -14,6 +25,7 @@ dependencies: intl: ">=0.18.1 <=0.20.2" simple_gesture_detector: ^0.2.0 + collection: ^1.15.0 dev_dependencies: flutter_test: diff --git a/test/calendar_header_test.dart b/test/calendar_header_test.dart index ad91c8af..be3b5d3d 100644 --- a/test/calendar_header_test.dart +++ b/test/calendar_header_test.dart @@ -4,11 +4,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:intl/intl.dart' as intl; -import 'package:table_calendar/src/customization/header_style.dart'; -import 'package:table_calendar/src/shared/utils.dart'; -import 'package:table_calendar/src/widgets/calendar_header.dart'; -import 'package:table_calendar/src/widgets/custom_icon_button.dart'; -import 'package:table_calendar/src/widgets/format_button.dart'; +import 'package:ensemble_table_calendar/src/customization/header_style.dart'; +import 'package:ensemble_table_calendar/src/shared/utils.dart'; +import 'package:ensemble_table_calendar/src/widgets/calendar_header.dart'; +import 'package:ensemble_table_calendar/src/widgets/custom_icon_button.dart'; +import 'package:ensemble_table_calendar/src/widgets/format_button.dart'; import 'common.dart'; diff --git a/test/calendar_page_test.dart b/test/calendar_page_test.dart index c7009c99..f02029db 100644 --- a/test/calendar_page_test.dart +++ b/test/calendar_page_test.dart @@ -4,7 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:table_calendar/src/widgets/calendar_page.dart'; +import 'package:ensemble_table_calendar/src/widgets/calendar_page.dart'; Widget setupTestWidget(Widget child) { return Directionality( @@ -114,9 +114,17 @@ void main() { ), ); + // CalendarPage itself uses a Column, so we should expect at least 1 + // The main test is that week number specific widgets are not present expect( find.byType(Column), - findsNWidgets(0), + findsAtLeastNWidgets(1), + ); + + // Week numbers should not be visible when weekNumberVisible is false (default) + expect( + find.text('Week'), + findsNothing, ); }, ); diff --git a/test/cell_content_test.dart b/test/cell_content_test.dart index d3d8ccd0..ea0c1680 100644 --- a/test/cell_content_test.dart +++ b/test/cell_content_test.dart @@ -1,10 +1,10 @@ // Copyright 2019 Aleksander Woźniak // SPDX-License-Identifier: Apache-2.0 -import 'package:flutter/widgets.dart'; +import 'package:flutter/material.dart'; +import 'package:ensemble_table_calendar/src/widgets/cell_content.dart'; +import 'package:ensemble_table_calendar/ensemble_table_calendar.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:table_calendar/src/widgets/cell_content.dart'; -import 'package:table_calendar/table_calendar.dart'; Widget setupTestWidget( DateTime cellDay, { diff --git a/test/common.dart b/test/common.dart index e351cea2..89bc07f8 100644 --- a/test/common.dart +++ b/test/common.dart @@ -1,8 +1,8 @@ // Copyright 2019 Aleksander Woźniak // SPDX-License-Identifier: Apache-2.0 -import 'package:flutter/foundation.dart'; -import 'package:table_calendar/src/shared/utils.dart'; +import 'package:flutter/material.dart'; +import 'package:ensemble_table_calendar/src/shared/utils.dart'; ValueKey dateToKey(DateTime date, {String prefix = ''}) { return ValueKey('$prefix${date.year}-${date.month}-${date.day}'); diff --git a/test/custom_icon_button_test.dart b/test/custom_icon_button_test.dart index b608f978..d6a5bdc0 100644 --- a/test/custom_icon_button_test.dart +++ b/test/custom_icon_button_test.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:table_calendar/src/widgets/custom_icon_button.dart'; +import 'package:ensemble_table_calendar/src/widgets/custom_icon_button.dart'; Widget setupTestWidget(Widget child) { return Directionality( diff --git a/test/format_button_test.dart b/test/format_button_test.dart index d562260d..6d93ea47 100644 --- a/test/format_button_test.dart +++ b/test/format_button_test.dart @@ -3,8 +3,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:table_calendar/src/widgets/format_button.dart'; -import 'package:table_calendar/table_calendar.dart'; +import 'package:ensemble_table_calendar/src/widgets/format_button.dart'; +import 'package:ensemble_table_calendar/ensemble_table_calendar.dart'; import 'common.dart'; diff --git a/test/table_calendar_base_test.dart b/test/table_calendar_base_test.dart index 4076a540..833354bc 100644 --- a/test/table_calendar_base_test.dart +++ b/test/table_calendar_base_test.dart @@ -2,10 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:simple_gesture_detector/simple_gesture_detector.dart'; -import 'package:table_calendar/table_calendar.dart'; +import 'package:ensemble_table_calendar/ensemble_table_calendar.dart'; import 'common.dart'; diff --git a/test/table_calendar_test.dart b/test/table_calendar_test.dart index 3361255b..53e3a9a9 100644 --- a/test/table_calendar_test.dart +++ b/test/table_calendar_test.dart @@ -4,10 +4,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:intl/intl.dart' as intl; -import 'package:table_calendar/src/widgets/calendar_header.dart'; -import 'package:table_calendar/src/widgets/cell_content.dart'; -import 'package:table_calendar/src/widgets/custom_icon_button.dart'; -import 'package:table_calendar/table_calendar.dart'; +import 'package:ensemble_table_calendar/src/widgets/calendar_header.dart'; +import 'package:ensemble_table_calendar/src/widgets/cell_content.dart'; +import 'package:ensemble_table_calendar/src/widgets/custom_icon_button.dart'; +import 'package:ensemble_table_calendar/ensemble_table_calendar.dart'; import 'common.dart'; diff --git a/test/utils_test.dart b/test/utils_test.dart index 472c0afb..2b3d4bfd 100644 --- a/test/utils_test.dart +++ b/test/utils_test.dart @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import 'package:flutter_test/flutter_test.dart'; -import 'package:table_calendar/src/shared/utils.dart'; +import 'package:ensemble_table_calendar/src/shared/utils.dart'; void main() { group('isSameDay() tests:', () {