Skip to content

Commit

Permalink
Merge pull request #139 from SimformSolutionsPvtLtd/develop
Browse files Browse the repository at this point in the history
Fixed issue and feature for next release
  • Loading branch information
PRBaraiya authored Nov 25, 2022
2 parents ae25c1b + 91a8a53 commit 8ae3edd
Show file tree
Hide file tree
Showing 23 changed files with 452 additions and 231 deletions.
63 changes: 42 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# [1.0.1 - 25 Nov 2022](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/tree/1.0.1)
- Added
Feature [#26 - Support for locale](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/26)
- Added removeWhere method in `EventController` to conditionally remove multiple events. (Fixes
Issue [#31](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/31))
- Added customization in calendar views and
closes [#34](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/34).
- Added Customizations in `DayView`. Adds `dateStringBuilder`, `timeStringBuilder`, `headerStyle`
parameters in `Dayview`,
- Added Customizations in `MonthView`. Adds `headerStringBuilder`, `dateStringBuilder`
, `weekDayStringBuilder`, `headerStyle` parameters in `WeekView`.
- Added Customizations in `WeekView`. Adds `headerStyle`, `headerStringBuilder`
, `timeLineStringBuilder`, `weekDayStringBuilder`, `weekDayDateStringBuilder` parameters
in `WeekView`,
- Added onTap lister in day and week views. issue #50.
- Updates calculation of day difference. issue #80, #97.
- Fixed
Issue [#93 - Showing only 1 day in DayView](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/93)
- Fixed
Issue [#130 - Week view incorrectly displays events when a day contains overlapping events](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/130)

# [1.0.0 - 12 Aug 2022](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/tree/1.0.0)

- **Breaking Changes**
Expand All @@ -6,56 +27,56 @@
Note: This changes the behaviour of comparing two events using `==` operator. Please test your
app properly after updating to this version.

- Add 15,30 and 60 minutes slots for `onDateLongPress` callback in Week and Day view.
- Add method to update filter in `EventController`.
- Added 15,30 and 60 minutes slots for `onDateLongPress` callback in Week and Day view.
- Added method to update filter in `EventController`.
- Restructured the logic to store single time events.
- Add method to scroll to an event.
- Added method to scroll to an event.
Issue [#30 - Scroll to an event in day view](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/30)
- Added
feature [#36 - Feature/custom strings](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/pull/36)
Feature [#36 - Feature/custom strings](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/pull/36)
- Use normalized dates in difference calculations.

# [0.0.5 - 2 Jun 2022](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/tree/0.0.5)

- Fixed
issue [#48 - WeekView header date is different from the calendar view](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/48)
Issue [#48 - WeekView header date is different from the calendar view](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/48)
- Added
feature [#46 - Change beginning of week in MonthView](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/46)
Feature [#46 - Change beginning of week in MonthView](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/46)
- Fixed
issue [#42 - WeekDayTile causes RenderFlex-Overflow](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/42)
Issue [#42 - WeekDayTile causes RenderFlex-Overflow](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/42)
- Fixed
issue [#65 - Adding onCellTap callback breaks whole calendar](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/65)
Issue [#65 - Adding onCellTap callback breaks whole calendar](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/65)
- Fixed
issue [#62 - Missing redraw events](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/62)
Issue [#62 - Missing redraw events](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/62)
- Fixed
issue [#16 - Scroll to index/liveTime](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/16)
Issue [#16 - Scroll to index/liveTime](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/16)
- Show live time indicator line above event tiles.
PR [#67](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/pull/67)

# [0.0.4 - 2 Mar 2022](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/tree/0.0.4)

- Fixed
issue [#39 - Detect a long press on the calendar](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/39)
Issue [#39 - Detect a long press on the calendar](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/39)
- Fixed
issue [#38 - Modifying CalendarEventData](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/38)
Issue [#38 - Modifying CalendarEventData](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/38)
- Fixed
issue [#27 - EventController remove event don't work](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/27)
Issue [#27 - EventController remove event don't work](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/27)
- Fixed
issue [#13 - Give the option to show weekdays in a WeekView.](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/13)
Issue [#13 - Give the option to show weekdays in a WeekView.](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/13)

# [0.0.3 - 12 Oct 2021](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/tree/0.0.3)

- Added support for multiple day events

# [0.0.2 - 3 Sep 2021](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/tree/0.0.2)

- Update `README.md` file.
- Add license information in package files.
- Update project description in `pubspec.yaml`
- Update documentation.
- Add `CalendarControllerProvider`.
- Add `onEventTap` callback in `WeekView` and `DayView`.
- Add `onCellTap` callback in `MonthView`.
- Updated `README.md` file.
- Added license information in package files.
- Updated project description in `pubspec.yaml`
- Updated documentation.
- Added `CalendarControllerProvider`.
- Added `onEventTap` callback in `WeekView` and `DayView`.
- Added `onCellTap` callback in `MonthView`.
- Make `controller` optional parameter in all views where `CalendarControllerProvider` is provided.

# [0.0.1 - 26 Aug 2021](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/tree/0.0.1)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ Above code will create `WeekView` with only five days, from monday to friday.
<td align="center"><a href="https://github.com/sanket-simform"><img src="https://avatars.githubusercontent.com/u/65167856?v=4" width="100px;" alt=""/><br /><sub><b>Sanket Kachhela</b></sub></a></td>
<td align="center"><a href="https://github.com/ParthBaraiya"><img src="https://avatars.githubusercontent.com/u/36261739?v=4" width="100px;" alt=""/><br /><sub><b>Parth Baraiya</b></sub></a></td>
<td align="center"><a href="https://github.com/ujas-m-simformsolutions"><img src="https://avatars.githubusercontent.com/u/76939001?v=4" width="100px;" alt=""/><br /><sub><b>Ujas Majithiya</b></sub></a></td>
<td align="center"><a href="https://github.com/AnkitPanchal10"><img src="https://avatars.githubusercontent.com/u/38405884?s=100" width="100px;" alt=""/><br /><sub><b>Ankit Panchal</b></sub></a></td>
<td align="center"><a href="https://github.com/AnkitPanchal10"><img src="https://avatars.githubusercontent.com/u/38405884?s=100" width="100px;" alt=""/><br /><sub><b>Ankit Panchal</b></sub></a></td>
<td align="center"><a href="https://github.com/MehulKK"><img src="https://avatars.githubusercontent.com/u/60209725?s=100" width="100px;" alt=""/><br /><sub><b>Mehul Kabaria</b></sub></a></td>
<td align="center"><a href="https://github.com/faiyaz-shaikh"><img src="https://avatars.githubusercontent.com/u/89002539?v=4" width="100px;" alt=""/><br /><sub><b>Faiyaz Shaikh</b></sub></a></td>
</tr>
</table>
<br/>
Expand Down
1 change: 1 addition & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:exported="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
Expand Down
41 changes: 41 additions & 0 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
40 changes: 40 additions & 0 deletions example/macos/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
platform :osx, '10.11'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
1 change: 1 addition & 0 deletions lib/calendar_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ export './src/event_controller.dart';
export './src/extensions.dart';
export './src/modals.dart';
export './src/month_view/month_view.dart';
export './src/style/header_style.dart';
export './src/typedefs.dart';
export './src/week_view/week_view.dart';
23 changes: 21 additions & 2 deletions lib/src/components/_internal_components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ class EventGenerator<T extends Object?> extends StatelessWidget {
events[index].top,
width - events[index].right - events[index].left,
height - events[index].bottom - events[index].top),
events[index].startDuration ?? DateTime.now(),
events[index].endDuration ?? DateTime.now(),
events[index].startDuration,
events[index].endDuration,
);
}),
),
Expand Down Expand Up @@ -295,6 +295,15 @@ class PressDetector extends StatelessWidget {
/// Called when user long press on calendar.
final DatePressCallback? onDateLongPress;

/// Called when user taps on day view page.
///
/// This callback will have a date parameter which
/// will provide the time span on which user has tapped.
///
/// Ex, User Taps on Date page with date 11/01/2022 and time span is 1PM to 2PM.
/// then DateTime object will be DateTime(2022,01,11,1,0)
final DateTapCallback? onDateTap;

/// Defines size of the slots that provides long press callback on area
/// where events are not available.
final MinuteSlotSize minuteSlotSize;
Expand All @@ -307,6 +316,7 @@ class PressDetector extends StatelessWidget {
required this.heightPerMinute,
required this.date,
required this.onDateLongPress,
required this.onDateTap,
required this.minuteSlotSize,
}) : super(key: key);

Expand All @@ -328,6 +338,15 @@ class PressDetector extends StatelessWidget {
bottom: height - (heightPerSlot * (i + 1)),
child: GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () => onDateTap?.call(
DateTime(
date.year,
date.month,
date.day,
0,
minuteSlotSize.minutes * i,
),
),
onLongPress: () => onDateLongPress?.call(
DateTime(
date.year,
Expand Down
85 changes: 48 additions & 37 deletions lib/src/components/common_components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import '../constants.dart';
import '../style/header_style.dart';
import '../typedefs.dart';

class CalendarPageHeader extends StatelessWidget {
Expand All @@ -29,14 +30,18 @@ class CalendarPageHeader extends StatelessWidget {
/// Provides string to display as title.
final StringProvider dateStringBuilder;

/// backgeound color of header.
// TODO: Need to remove after next release
/// background color of header.
@Deprecated("Use Header Style to provide background")
final Color backgroundColor;

// TODO: Need to remove after next release
/// Color of icons at both sides of header.
@Deprecated("Use Header Style to provide icon color")
final Color iconColor;

/// Style of title.
final TextStyle? textStyle;
/// Style for Calendar's header
final HeaderStyle headerStyle;

/// Common header for month and day view In this header user can define format
/// in which date will be displayed by providing [dateStringBuilder] function.
Expand All @@ -48,59 +53,65 @@ class CalendarPageHeader extends StatelessWidget {
this.onTitleTapped,
this.onPreviousDay,
this.secondaryDate,
this.backgroundColor = Constants.headerBackground,
this.iconColor = Constants.black,
this.textStyle,
@Deprecated("Use Header Style to provide background")
this.backgroundColor = Constants.headerBackground,
@Deprecated("Use Header Style to provide icon color")
this.iconColor = Constants.black,
this.headerStyle = const HeaderStyle(),
}) : super(key: key);

@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: backgroundColor,
),
margin: headerStyle.headerMargin,
padding: headerStyle.headerPadding,
decoration:
// ignore_for_file: deprecated_member_use_from_same_package
headerStyle.decoration ?? BoxDecoration(color: backgroundColor),
clipBehavior: Clip.antiAlias,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
IconButton(
onPressed: onPreviousDay,
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
padding:
const EdgeInsets.symmetric(horizontal: 10.0, vertical: 10.0),
icon: Icon(
Icons.chevron_left,
size: 30,
color: iconColor,
if (headerStyle.leftIconVisible)
IconButton(
onPressed: onPreviousDay,
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
padding: headerStyle.leftIconPadding,
icon: headerStyle.leftIcon ??
Icon(
Icons.chevron_left,
size: 30,
color: iconColor,
),
),
),
Expanded(
child: InkWell(
onTap: onTitleTapped,
child: Text(
dateStringBuilder(date, secondaryDate: secondaryDate),
textAlign: TextAlign.center,
style: textStyle,
textAlign: headerStyle.titleAlign,
style: headerStyle.headerTextStyle,
),
),
),
IconButton(
onPressed: onNextDay,
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
padding:
const EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
icon: Icon(
Icons.chevron_right,
size: 30,
color: iconColor,
if (headerStyle.rightIconVisible)
IconButton(
onPressed: onNextDay,
splashColor: Colors.transparent,
focusColor: Colors.transparent,
hoverColor: Colors.transparent,
highlightColor: Colors.transparent,
padding: headerStyle.rightIconPadding,
icon: headerStyle.rightIcon ??
Icon(
Icons.chevron_right,
size: 30,
color: iconColor,
),
),
),
],
),
);
Expand Down
Loading

0 comments on commit 8ae3edd

Please sign in to comment.