-
Notifications
You must be signed in to change notification settings - Fork 27.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Severe Issue with CupertinoDatePicker and locale #55733
Comments
Hi @Ben-chedli This seems to be cause by your code
to better address the issue, would be helpful if you could post a minimal code sample to reproduce the problem |
After some more debugging i found out that it happens only if i call the localization delegates ! return MaterialApp( |
Hi @TahaTesser Code Sample
Thank you |
I tried it out and everything is working perfectly, it seems there was something wrong with the way i am adding the localization delegates. Thanks a lot @TahaTesser ! |
Hi @Ben-chedli |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to Reproduce
The CupertinoDatePicker works fine when my device's language is set to English but throws an error when i set the device language to Swedish !
Expected results:
Actual results:
Logs
LogsI/flutter (14282): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
[ +6 ms] I/flutter (14282): The following NoSuchMethodError was thrown building IconTheme(
[ +3 ms] I/flutter (14282): color: systemBlue
[ +7 ms] I/flutter (14282): ):
[ +1 ms] I/flutter (14282): The method 'datePickerDayOfMonth' was called on null.
[ +1 ms] I/flutter (14282): Receiver: null
[ +1 ms] I/flutter (14282): Tried calling: datePickerDayOfMonth(1)
[ ] I/flutter (14282):
[ +1 ms] I/flutter (14282): The relevant error-causing widget was:
[ ] I/flutter (14282): CupertinoTheme
[ ] I/flutter (14282): file:///C:/Users/bench/Repo/aitopya-patient-flutter/lib/screens/dashboard/profile_tab.dart:218:24
[ +8 ms] I/flutter (14282):
[ +1 ms] I/flutter (14282): When the exception was thrown, this was the stack:
[ +1 ms] I/flutter (14282): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
[ ] I/flutter (14282): #1 CupertinoDatePicker._getColumnWidth (package:flutter/src/cupertino/date_picker.dart:379:51)
[ ] I/flutter (14282): #2 _CupertinoDatePickerDateState._refreshEstimatedColumnWidths (package:flutter/src/cupertino/date_picker.dart:873:85)
[ ] I/flutter (14282): #3 _CupertinoDatePickerDateState.didChangeDependencies (package:flutter/src/cupertino/date_picker.dart:869:5)
[ ] I/flutter (14282): #4 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4376:12)
[ ] I/flutter (14282): #5 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
[ ] I/flutter (14282): #6 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ ] I/flutter (14282): #7 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
[ ] I/flutter (14282): #8 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
[ ] I/flutter (14282): #9 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
[ ] I/flutter (14282): #10 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
[ +10 ms] I/flutter (14282): #11 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
[ ] I/flutter (14282): #12 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ ] I/flutter (14282): #13 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
[ ] I/flutter (14282): #14 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
[ ] I/flutter (14282): #15 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
[ ] I/flutter (14282): #16 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
[ ] I/flutter (14282): #17 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
[ ] I/flutter (14282): #18 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ ] I/flutter (14282): #19 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
[ ] I/flutter (14282): #20 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
[ ] I/flutter (14282): #21 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
[ ] I/flutter (14282): #22 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
[ ] I/flutter (14282): #23 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
[ +11 ms] I/flutter (14282): #24 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ +1 ms] I/flutter (14282): #25 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
[ ] I/flutter (14282): #26 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)
[ ] I/flutter (14282): #27 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ ] I/flutter (14282): #28 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
[ +1 ms] I/flutter (14282): #29 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
[ +18 ms] I/flutter (14282): #30 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
[ ] I/flutter (14282): #31 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
[ ] I/flutter (14282): #32 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
[ ] I/flutter (14282): #33 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ ] I/flutter (14282): #34 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
[ ] I/flutter (14282): #35 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)
[ ] I/flutter (14282): #36 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ ] I/flutter (14282): #37 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5551:32)
[ ] I/flutter (14282): #38 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ ] I/flutter (14282): #39 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5551:32)
[ ] I/flutter (14282): #40 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ ] I/flutter (14282): #41 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5551:32)
[ ] I/flutter (14282): #42 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ +3 ms] I/flutter (14282): #43 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5551:32)
[ ] I/flutter (14282): #44 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ ] I/flutter (14282): #45 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
[ +1 ms] I/flutter (14282): #46 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)
[ ] I/flutter (14282): #47 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ ] I/flutter (14282): #48 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
[ +20 ms] I/flutter (14282): #49 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)
[ +1 ms] I/flutter (14282): #50 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ +1 ms] I/flutter (14282): #51 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
[ +1 ms] I/flutter (14282): #52 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
[ +1 ms] I/flutter (14282): #53 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
[ ] I/flutter (14282): #54 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
[ ] I/flutter (14282): #55 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
[ ] I/flutter (14282): #56 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ +1 ms] I/flutter (14282): #57 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
[ ] I/flutter (14282): #58 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
[ +1 ms] I/flutter (14282): #59 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
[ ] I/flutter (14282): #60 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
[ +1 ms] I/flutter (14282): #61 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
[ ] I/flutter (14282): #62 ParentDataElement.mount (package:flutter/src/widgets/framework.dart:4617:11)
[ ] I/flutter (14282): #63 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ +17 ms] I/flutter (14282): #64 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
[ ] I/flutter (14282): #65 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
[ ] I/flutter (14282): #66 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
[ ] I/flutter (14282): #67 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
[ ] I/flutter (14282): #68 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4381:11)
[ ] I/flutter (14282): #69 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
[ ] I/flutter (14282): #70 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ ] I/flutter (14282): #71 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
[ ] I/flutter (14282): #72 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
[ ] I/flutter (14282): #73 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
[ ] I/flutter (14282): #74 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
[ ] I/flutter (14282): #75 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
[ ] I/flutter (14282): #76 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
[ ] I/flutter (14282): #77 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
[ ] I/flutter (14282): #78 SliverMultiBoxAdaptorElement.updateChild (package:flutter/src/widgets/sliver.dart:1288:36)
[ ] I/flutter (14282): #79 SliverMultiBoxAdaptorElement.createChild. (package:flutter/src/widgets/sliver.dart:1273:20)
[ ] I/flutter (14282): #80 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2412:19)
[ ] I/flutter (14282): #81 SliverMultiBoxAdaptorElement.createChild (package:flutter/src/widgets/sliver.dart:1266:11)
[ ] I/flutter (14282): #82 RenderSliverMultiBoxAdaptor._createOrObtainChild. (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:354:23)
[ ] I/flutter (14282): #83 RenderObject.invokeLayoutCallback. (package:flutter/src/rendering/object.dart:1823:58)
[ +1 ms] I/flutter (14282): #84 PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:875:15)
[ ] I/flutter (14282): #85 RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1823:13)
[ ] I/flutter (14282): #86 RenderSliverMultiBoxAdaptor._createOrObtainChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:343:5)
[ ] I/flutter (14282): #87 RenderSliverMultiBoxAdaptor.addInitialChild (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:427:5)
[ ] I/flutter (14282): #88 RenderSliverList.performLayout (package:flutter/src/rendering/sliver_list.dart:78:12)
[ +16 ms] I/flutter (14282): #89 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ +19 ms] I/flutter (14282): #90 RenderSliverEdgeInsetsPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:134:11)
[ ] I/flutter (14282): #91 RenderSliverPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:373:11)
[ ] I/flutter (14282): #92 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ ] I/flutter (14282): #93 RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:410:13)
[ ] I/flutter (14282): #94 RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1367:12)
[ ] I/flutter (14282): #95 RenderViewport.performLayout (package:flutter/src/rendering/viewport.dart:1285:20)
[ ] I/flutter (14282): #96 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ ] I/flutter (14282): #97 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (14282): #98 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ ] I/flutter (14282): #99 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (14282): #100 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ ] I/flutter (14282): #101 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (14282): #102 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ +1 ms] I/flutter (14282): #103 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (14282): #104 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ ] I/flutter (14282): #105 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (14282): #106 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ ] I/flutter (14282): #107 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (14282): #108 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ ] I/flutter (14282): #109 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (14282): #110 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ ] I/flutter (14282): #111 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (14282): #112 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ ] I/flutter (14282): #113 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:163:11)
[ +17 ms] I/flutter (14282): #114 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:477:7)
[ +1 ms] I/flutter (14282): #115 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:232:7)
[ ] I/flutter (14282): #116 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:391:14)
[ ] I/flutter (14282): #117 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ ] I/flutter (14282): #118 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (14282): #119 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ ] I/flutter (14282): #120 RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (14282): #121 _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1232:11)
[ ] I/flutter (14282): #122 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ ] I/flutter (14282): #123 _RenderLayoutBuilder.performLayout (package:flutter/src/widgets/layout_builder.dart:242:13)
[ ] I/flutter (14282): #124 RenderObject.layout (package:flutter/src/rendering/object.dart:1724:7)
[ ] I/flutter (14282): #125 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:163:11)
[ ] I/flutter (14282): #126 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:477:7)
[ ] I/flutter (14282): #127 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:232:7)
[ ] I/flutter (14282): #128 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:391:14)
[ ] I/flutter (14282): #129 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1584:7)
[ ] I/flutter (14282): #130 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:844:18)
[ ] I/flutter (14282): #131 RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:344:19)
[ ] I/flutter (14282): #132 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:774:13)
[ +750 ms] I/flutter (14282): #133 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:283:5)
[ +1 ms] I/flutter (14282): #134 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1102:15)
[ ] I/flutter (14282): #135 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1041:9)
[ +14 ms] I/flutter (14282): #136 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:957:5)
[ +3 ms] I/flutter (14282): #140 _invoke (dart:ui/hooks.dart:259:10)
[ ] I/flutter (14282): #141 _drawFrame (dart:ui/hooks.dart:217:3)
[ +3 ms] I/flutter (14282): (elided 3 frames from package dart:async)
[ +1 ms] I/flutter (14282):
[ ] I/flutter (14282): ════════════════════════════════════════════════════════════════════════════════════════════════════
[ +1 ms] I/flutter (14282): Another exception was thrown: NoSuchMethodError: The method 'datePickerDayOfMonth' was called on null.
Flutter Doctor
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18362.778], locale en-SE)
• Flutter version 1.12.13+hotfix.8 at C:\Programs\flutter
• Framework revision 0b8abb4 (3 months ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced
• Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\bench\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
• All Android licenses accepted.
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 40.2.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[√] VS Code (version 1.44.2)
• VS Code at C:\Users\bench\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.9.1
[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
• No issues found!
The text was updated successfully, but these errors were encountered: