Skip to content

Commit

Permalink
Merge 3abc431 into d9ff769
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Sep 14, 2019
2 parents d9ff769 + 3abc431 commit 143e1d5
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 34 deletions.
3 changes: 3 additions & 0 deletions 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]
Expand Down
4 changes: 0 additions & 4 deletions README.md
Expand Up @@ -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<DateTime>`| [] |
| 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` | |
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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.
<br/>
<a href="https://www.buymeacoffee.com/dooboolab" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/purple_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>
<br/>
[![Paypal](https://www.paypalobjects.com/webstatic/mktg/Logo/pp-logo-100px.png)](https://paypal.me/dooboolab)
2 changes: 1 addition & 1 deletion example/pubspec.lock
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion lib/classes/event.dart
Expand Up @@ -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);
}
34 changes: 10 additions & 24 deletions lib/flutter_calendar_carousel.dart
Expand Up @@ -40,9 +40,7 @@ class CalendarCarousel<T> extends StatefulWidget {
final TextStyle headerTextStyle;
final Widget headerText;
final TextStyle weekendTextStyle;
final List<DateTime> markedDates;
final EventList<T> markedDatesMap;
final Color markedDateColor;
final Widget markedDateWidget;
final bool markedDateShowIcon;
final Color markedDateIconBorderColor;
Expand Down Expand Up @@ -108,9 +106,7 @@ class CalendarCarousel<T> extends StatefulWidget {
this.headerTextStyle,
this.headerText,
this.weekendTextStyle,
@deprecated this.markedDates,
this.markedDatesMap,
@deprecated this.markedDateColor,
this.markedDateShowIcon = false,
this.markedDateIconBorderColor,
this.markedDateIconMaxShown = 2,
Expand Down Expand Up @@ -431,9 +427,11 @@ class _CalendarState<T> extends State<CalendarCarousel<T>> {
: defaultInactiveWeekendTextStyle)
: isToday
? defaultTodayTextStyle
: isSelectable
? defaultTextStyle
: defaultInactiveDaysTextStyle,
: isSelectable && textStyle != null
? textStyle
: defaultTextStyle != null
? defaultTextStyle
: defaultInactiveDaysTextStyle,
child: Text(
'${now.day}',
style: (_localeDate.dateSymbols.WEEKENDRANGE
Expand Down Expand Up @@ -464,7 +462,7 @@ class _CalendarState<T> extends State<CalendarCarousel<T>> {
),
widget.markedDatesMap != null
? _renderMarkedMapContainer(now)
: _renderMarked(now),
: Container(),
],
),
),
Expand Down Expand Up @@ -624,7 +622,9 @@ class _CalendarState<T> extends State<CalendarCarousel<T>> {
: defaultInactiveWeekendTextStyle)
: isToday
? defaultTodayTextStyle
: defaultTextStyle,
: textStyle != null
? textStyle
: defaultTextStyle,
child: Text(
'${now.day}',
style: (index % 7 == 0 || index % 7 == 6) &&
Expand All @@ -642,7 +642,7 @@ class _CalendarState<T> extends State<CalendarCarousel<T>> {
),
widget.markedDatesMap != null
? _renderMarkedMapContainer(now)
: _renderMarked(now),
: Container(),
],
),
),
Expand Down Expand Up @@ -820,20 +820,6 @@ class _CalendarState<T> extends State<CalendarCarousel<T>> {
}
}

Widget _renderMarked(DateTime now) {
if (widget.markedDates != null && widget.markedDates.length > 0) {
List<DateTime> 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(
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
@@ -1,14 +1,14 @@
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<dooboolab@gmail.com>
homepage: https://github.com/dooboolab/flutter_calendar_carousel

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
Expand Down
2 changes: 1 addition & 1 deletion 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', () {
Expand Down
8 changes: 7 additions & 1 deletion test/src/header_test.dart
Expand Up @@ -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));

Expand Down

0 comments on commit 143e1d5

Please sign in to comment.