Skip to content

Commit

Permalink
Include github workflow (#294)
Browse files Browse the repository at this point in the history
* Include github workflow

* Run flutter format

* Change CI badges
  • Loading branch information
hyochan committed Nov 14, 2021
1 parent 79e4487 commit 0fa2717
Show file tree
Hide file tree
Showing 5 changed files with 226 additions and 186 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Flutter CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: "14.x"

- uses: subosito/flutter-action@v1
with:
channel: "stable"
flutter-version: "2.x"

- run: flutter pub get

- run: flutter format --set-exit-if-changed .

# - run: flutter analyze .

- run: flutter test --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage/lcov.info

# - run: flutter build apk

# Upload generated apk to the artifacts.
# - uses: actions/upload-artifact@v1
# with:
# name: release-apk
# path: build/app/outputs/apk/release/app-release.apk
153 changes: 83 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,107 +1,118 @@
# flutter_calendar_carousel

[![Pub Version](https://img.shields.io/pub/v/flutter_calendar_carousel.svg?style=flat-square)](https://pub.dartlang.org/packages/flutter_calendar_carousel)
[![Build Status](https://travis-ci.com/dooboolab/flutter_calendar_carousel.svg?branch=master)](https://travis-ci.com/dooboolab/flutter_calendar_carousel)
[![Flutter CI](https://github.com/dooboolab/flutter_calendar_carousel/actions/workflows/ci.yml/badge.svg)](https://github.com/dooboolab/flutter_calendar_carousel/actions/workflows/ci.yml)
[![Coverage Status](https://codecov.io/gh/dooboolab/flutter_calendar_carousel/branch/master/graph/badge.svg?token=KTrSs3fGsS)](https://codecov.io/gh/dooboolab/flutter_calendar_carousel)
![License](https://img.shields.io/badge/license-MIT-blue.svg)
[![Coverage Status](https://coveralls.io/repos/github/dooboolab/flutter_calendar_carousel/badge.svg?branch=master)](https://coveralls.io/github/dooboolab/flutter_calendar_carousel?branch=master)

Calendar widget for flutter that is swipeable horizontally. This widget can help you build your own calendar widget highly customizable. Now you can even add your icon for each event.

## New Feature

[2.0.3]
+ Multiple days selection using `addRange` method [#285](https://github.com/dooboolab/flutter_calendar_carousel/pull/285)

+ Check out great feature `customDayBuilder` work done by [maxgmer](https://github.com/maxgmer) :tada:.
- Multiple days selection using `addRange` method [#285](https://github.com/dooboolab/flutter_calendar_carousel/pull/285)

- Check out great feature `customDayBuilder` work done by [maxgmer](https://github.com/maxgmer) :tada:.

#### Rectangular style

![image](https://raw.githubusercontent.com/dooboolab/flutter_calendar_carousel/master/doc/calendar1.gif)

#### Circular style

![image](https://raw.githubusercontent.com/dooboolab/flutter_calendar_carousel/master/doc/calendar2.gif)

#### No border

![image](https://raw.githubusercontent.com/dooboolab/flutter_calendar_carousel/master/doc/calendar3.gif)

#### Marked Dates

![image](https://raw.githubusercontent.com/dooboolab/flutter_calendar_carousel/master/doc/calendar4.gif)

#### Custom Icon Events

![image](https://raw.githubusercontent.com/icemanbsi/flutter_calendar_carousel/master/doc/calendar5.gif)

## Getting Started

For help getting started with Flutter, view our online
[documentation](https://flutter.io/).

## Props
| props | types | defaultValues |
| :---------------------- | :-------------: | :---------------------------------------------------------------------------------------------------------------: |
| viewPortFraction | `double` | 1.0 |
| prevDaysTextStyle | `TextStyle` | |
| daysTextStyle | `TextStyle` | |
| nextDaysTextStyle | `TextStyle` | |
| prevMonthDayBorderColor | `Color` | Colors.transparent |
| thisMonthDayBorderColor | `Color` | Colors.transparent |
| nextMonthDayBorderColor | `Color` | Colors.transparent |
| dayPadding | `double` | 2.0 |
| height | `double` | double.infinity |
| width | `double` | double.infinity |
| todayTextStyle | `TextStyle` | `fontSize: 14.0, color: Colors.white` |
| dayButtonColor | `Color` | Colors.red |
| todayBorderColor | `Color` | Colors.red |
| todayButtonColor | `Colors` | Colors.red |
| selectedDateTime | `DateTime` | |
| selectedDayTextStyle | `TextStyle` | `fontSize: 14.0, color: Colors.white` |
| selectedDayBorderColor | `Color` | Colors.green |
| selectedDayButtonColor | `Color` | Colors.green |
| daysHaveCircularBorder | `bool` | |
| onDayPressed | `Func` | |
| weekdayTextStyle | `TextStyle` | `fontSize: 14.0, color: Colors.deepOrange` |
| iconColor | `Color` | Colors.blueAccent |
| 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` |
| markedDatesMap | `Events` | `null` |
| markedDateWidget | `Widget` | ``` Positioned(child: Container(color: Colors.blueAccent, height: 4.0, width: 4.0), bottom: 4.0, left: 18.0); ``` |
| markedDateShowIcon | `bool` | false |
| markedDateIconBorderColor | `Color` | |
| markedDateIconMaxShown | `int` | 2 |
| markedDateIconMargin | `double` | 5.0 |
| markedDateIconBuilder | `MarkedDateIconBuilder<T>` | |
| markedDateIconOffset | `double` | 5.0 |
| markedDateCustomShapeBorder | `ShapeBorder` | null |
| markedDateCustomTextStyle | `TextStyle` | null |
| markedDateMoreCustomDecoration | `Decoration` | |
| markedDateMoreCustomTextStyle | `TextStyle` | |
| headerMargin | `EdgetInsets` | `const EdgeInsets.symmetric(vertical: 16.0)` |
| headerTitleTouchable | `bool` | `false` |
| onHeaderTitlePressed | `Function` | `() => _selectDateFromPicker()` |
| showHeader | `bool` | |
| showHeaderButton | `bool` | |
| childAspectRatio | `double` | `1.0` |
| weekDayMargin | `EdgeInsets` | `const EdgeInsets.only(bottom: 4.0)` |
| weekFormat | `bool` | `false` |
| locale | `String` | `en` |
| firstDayOfWeek | `int` | `null` |
| onCalendarChanged | `Function(DateTime)` | |
| minSelectedDate | `DateTime` | |
| maxSelectedDate | `DateTime` | |
| inactiveDaysTextStyle | `TextStyle` | |
| inactiveWeekendTextStyle | `TextStyle` | |
| weekDayFormat | `WeekdayFormat` | `short` |
| staticSixWeekFormat | `bool` | `false` |
| showOnlyCurrentMonthDate | `bool` | `false` |
| dayCrossAxisAlignment | `CrossAxisAlignment` | `CrossAxisAlignment.center` |
| dayMainAxisAlignment | `MainAxisAlignment` | `CrossAlignment.center` |
| showIconBehindDayText | `bool` | `false` |
| pageScrollPhysics | `ScrollPhysics` | `ScrollPhysics` |

With ``CalendarCarousel<YourEventClass>`` and ``EventList<YourEventClass>`` you can specifiy a custom Event class.

| props | types | defaultValues |
| :----------------------------- | :------------------------: | :---------------------------------------------------------------------------------------------------------: |
| viewPortFraction | `double` | 1.0 |
| prevDaysTextStyle | `TextStyle` | |
| daysTextStyle | `TextStyle` | |
| nextDaysTextStyle | `TextStyle` | |
| prevMonthDayBorderColor | `Color` | Colors.transparent |
| thisMonthDayBorderColor | `Color` | Colors.transparent |
| nextMonthDayBorderColor | `Color` | Colors.transparent |
| dayPadding | `double` | 2.0 |
| height | `double` | double.infinity |
| width | `double` | double.infinity |
| todayTextStyle | `TextStyle` | `fontSize: 14.0, color: Colors.white` |
| dayButtonColor | `Color` | Colors.red |
| todayBorderColor | `Color` | Colors.red |
| todayButtonColor | `Colors` | Colors.red |
| selectedDateTime | `DateTime` | |
| selectedDayTextStyle | `TextStyle` | `fontSize: 14.0, color: Colors.white` |
| selectedDayBorderColor | `Color` | Colors.green |
| selectedDayButtonColor | `Color` | Colors.green |
| daysHaveCircularBorder | `bool` | |
| onDayPressed | `Func` | |
| weekdayTextStyle | `TextStyle` | `fontSize: 14.0, color: Colors.deepOrange` |
| iconColor | `Color` | Colors.blueAccent |
| 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` |
| markedDatesMap | `Events` | `null` |
| markedDateWidget | `Widget` | `Positioned(child: Container(color: Colors.blueAccent, height: 4.0, width: 4.0), bottom: 4.0, left: 18.0);` |
| markedDateShowIcon | `bool` | false |
| markedDateIconBorderColor | `Color` | |
| markedDateIconMaxShown | `int` | 2 |
| markedDateIconMargin | `double` | 5.0 |
| markedDateIconBuilder | `MarkedDateIconBuilder<T>` | |
| markedDateIconOffset | `double` | 5.0 |
| markedDateCustomShapeBorder | `ShapeBorder` | null |
| markedDateCustomTextStyle | `TextStyle` | null |
| markedDateMoreCustomDecoration | `Decoration` | |
| markedDateMoreCustomTextStyle | `TextStyle` | |
| headerMargin | `EdgetInsets` | `const EdgeInsets.symmetric(vertical: 16.0)` |
| headerTitleTouchable | `bool` | `false` |
| onHeaderTitlePressed | `Function` | `() => _selectDateFromPicker()` |
| showHeader | `bool` | |
| showHeaderButton | `bool` | |
| childAspectRatio | `double` | `1.0` |
| weekDayMargin | `EdgeInsets` | `const EdgeInsets.only(bottom: 4.0)` |
| weekFormat | `bool` | `false` |
| locale | `String` | `en` |
| firstDayOfWeek | `int` | `null` |
| onCalendarChanged | `Function(DateTime)` | |
| minSelectedDate | `DateTime` | |
| maxSelectedDate | `DateTime` | |
| inactiveDaysTextStyle | `TextStyle` | |
| inactiveWeekendTextStyle | `TextStyle` | |
| weekDayFormat | `WeekdayFormat` | `short` |
| staticSixWeekFormat | `bool` | `false` |
| showOnlyCurrentMonthDate | `bool` | `false` |
| dayCrossAxisAlignment | `CrossAxisAlignment` | `CrossAxisAlignment.center` |
| dayMainAxisAlignment | `MainAxisAlignment` | `CrossAlignment.center` |
| showIconBehindDayText | `bool` | `false` |
| pageScrollPhysics | `ScrollPhysics` | `ScrollPhysics` |

With `CalendarCarousel<YourEventClass>` and `EventList<YourEventClass>` you can specifiy a custom Event class.

## Install
Add ```flutter_calendar_carousel``` as a dependency in pubspec.yaml

Add `flutter_calendar_carousel` as a dependency in pubspec.yaml
For help on adding as a dependency, view the [documentation](https://flutter.io/using-packages/).

## Usage

```dart
import 'package:flutter_calendar_carousel/flutter_calendar_carousel.dart' show CalendarCarousel;
Widget widget() {
Expand Down Expand Up @@ -153,6 +164,7 @@ Widget widget() {
```

### TODO

- [x] Render weekdays.
- [x] Customizable headerWidget.
- [x] Set weekdays visibility.
Expand All @@ -162,10 +174,11 @@ Widget widget() {
- [x] Customizable weekend days.
- [x] Week Calendar.
- [x] Carousel Week Calendar.
- [ ] Multiple days selections.
- [x] Widget test.
- [ ] Multiple days selections.
- [x] Widget test.

## Help Maintenance

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>
Expand Down
5 changes: 0 additions & 5 deletions lib/classes/marked_date.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,13 @@ class MarkedDate implements MarkedDateInterface {
@override
Color getColor() => this.color;


@override
TextStyle? getTextStyle() => this.textStyle;
}




abstract class MarkedDateInterface {
DateTime getDate();
Color getColor();
int? getId();
TextStyle? getTextStyle();

}
Loading

0 comments on commit 0fa2717

Please sign in to comment.