diff --git a/CHANGELOG.md b/CHANGELOG.md index ada2eae..05c1f92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [1.3.21] ++ Support intl >= 0.15.7 < 0.17.0 to inclease `pub` health ++ Removed deprecated methods ~~`markedDates`~~, ~~`markedDateColor`~~ ## [1.3.20] + Support intl >= 0.15.7 ## [1.3.19] diff --git a/README.md b/README.md index fb4b38e..7de3a3d 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,7 @@ For help getting started with Flutter, view our online | headerTextStyle | `TextStyle` | `fontSize: 20.0, color: Colors.blue` | | headerText | `Text` | `Text('${DateFormat.yMMM().format(this._dates[1])}'`) | | weekendTextStyle | `TextStyle` | `fontSize: 14.0, color: Colors.pinkAccent` | -| ~~markedDates~~ | `List`| [] | | markedDatesMap | `Events` | `null` | -| markedDateColor | `Color` | Colors.blueAccent | | markedDateWidget | `Color` | ``` Positioned(child: Container(color: Colors.blueAccent, height: 4.0, width: 4.0), bottom: 4.0, left: 18.0); ``` | | markedDateShowIcon | `bool` | false | | markedDateIconBorderColor | `Color` | | @@ -108,7 +106,6 @@ Widget widget() { // headerText: Container( /// Example for rendering custom header // child: Text('Custom Header'), // ), -// markedDates: _markedDate, weekFormat: false, markedDatesMap: _markedDateMap, height: 420.0, @@ -136,5 +133,4 @@ Widget widget() { I've been maintaining quite many repos these days and burning out slowly. If you could help me cheer up, buying me a cup of coffee will make my life really happy and get much energy out of it.
Buy Me A Coffee -
[![Paypal](https://www.paypalobjects.com/webstatic/mktg/Logo/pp-logo-100px.png)](https://paypal.me/dooboolab) diff --git a/example/pubspec.lock b/example/pubspec.lock index 06d91cd..fd9d590 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -82,7 +82,7 @@ packages: path: ".." relative: true source: path - version: "1.3.20" + version: "1.3.22" flutter_test: dependency: "direct dev" description: flutter diff --git a/lib/classes/event.dart b/lib/classes/event.dart index f111889..caab523 100644 --- a/lib/classes/event.dart +++ b/lib/classes/event.dart @@ -8,9 +8,12 @@ class Event { Event({this.date, this.title, this.icon}) : assert(date != null); @override - bool operator ==(other) { + bool operator ==(dynamic other) { return this.date == other.date && this.title == other.title && this.icon == other.icon; } + + @override + int get hashCode => hashValues(date, title, icon); } diff --git a/lib/flutter_calendar_carousel.dart b/lib/flutter_calendar_carousel.dart index 95c4f46..bc996e3 100644 --- a/lib/flutter_calendar_carousel.dart +++ b/lib/flutter_calendar_carousel.dart @@ -40,9 +40,7 @@ class CalendarCarousel extends StatefulWidget { final TextStyle headerTextStyle; final Widget headerText; final TextStyle weekendTextStyle; - final List markedDates; final EventList markedDatesMap; - final Color markedDateColor; final Widget markedDateWidget; final bool markedDateShowIcon; final Color markedDateIconBorderColor; @@ -108,9 +106,7 @@ class CalendarCarousel extends StatefulWidget { this.headerTextStyle, this.headerText, this.weekendTextStyle, - @deprecated this.markedDates, this.markedDatesMap, - @deprecated this.markedDateColor, this.markedDateShowIcon = false, this.markedDateIconBorderColor, this.markedDateIconMaxShown = 2, @@ -431,9 +427,11 @@ class _CalendarState extends State> { : defaultInactiveWeekendTextStyle) : isToday ? defaultTodayTextStyle - : isSelectable - ? defaultTextStyle - : defaultInactiveDaysTextStyle, + : isSelectable && textStyle != null + ? textStyle + : defaultTextStyle != null + ? defaultTextStyle + : defaultInactiveDaysTextStyle, child: Text( '${now.day}', style: (_localeDate.dateSymbols.WEEKENDRANGE @@ -464,7 +462,7 @@ class _CalendarState extends State> { ), widget.markedDatesMap != null ? _renderMarkedMapContainer(now) - : _renderMarked(now), + : Container(), ], ), ), @@ -624,7 +622,9 @@ class _CalendarState extends State> { : defaultInactiveWeekendTextStyle) : isToday ? defaultTodayTextStyle - : defaultTextStyle, + : textStyle != null + ? textStyle + : defaultTextStyle, child: Text( '${now.day}', style: (index % 7 == 0 || index % 7 == 6) && @@ -642,7 +642,7 @@ class _CalendarState extends State> { ), widget.markedDatesMap != null ? _renderMarkedMapContainer(now) - : _renderMarked(now), + : Container(), ], ), ), @@ -820,20 +820,6 @@ class _CalendarState extends State> { } } - Widget _renderMarked(DateTime now) { - if (widget.markedDates != null && widget.markedDates.length > 0) { - List markedDates = widget.markedDates.map((date) { - return DateTime(date.year, date.month, date.day); - }).toList(); - if (markedDates.contains(now)) { - return widget.markedDateWidget != null - ? widget.markedDateWidget - : defaultMarkedDateWidget; - } - } - return Container(); - } - Widget _renderMarkedMapContainer(DateTime now) { if (widget.markedDateShowIcon) { return Stack( diff --git a/pubspec.yaml b/pubspec.yaml index 0214551..e338ecf 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_calendar_carousel description: Calendar widget for flutter that is swipeable. This widget can help you build customizable calendar with scrollable actions. -version: 1.3.20 +version: 1.3.22 author: dooboolab homepage: https://github.com/dooboolab/flutter_calendar_carousel @@ -8,7 +8,7 @@ environment: sdk: ">=2.0.0-dev.68.0 <3.0.0" dependencies: - intl: ">=0.15.7" + intl: ">=0.15.7 <0.17.0" flutter: sdk: flutter date_utils: ^0.1.0 diff --git a/test/flutter_calendar_carousel_test.dart b/test/flutter_calendar_carousel_test.dart index d399a77..1eb5ba0 100644 --- a/test/flutter_calendar_carousel_test.dart +++ b/test/flutter_calendar_carousel_test.dart @@ -1,6 +1,6 @@ //import 'package:test/test.dart'; -import 'package:flutter_calendar_carousel/flutter_calendar_carousel.dart'; +// import 'package:flutter_calendar_carousel/flutter_calendar_carousel.dart'; void main() { // test('adds one to input values', () { diff --git a/test/src/header_test.dart b/test/src/header_test.dart index 03256e1..c0e6f78 100644 --- a/test/src/header_test.dart +++ b/test/src/header_test.dart @@ -47,7 +47,13 @@ void main() { }); testWidgets('Verify No header Renders', (WidgetTester tester) async { - final noHeaderEmpty = CalendarHeader(showHeader: false); + final noHeaderEmpty = CalendarHeader( + showHeader: false, + headerTitle: null, + onLeftButtonPressed: () {}, + onHeaderTitlePressed: () {}, + onRightButtonPressed: () {}, + ); await tester.pumpWidget(Container(child: noHeaderEmpty));