Skip to content

Commit

Permalink
Merge pull request #11 from dhwanish-3/test
Browse files Browse the repository at this point in the history
Assets + readme with proper documentation
  • Loading branch information
dhwanish-3 authored Feb 4, 2024
2 parents 43be6c8 + 835470f commit f5162ad
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 40 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@
## 0.0.2
* Test release
* Added example project with demo

## 0.0.3
* Full calendar default scroll is horizontal
* Date tile alignment is fixed
* Many other color customization
* Better example project with two demos
* readme with proper documentation and visual representation
52 changes: 28 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,56 +28,60 @@ import 'package:calendar_slider/calendar_slider.dart';

SelectedDayPosition.center | SelectedDayPosition.Left | SelectedDayPosition.Right
:-------------------------:|:-------------------------:|:-------------------------:
![](https://github.com/sud0su/calendar_agenda/blob/main/assets/selectedDayCenter.png?raw=true) | ![](https://github.com/sud0su/calendar_agenda/blob/main/assets/selectedDayLeft.png?raw=true) | ![](https://github.com/sud0su/calendar_agenda/blob/main/assets/selectedDayRight.png?raw=true)
![](assets/position_centre.png) | ![](assets/position_left.png) | ![](assets/position_right.png)

FullCalendarScroll.vertical | FullCalendarScroll.horizontal
:-------------------------:|:-------------------------:
![](https://github.com/sud0su/calendar_agenda/blob/main/assets/FullCalendarScrollVertical.png?raw=true) | ![](https://github.com/sud0su/calendar_agenda/blob/main/assets/FullCalendarScrollHorizontal.png?raw=true)
![](assets/full_calendar_vertical.jpg) | ![](assets/full_calendar_horizontal.jpg)


### Demo

![](https://github.com/sud0su/calendar_agenda/blob/main/assets/demo.gif?raw=true)
![Demo](assets/demo.gif)

# How to use?

Use the **CalendarAgenda** Widget
```dart
CalendarAgenda(
initialDate: DateTime.now(),
firstDate: DateTime.now().subtract(Duration(days: 140)),
lastDate: DateTime.now().add(Duration(days: 4)),
onDateSelected: (date) {
print(date);
},
initialDate: DateTime.now(),
firstDate: DateTime.now().subtract(Duration(days: 140)),
lastDate: DateTime.now().add(Duration(days: 4)),
onDateSelected: (date) {
print(date);
},
)
```

# Props

| Props | Types | Required | defaultValues |
| ------------ | ------------ | ------------ | ------------ |
| initialDate | DateTime | True | |
| firstDate | DateTime | True | |
| lastDate | DateTime | True | |
| onDateSelected | Funtion | False | |
| backgroundColor | Color? | False | |
| selectedDayLogo | ImageProvider\<Object>? | False | |
| controller | CalendarAgendaController? | False | |
| initialDate | DateTime | True |
| firstDate | DateTime | True |
| lastDate | DateTime | True |
| onDateSelected | Funtion | False |
| controller | CalendarAgendaController? | False |
| backgroundColor | Color? | False | Colors.transparent |
| tileHeight | double? | False | 60.0 |
| selectedTileHeight | double? | False | 75.0 |
| dateColor | Color? | False | Colors.black |
| selectedDateColor | Color? | False | Colors.black |
| dateColor | Color? | False | Colors.white |
| calendarBackground | Color? | False |Colors.white |
| tileShadow | BoxShadow? | False | BoxShadow(color: Colors.black.withOpacity(0.13),spreadRadius: 1,blurRadius: 2,offset: const Offset(0, 2),), |
| tileBackgroundColor | Color? | False | Colors.white |
| selectedTileBackgroundColor | Color? | False | Colors.blue |
| monthYearTextColor | Color? | False | Colors.black |
| monthYearButtonBackgroundColor | Color? | False | Colors.grey |
| calendarEventSelectedColor | Color? | False | Colors.white |
| calendarEventColor | Color? | False | Colors.blue |
| fullCalendarBackgroundImage | DecorationImage? | False | null |
| locale | String? | False | 'en' |
| leading | Widget? | False | |
| appbar | bool | False | False |
| events | List\<DateTime>? | False | |
| events | List\<DateTime>? | False | [] |
| fullCalendar | bool | False | True |
| fullCalendarScroll | FullCalendarScroll | False |FullCalendarScroll.vertical |
| fullCalendarDay | WeekDay | False | WeekDay.short |
| fullCalendarScroll | FullCalendarScroll | False |FullCalendarScroll.horizontal |
| weekDay | WeekDay | False | WeekDay.short |
| selectedDayPosition | SelectedDayPosition | False | SelectedDayPosition.left |
| fullCalendarWeekDay | WeekDay | False | WeekDay.short |
| selectedDayPosition | SelectedDayPosition | False | SelectedDayPosition.center |

---

Expand Down
Binary file added assets/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/full_calendar_horizontal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/full_calendar_vertical.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/full_page.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/position_centre.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/position_left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/position_right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class _ExamplePageState extends State<ExamplePage> {
),
CalendarSlider(
controller: _secondController,
selectedDayPosition: SelectedDayPosition.right,
selectedDayPosition: SelectedDayPosition.center,
locale: 'en',
selectedDateColor: Colors.black,
initialDate: DateTime.now(),
Expand Down
22 changes: 7 additions & 15 deletions lib/src/calendar_slider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ class CalendarSlider extends StatefulWidget implements PreferredSizeWidget {
onDateSelected; // function to be called when a date is selected

final double selectedTileHeight; // height of the selected date tile
final double? selectedTileWidth; // width of the selected date tile
final double tileHeight; // height of the date tile
final double? tileWidth; // width of the date tile

final Color? monthYearTextColor; // color of the month year text
final Color? backgroundColor; // background color for the entire widget
Expand All @@ -49,7 +47,6 @@ class CalendarSlider extends StatefulWidget implements PreferredSizeWidget {
final Color?
monthYearButtonBackgroundColor; // background color of the month year button on top
final Color? dateColor; // color of the date on each tile
final Color? calendarBackground; // unknown
final Color?
calendarEventSelectedColor; // color of the event on the selected date
final Color? calendarEventColor; // color of the event on the date
Expand All @@ -60,7 +57,6 @@ class CalendarSlider extends StatefulWidget implements PreferredSizeWidget {
final String? locale; // locale of the calendar
final bool? fullCalendar; // if the full calendar is enabled
final WeekDay? fullCalendarWeekDay;
final double? padding; // padding of the slider
final WeekDay
weekDay; // format of the week day (long or short)("Monday" or "Mon")
final List<DateTime>? events; // list of events
Expand All @@ -71,30 +67,26 @@ class CalendarSlider extends StatefulWidget implements PreferredSizeWidget {
required this.firstDate,
required this.lastDate,
required this.onDateSelected,
this.selectedTileHeight = 75.0,
this.tileHeight = 60.0,
this.selectedTileWidth,
this.tileWidth,
this.monthYearTextColor = Colors.white,
this.backgroundColor = Colors.transparent,
this.controller,
this.backgroundColor = Colors.transparent,
this.tileHeight = 60.0,
this.selectedTileHeight = 75.0,
this.dateColor = Colors.black,
this.selectedDateColor = Colors.black,
this.tileShadow,
this.tileBackgroundColor = Colors.white,
this.selectedTileBackgroundColor = Colors.blue,
this.monthYearTextColor = Colors.white,
this.monthYearButtonBackgroundColor = Colors.grey,
this.dateColor = Colors.black,
this.calendarBackground = Colors.yellow,
this.calendarEventSelectedColor = Colors.white,
this.calendarEventColor = Colors.blue,
this.fullCalendarBackgroundImage,
this.locale = 'en',
this.padding,
this.events,
this.fullCalendar = true,
this.fullCalendarScroll = FullCalendarScroll.horizontal,
this.fullCalendarWeekDay = WeekDay.short,
this.weekDay = WeekDay.short,
this.fullCalendarWeekDay = WeekDay.short,
this.selectedDayPosition = SelectedDayPosition.center,
}) : assert(
initialDate.difference(firstDate).inDays >= 0,
Expand Down Expand Up @@ -138,7 +130,7 @@ class CalendarSliderState extends State<CalendarSlider>
super.initState();
initializeDateFormatting(_locale);
_initCalendar();
padding = widget.padding ?? 25.0;
padding = 25.0;
if (widget.selectedDayPosition == SelectedDayPosition.center) {
_initialScrollAlignment = 0.44;
_scrollAlignment = 0.42;
Expand Down

0 comments on commit f5162ad

Please sign in to comment.