Skip to content

Commit

Permalink
✨ Update documentation comments.
Browse files Browse the repository at this point in the history
- Add pod files for example.
  • Loading branch information
ParthBaraiya committed Nov 23, 2022
1 parent a598535 commit edcb47b
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 16 deletions.
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
28 changes: 16 additions & 12 deletions lib/src/components/_internal_components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,13 @@ class PressDetector extends StatelessWidget {
/// Called when user long press on calendar.
final DatePressCallback? onDateLongPress;

/// Called when user taps on calendar.
/// 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
Expand Down Expand Up @@ -332,17 +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,
),
);
},
onTap: () => onDateTap?.call(
DateTime(
date.year,
date.month,
date.day,
0,
minuteSlotSize.minutes * i,
),
),
onLongPress: () => onDateLongPress?.call(
DateTime(
date.year,
Expand Down
8 changes: 7 additions & 1 deletion lib/src/day_view/_internal_day_view_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ class InternalDayViewPage<T extends Object?> extends StatelessWidget {
/// Called when user long press on calendar.
final DatePressCallback? onDateLongPress;

/// Called when user taps on calendar.
/// 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
Expand Down
8 changes: 7 additions & 1 deletion lib/src/day_view/day_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,13 @@ class DayView<T extends Object?> extends StatefulWidget {
/// This method will be called when user long press on calendar.
final DatePressCallback? onDateLongPress;

/// This method will be called when user taps on calendar.
/// 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
Expand Down
8 changes: 7 additions & 1 deletion lib/src/week_view/_internal_week_view_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,13 @@ class InternalWeekViewPage<T extends Object?> extends StatelessWidget {
/// Called when user long press on calendar.
final DatePressCallback? onDateLongPress;

/// Called when user taps on calendar.
/// 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
Expand Down
8 changes: 7 additions & 1 deletion lib/src/week_view/week_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,13 @@ class WeekView<T extends Object?> extends StatefulWidget {
/// This method will be called when user long press on calendar.
final DatePressCallback? onDateLongPress;

/// This method will be called when user press on calendar.
/// 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 the day from which the week starts.
Expand Down

0 comments on commit edcb47b

Please sign in to comment.