Skip to content

Commit c8a99ce

Browse files
committed
fix semantics
1 parent a94b73d commit c8a99ce

14 files changed

Lines changed: 301 additions & 68 deletions

File tree

example/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*.swp
66
.DS_Store
77
.atom/
8+
.build/
89
.buildlog/
910
.history
1011
.svn/
12+
.swiftpm/
1113
migrate_working_dir/
1214

1315
# IntelliJ related

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,5 @@
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
23-
<key>MinimumOSVersion</key>
24-
<string>12.0</string>
2523
</dict>
2624
</plist>

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@
275275
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
276276
GCC_WARN_UNUSED_FUNCTION = YES;
277277
GCC_WARN_UNUSED_VARIABLE = YES;
278-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
278+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
279279
MTL_ENABLE_DEBUG_INFO = NO;
280280
SDKROOT = iphoneos;
281281
SUPPORTED_PLATFORMS = iphoneos;
@@ -353,7 +353,7 @@
353353
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
354354
GCC_WARN_UNUSED_FUNCTION = YES;
355355
GCC_WARN_UNUSED_VARIABLE = YES;
356-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
356+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
357357
MTL_ENABLE_DEBUG_INFO = YES;
358358
ONLY_ACTIVE_ARCH = YES;
359359
SDKROOT = iphoneos;
@@ -402,7 +402,7 @@
402402
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
403403
GCC_WARN_UNUSED_FUNCTION = YES;
404404
GCC_WARN_UNUSED_VARIABLE = YES;
405-
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
405+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
406406
MTL_ENABLE_DEBUG_INFO = NO;
407407
SDKROOT = iphoneos;
408408
SUPPORTED_PLATFORMS = iphoneos;

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<MacroExpansion>
3132
<BuildableReference
@@ -43,11 +44,13 @@
4344
buildConfiguration = "Debug"
4445
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4546
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
4648
launchStyle = "0"
4749
useCustomWorkingDirectory = "NO"
4850
ignoresPersistentStateOnLaunch = "NO"
4951
debugDocumentVersioning = "YES"
5052
debugServiceExtension = "internal"
53+
enableGPUValidationMode = "1"
5154
allowLocationSimulation = "YES">
5255
<BuildableProductRunnable
5356
runnableDebuggingMode = "0">
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
import UIKit
21
import Flutter
2+
import UIKit
33

4-
@UIApplicationMain
5-
@objc class AppDelegate: FlutterAppDelegate {
4+
@main
5+
@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate {
66
override func application(
77
_ application: UIApplication,
88
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
99
) -> Bool {
10-
GeneratedPluginRegistrant.register(with: self)
1110
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
1211
}
12+
13+
func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) {
14+
GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry)
15+
}
1316
}

example/ios/Runner/Info.plist

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>CADisableMinimumFrameDurationOnPhone</key>
6+
<true/>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>$(DEVELOPMENT_LANGUAGE)</string>
79
<key>CFBundleDisplayName</key>
@@ -24,6 +26,29 @@
2426
<string>$(FLUTTER_BUILD_NUMBER)</string>
2527
<key>LSRequiresIPhoneOS</key>
2628
<true/>
29+
<key>UIApplicationSceneManifest</key>
30+
<dict>
31+
<key>UIApplicationSupportsMultipleScenes</key>
32+
<false/>
33+
<key>UISceneConfigurations</key>
34+
<dict>
35+
<key>UIWindowSceneSessionRoleApplication</key>
36+
<array>
37+
<dict>
38+
<key>UISceneClassName</key>
39+
<string>UIWindowScene</string>
40+
<key>UISceneConfigurationName</key>
41+
<string>flutter</string>
42+
<key>UISceneDelegateClassName</key>
43+
<string>FlutterSceneDelegate</string>
44+
<key>UISceneStoryboardFile</key>
45+
<string>Main</string>
46+
</dict>
47+
</array>
48+
</dict>
49+
</dict>
50+
<key>UIApplicationSupportsIndirectInputEvents</key>
51+
<true/>
2752
<key>UILaunchStoryboardName</key>
2853
<string>LaunchScreen</string>
2954
<key>UIMainStoryboardFile</key>
@@ -43,9 +68,5 @@
4368
</array>
4469
<key>UIViewControllerBasedStatusBarAppearance</key>
4570
<false/>
46-
<key>CADisableMinimumFrameDurationOnPhone</key>
47-
<true/>
48-
<key>UIApplicationSupportsIndirectInputEvents</key>
49-
<true/>
5071
</dict>
5172
</plist>

lib/date_picker_plus.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
library date_picker_plus;
2-
31
export 'src/date/date_picker.dart';
42
export 'src/date/show_date_picker_dialog.dart';
53
export 'src/date/days_picker.dart';

lib/src/date/days_picker.dart

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,15 @@ class DaysPicker extends StatefulWidget {
7070
this.splashColor,
7171
this.splashRadius,
7272
this.centerLeadingDate = false,
73-
this.previousPageSemanticLabel = 'Previous Day',
74-
this.nextPageSemanticLabel = 'Next Day',
73+
this.previousPageSemanticLabel,
74+
this.nextPageSemanticLabel,
7575
this.disabledDayPredicate,
76+
this.forwardButtonDecoration = const BoxDecoration(),
77+
this.forwardButtonSplashColor = Colors.transparent,
78+
this.forwardButtonHighlightColor = Colors.transparent,
79+
this.backwardButtonDecoration = const BoxDecoration(),
80+
this.backwardButtonSplashColor = Colors.transparent,
81+
this.backwardButtonHighlightColor = Colors.transparent,
7682
}) {
7783
assert(!minDate.isAfter(maxDate), "minDate can't be after maxDate");
7884
assert(
@@ -236,6 +242,36 @@ class DaysPicker extends StatefulWidget {
236242
/// A predicate function used to determine if a given day should be disabled.
237243
final DatePredicate? disabledDayPredicate;
238244

245+
/// The cell decoration of the forward button.
246+
///
247+
/// defaults to empty [BoxDecoration].
248+
final BoxDecoration forwardButtonDecoration;
249+
250+
/// The splash color of the ink response when pressed.
251+
///
252+
/// defaults to [Colors.transparent].
253+
final Color forwardButtonSplashColor;
254+
255+
/// The highlight color of the ink response when pressed.
256+
///
257+
/// defaults to [Colors.transparent].
258+
final Color forwardButtonHighlightColor;
259+
260+
/// The cell decoration of the backward button.
261+
///
262+
/// defaults to empty [BoxDecoration].
263+
final BoxDecoration backwardButtonDecoration;
264+
265+
/// The splash color of the ink response when pressed.
266+
///
267+
/// defaults to [Colors.transparent].
268+
final Color backwardButtonSplashColor;
269+
270+
/// The highlight color of the ink response when pressed.
271+
///
272+
/// defaults to [Colors.transparent].
273+
final Color backwardButtonHighlightColor;
274+
239275
@override
240276
State<DaysPicker> createState() => _DaysPickerState();
241277
}
@@ -410,6 +446,15 @@ class _DaysPickerState extends State<DaysPicker> {
410446
mainAxisSize: MainAxisSize.min,
411447
children: [
412448
Header(
449+
forwardButtonDecoration: widget.forwardButtonDecoration,
450+
forwardButtonSplashColor: widget.forwardButtonSplashColor,
451+
forwardButtonHighlightColor: widget.forwardButtonHighlightColor,
452+
backwardButtonDecoration: widget.backwardButtonDecoration,
453+
backwardButtonSplashColor: widget.backwardButtonSplashColor,
454+
backwardButtonHighlightColor: widget.forwardButtonHighlightColor,
455+
previousPageSemanticLabel:
456+
widget.previousPageSemanticLabel ?? MaterialLocalizations.of(context).previousPageTooltip,
457+
nextPageSemanticLabel: widget.nextPageSemanticLabel ?? MaterialLocalizations.of(context).nextPageTooltip,
413458
centerLeadingDate: widget.centerLeadingDate,
414459
leadingDateTextStyle: leadingDateTextStyle,
415460
slidersColor: slidersColor,
@@ -439,8 +484,6 @@ class _DaysPickerState extends State<DaysPicker> {
439484
curve: Curves.ease,
440485
);
441486
},
442-
previousPageSemanticLabel: widget.previousPageSemanticLabel,
443-
nextPageSemanticLabel: widget.nextPageSemanticLabel,
444487
),
445488
const SizedBox(height: 10),
446489
Expanded(

lib/src/range/range_days_picker.dart

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,14 @@ class RangeDaysPicker extends StatefulWidget {
3535
this.splashColor,
3636
this.splashRadius,
3737
this.centerLeadingDate = false,
38-
this.previousPageSemanticLabel = 'Previous Day',
39-
this.nextPageSemanticLabel = 'Next Day',
38+
this.previousPageSemanticLabel,
39+
this.nextPageSemanticLabel,
40+
this.forwardButtonDecoration = const BoxDecoration(),
41+
this.forwardButtonSplashColor = Colors.transparent,
42+
this.forwardButtonHighlightColor = Colors.transparent,
43+
this.backwardButtonDecoration = const BoxDecoration(),
44+
this.backwardButtonSplashColor = Colors.transparent,
45+
this.backwardButtonHighlightColor = Colors.transparent,
4046
}) {
4147
assert(!minDate.isAfter(maxDate), "minDate can't be after maxDate");
4248

@@ -211,6 +217,36 @@ class RangeDaysPicker extends StatefulWidget {
211217
/// Semantic label for button to go to the next page
212218
final String? nextPageSemanticLabel;
213219

220+
/// The cell decoration of the forward button.
221+
///
222+
/// defaults to empty [BoxDecoration].
223+
final BoxDecoration forwardButtonDecoration;
224+
225+
/// The splash color of the ink response when pressed.
226+
///
227+
/// defaults to [Colors.transparent].
228+
final Color forwardButtonSplashColor;
229+
230+
/// The highlight color of the ink response when pressed.
231+
///
232+
/// defaults to [Colors.transparent].
233+
final Color forwardButtonHighlightColor;
234+
235+
/// The cell decoration of the backward button.
236+
///
237+
/// defaults to empty [BoxDecoration].
238+
final BoxDecoration backwardButtonDecoration;
239+
240+
/// The splash color of the ink response when pressed.
241+
///
242+
/// defaults to [Colors.transparent].
243+
final Color backwardButtonSplashColor;
244+
245+
/// The highlight color of the ink response when pressed.
246+
///
247+
/// defaults to [Colors.transparent].
248+
final Color backwardButtonHighlightColor;
249+
214250
@override
215251
State<RangeDaysPicker> createState() => __RangeDaysPickerState();
216252
}
@@ -395,8 +431,15 @@ class __RangeDaysPickerState extends State<RangeDaysPicker> {
395431
mainAxisSize: MainAxisSize.min,
396432
children: [
397433
Header(
398-
previousPageSemanticLabel: widget.previousPageSemanticLabel,
399-
nextPageSemanticLabel: widget.nextPageSemanticLabel,
434+
forwardButtonDecoration: widget.forwardButtonDecoration,
435+
forwardButtonSplashColor: widget.forwardButtonSplashColor,
436+
forwardButtonHighlightColor: widget.forwardButtonHighlightColor,
437+
backwardButtonDecoration: widget.backwardButtonDecoration,
438+
backwardButtonSplashColor: widget.backwardButtonSplashColor,
439+
backwardButtonHighlightColor: widget.forwardButtonHighlightColor,
440+
previousPageSemanticLabel:
441+
widget.previousPageSemanticLabel ?? MaterialLocalizations.of(context).previousPageTooltip,
442+
nextPageSemanticLabel: widget.nextPageSemanticLabel ?? MaterialLocalizations.of(context).nextPageTooltip,
400443
centerLeadingDate: widget.centerLeadingDate,
401444
leadingDateTextStyle: leadingDateTextStyle,
402445
slidersColor: slidersColor,

0 commit comments

Comments
 (0)