- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在尝试检查用户使用的是 Iphone 还是 Android
我正在关注这个帖子以查看
How do you detect the host platform from Dart code?
在我的 initState
中,我添加了以下检查
typeOfDevice = Theme.of(context).platform == TargetPlatform.iOS
? "1"
: "2";
但每当我尝试使用它时,我都会收到以下错误
I/flutter (22330): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter (22330): The following assertion was thrown building MediaQuery(MediaQueryData(size: Size(360.0, 640.0),
I/flutter (22330): devicePixelRatio: 2.0, textScaleFactor: 1.0, padding: EdgeInsets(0.0, 24.0, 0.0, 0.0), viewInsets:
I/flutter (22330): EdgeInsets.zero, alwaysUse24HourFormat: false, accessibleNavigation: falsedisableAnimations:
I/flutter (22330): falseinvertColors: falseboldText: false)):
I/flutter (22330): inheritFromWidgetOfExactType(_InheritedTheme) or inheritFromElement() was called before
I/flutter (22330): _EnterOtpLoginState.initState() completed.
I/flutter (22330): When an inherited widget changes, for example if the value of Theme.of() changes, its dependent
I/flutter (22330): widgets are rebuilt. If the dependent widget's reference to the inherited widget is in a constructor
I/flutter (22330): or an initState() method, then the rebuilt dependent widget will not reflect the changes in the
I/flutter (22330): inherited widget.
I/flutter (22330): Typically references to to inherited widgets should occur in widget build() methods. Alternatively,
I/flutter (22330): initialization based on inherited widgets can be placed in the didChangeDependencies method, which
I/flutter (22330): is called after initState and whenever the dependencies change thereafter.
I/flutter (22330): When the exception was thrown, this was the stack:
I/flutter (22330): #0 StatefulElement.inheritFromElement.<anonymous closure> (package:flutter/src/widgets/framework.dart:3920:9)
I/flutter (22330): #1 StatefulElement.inheritFromElement (package:flutter/src/widgets/framework.dart:3953:6)
I/flutter (22330): #2 Element.inheritFromWidgetOfExactType (package:flutter/src/widgets/framework.dart:3274:14)
I/flutter (22330): #3 Theme.of (package:flutter/src/material/theme.dart:127:52)
I/flutter (22330): #4 _EnterOtpLoginState.initState (package:dice_clutter/screens/otp_login/otp_login.dart:126:26)
I/flutter (22330): #5 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3830:58)
I/flutter (22330): #6 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #7 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #8 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4965:32)
I/flutter (22330): #9 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #10 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4965:32)
I/flutter (22330): #11 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #12 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #13 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #14 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #15 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #16 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #17 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #18 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #19 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #20 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #21 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #22 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #23 ParentDataElement.mount (package:flutter/src/widgets/framework.dart:4047:11)
I/flutter (22330): #24 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #25 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4965:32)
I/flutter (22330): #26 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #27 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #28 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #29 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #30 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #31 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
I/flutter (22330): #32 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #33 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #34 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #35 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #36 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #37 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #38 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #39 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #40 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #41 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #42 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #43 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #44 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
I/flutter (22330): #45 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #46 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #47 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #48 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
I/flutter (22330): #49 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #50 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #51 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #52 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #53 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #54 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #55 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #56 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #57 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
I/flutter (22330): #58 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #59 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #60 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #61 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #62 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #63 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
I/flutter (22330): #64 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #65 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #66 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #67 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #68 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #69 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #70 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
I/flutter (22330): #71 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #72 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #73 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #74 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #75 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #76 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #77 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #78 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #79 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #80 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #81 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #82 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #83 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #84 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #85 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #86 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #87 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #88 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #89 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
I/flutter (22330): #90 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #91 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #92 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #93 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #94 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #95 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #96 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
I/flutter (22330): #97 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #98 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #99 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #100 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #101 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #102 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #103 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #104 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #105 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #106 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
I/flutter (22330): #107 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #108 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #109 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #110 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #111 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #112 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #113 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #114 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #115 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
I/flutter (22330): #116 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #117 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #118 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
I/flutter (22330): #119 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #120 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #121 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
I/flutter (22330): #122 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #123 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #124 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
I/flutter (22330): #125 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #126 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #127 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #128 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #129 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #130 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
I/flutter (22330): #131 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #132 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #133 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #134 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #135 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #136 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #137 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #138 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #139 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #140 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #141 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #142 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #143 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
I/flutter (22330): #144 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #145 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #146 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #147 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
I/flutter (22330): #148 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #149 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #150 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #151 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #152 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #153 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #154 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #155 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #156 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
I/flutter (22330): #157 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #158 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #159 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #160 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #161 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #162 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
I/flutter (22330): #163 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #164 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #165 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #166 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #167 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #168 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #169 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #170 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #171 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #172 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
I/flutter (22330): #173 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #174 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #175 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #176 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #177 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #178 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #179 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #180 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #181 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #182 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #183 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #184 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
I/flutter (22330): #185 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #186 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #187 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #188 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #189 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #190 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (22330): #191 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
I/flutter (22330): #192 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (22330): #193 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (22330): #194 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (22330): #195 RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4643:32)
I/flutter (22330): #196 MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4975:17)
I/flutter (22330): #197 Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter (22330): #198 _TheatreElement.update (package:flutter/src/widgets/overlay.dart:507:16)
I/flutter (22330): #199 Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter (22330): #200 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #201 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #202 StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter (22330): #203 Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter (22330): #204 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #205 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #206 ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter (22330): #207 Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter (22330): #208 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter (22330): #209 Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter (22330): #210 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #211 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #212 StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter (22330): #213 Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter (22330): #214 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter (22330): #215 Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter (22330): #216 SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter (22330): #217 Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter (22330): #218 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (22330): #219 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (22330): #220 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2286:33)
I/flutter (22330): #221 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:676:20)
I/flutter (22330): #222 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:219:5)
I/flutter (22330): #223 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter (22330): #224 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter (22330): #225 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
I/flutter (22330): #226 _invoke (dart:ui/hooks.dart:154:13)
I/flutter (22330): #227 _drawFrame (dart:ui/hooks.dart:143:3)
I/flutter (22330): ════════════════════════════════════════════════════════════════════════════════════════════════════
I/flutter (22330): Another exception was thrown: The _ScaffoldLayout custom multichild layout delegate forgot to lay out the following child:
I/flutter (22330): Another exception was thrown: inheritFromWidgetOfExactType(_InheritedTheme) or inheritFromElement() was called before _EnterOtpLoginState.initState() completed.
I/flutter (22330): Another exception was thrown: The _ScaffoldLayout custom multichild layout delegate forgot to lay out the following children:
当我评论那行代码时应用运行良好
最佳答案
出现此问题是因为您试图从 initState
获取 Inheritedwidget。这是故意不可能的
改为使用didChangeDependencies
:
didChangeDependencies() {
typeOfDevice = Theme.of(context).platform == TargetPlatform.iOS
}
关于dart - 使用 Targetplatform 导致布局问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54397665/
我为 S3 做了一个额外的布局(所有布局的反叛),人们说,使用 layout-sw320dp 对 s3 有好处。一切正常,s3 选择了这个文件夹,布局在 s3 上看起来很棒。 但是当我尝试在 10"平
我是 CSS 的新手,我正在尝试创建一个 3 列布局。也应该有一个居中的页脚。页面的总高度应该填满当前的屏幕。宽度似乎不对。 目前,页脚在尺寸和位置上似乎都没有对齐。 I have attached
已关闭。这个问题是 off-topic 。目前不接受答案。 想要改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 已关闭10 年前。 Improve th
有没有办法确定设备是从右到左的语言(比如阿拉伯语)而不是从左到右的语言(英语)? 需要与旧 API 级别(低至 10)兼容的东西 解决方案 我最终在接受的答案中使用了 xml 方法。更进一步,我还添加
我是 QT 的新手。我试图通过实现下面看到的这个小窗口来理解布局机制。它在作为主窗口的 QWidget 下具有以下元素: 一个延伸到所有客户区域的大型 QWidget。 窗口顶部的两个 QWidget
Accordion 布局是堆叠面板布局,因为此时只有一个面板可见,但我想同时显示两个面板可见,所以我们可以使用 Accordion 面板来做到这一点吗?? 最佳答案 您不能扩展现有的 Accordio
我只是想知道,作为一个假设示例,针对以下场景布局表格的最佳方式是什么: 假设我正在编写一个用于跟踪学生出勤的应用程序。每年年初,我都想添加所有学生(我将手动执行此操作 - 现在,是否应该为这里的每个学
在 CVS 中,我们的项目中有多个目录。 有一个夜间构建,它必须从同一个 CVS 项目的不同目录中提取东西才能构建夜间构建。所以我应该记住这一点,如果我们迁移到 SVN,我必须修改构建脚本以从不同的存
我在 WPF Windows 上有几个列表框,带有 Height="Auto" Width="Auto"在表格上设置 表单大小在不同分辨率下完美匹配,但问题是当我按下最大化按钮时,在表单调整大小时会看
仅供引用,我是 WPF 的新手。 我正在我的 WPF 应用程序中创建一个侧边栏并想要圆角。我学到的不是可以附加到网格的属性。另外,我尝试将文本块放在边框控件中,但我收到的错误消息说“ child 只能
我是CodeIgniter的新手。我想使用包含菜单,页脚等的基本样式创建母版页或布局。我不想在所有页面中编写重复的内容并为所有页面自动加载。例如,我可以在asp.net中创建母版页,或者在asp.ne
我正在使用它来调试应用程序。调试的时候发现底部显示了一个窗口中变量的值,如图- 但是,当我显示表达式时,我得到这样的布局 - 我的问题是,是否可以更改变量窗口的布局也可以在右侧显示值,因为这对我来说很
上面的代码中,放置“as=”footer_links”是什么意思? 最佳答案 as="x" 语法定义模板可用来调用 block 的名称。因此,对于以下内容: 在outer_block.p
我试图编写一个检查注册表值的功能,以查看Windows上的控制台是否启用了颜色。 Computer\HKEY_CURRENT_USER\Console\VirtualTerminalLevel 如果您
我有一个布局,但无法提前定义其所有区域,因为它们是未知的。 稍后创建了 ItemView,我想使用 View 的 ID 作为区域名称在布局中创建一个新区域,这样我就可以说: layout.dynami
我们有一个相当复杂的 gulp 构建过程,涉及多个模块,每个模块都有一个或两个 watch 。我想在一个仪表板中监控这一点,如下所示: 每一列都是一个模块,列内的每一行都是后续的构建步骤。一旦第 1
这就是问题所在,我有一个 MainWindow 类,它在一个设置例程中扩展了 JFrame,我将该类的布局设置为新的 CardLayout()。这一切都工作正常,但是当我从 JFrame 请求布局并将
我正在制作一个简单的迷宫程序,用户可以在其中创建墙壁、路径、起点和终点,单击“解决”,迷宫将被解决。为此,我有一个大小为 640x480 的 java JFrame。在 JFrame 的左侧,我有一个
我正在使用它来调试应用程序。调试的时候发现底部显示了一个窗口中变量的值,如图- 但是,当我显示表达式时,我得到这样的布局 - 我的问题是,是否可以更改变量窗口的布局也可以在右侧显示值,因为这对我来说很
我已经编写了使用 VBox 作为布局的代码。我希望按钮出现在顶行,然后绘制 2 条水平线,在 400x400 场景中应位于 y=200 和 300 处。但输出显示了我给出的不同坐标处的线条。 我知道这
我是一名优秀的程序员,十分优秀!