新手学Flutter,记录一下遇到的问题:
The following NoSuchMethodError was thrown building HomePage(dirty, state: Page#644e1):The getter ‘results’ was called on null.
I/flutter ( 5941): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 5941): The following NoSuchMethodError was thrown building HomePage(dirty, state: Page#644e1):
I/flutter ( 5941): The getter 'results' was called on null.
I/flutter ( 5941): Receiver: null
I/flutter ( 5941): Tried calling: results
I/flutter ( 5941):
I/flutter ( 5941): When the exception was thrown, this was the stack:
I/flutter ( 5941): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:50:5)
I/flutter ( 5941): #1 Page._showList (package:flutter_gank/home_page.dart:52:23)
I/flutter ( 5941): #2 Page.layout (package:flutter_gank/home_page.dart:34:21)
I/flutter ( 5941): #3 Page.build (package:flutter_gank/home_page.dart:25:12)
I/flutter ( 5941): #4 StatefulElement.build (package:flutter/src/widgets/framework.dart:3913:27)
I/flutter ( 5941): #5 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3827:15)
I/flutter ( 5941): #6 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #7 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #8 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3952:11)
I/flutter ( 5941): #9 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #10 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #11 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #12 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4964:14)
I/flutter ( 5941): #13 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #14 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #15 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #16 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #17 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #18 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #19 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #20 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #21 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4964:14)
I/flutter ( 5941): #22 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #23 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #24 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4964:14)
I/flutter ( 5941): #25 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #26 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #27 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4964:14)
I/flutter ( 5941): #28 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #29 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #30 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4964:14)
I/flutter ( 5941): #31 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #32 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #33 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #34 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #35 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #36 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3952:11)
I/flutter ( 5941): #37 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #38 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #39 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #40 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #41 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #42 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #43 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #44 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #45 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #46 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #47 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #48 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #49 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3952:11)
I/flutter ( 5941): #50 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #51 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #52 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #53 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4964:14)
I/flutter ( 5941): #54 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #55 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #56 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #57 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #58 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #59 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #60 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #61 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #62 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4964:14)
I/flutter ( 5941): #63 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #64 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #65 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #66 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #67 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #68 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3952:11)
I/flutter ( 5941): #69 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #70 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #71 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #72 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #73 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #74 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #75 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #76 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #77 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #78 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4964:14)
I/flutter ( 5941): #79 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #80 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #81 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #82 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #83 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #84 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #85 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #86 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #87 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #88 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #89 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #90 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3952:11)
I/flutter ( 5941): #91 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #92 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #93 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #94 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #95 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #96 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #97 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3952:11)
I/flutter ( 5941): #98 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #99 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #100 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5070:32)
I/flutter ( 5941): #101 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #102 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #103 _TheatreElement.mount (package:flutter/src/widgets/overlay.dart:593:16)
I/flutter ( 5941): #104 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #105 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #106 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #107 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #108 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #109 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3952:11)
I/flutter ( 5941): #110 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #111 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #112 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #113 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #114 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #115 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #116 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #117 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #118 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #119 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4964:14)
I/flutter ( 5941): #120 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #121 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #122 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #123 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #124 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #125 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3952:11)
I/flutter ( 5941): #126 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #127 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #128 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #129 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4964:14)
I/flutter ( 5941): #130 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #131 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #132 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4964:14)
I/flutter ( 5941): #133 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #134 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #135 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #136 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #137 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #138 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3952:11)
I/flutter ( 5941): #139 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #140 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #141 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #142 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #143 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #144 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #145 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #146 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #147 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #148 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #149 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #150 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #151 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #152 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #153 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #154 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #155 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #156 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #157 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #158 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #159 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #160 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #161 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #162 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #163 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #164 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #165 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #166 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #167 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #168 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #169 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #170 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #171 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #172 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #173 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #174 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #175 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #176 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #177 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #178 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #179 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #180 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #181 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3952:11)
I/flutter ( 5941): #182 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #183 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #184 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #185 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #186 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #187 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #188 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #189 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #190 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #191 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #192 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #193 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #194 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #195 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #196 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #197 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #198 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #199 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #200 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #201 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #202 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #203 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #204 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #205 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #206 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #207 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #208 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #209 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #210 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #211 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #212 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #213 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #214 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #215 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4964:14)
I/flutter ( 5941): #216 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #217 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #218 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #219 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #220 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #221 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3952:11)
I/flutter ( 5941): #222 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #223 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #224 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #225 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #226 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #227 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #228 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #229 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #230 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #231 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #232 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #233 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #234 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #235 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #236 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #237 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #238 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #239 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #240 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3952:11)
I/flutter ( 5941): #241 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #242 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #243 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #244 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #245 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #246 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #247 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #248 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #249 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #250 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #251 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #252 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #253 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3952:11)
I/flutter ( 5941): #254 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #255 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #256 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #257 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3838:16)
I/flutter ( 5941): #258 Element.rebuild (package:flutter/src/widgets/framework.dart:3648:5)
I/flutter ( 5941): #259 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3810:5)
I/flutter ( 5941): #260 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3805:5)
I/flutter ( 5941): #261 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3044:14)
I/flutter ( 5941): #262 Element.updateChild (package:flutter/src/widgets/framework.dart:2847:12)
I/flutter ( 5941): #263 RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:933:16)
I/flutter ( 5941): #264 RenderObjectToWidgetElement.mount (package:flutter/src/widgets/binding.dart:904:5)
I/flutter ( 5941): #265 RenderObjectToWidgetAdapter.attachToRenderTree. (package:flutter/src/widgets/binding.dart:850:17)
I/flutter ( 5941): #266 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2286:19)
I/flutter ( 5941): #267 RenderObjectToWidgetAdapter.attachToRenderTree (package:flutter/src/widgets/binding.dart:849:13)
I/flutter ( 5941): #268 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.attachRootWidget (package:flutter/src/widgets/binding.dart:736:7)
I/flutter ( 5941): #269 runApp (package:flutter/src/widgets/binding.dart:780:7)
I/flutter ( 5941): #270 main (package:flutter_gank/main.dart:6:16)
I/flutter ( 5941): #271 _runMainZoned.. (dart:ui/hooks.dart:200:25)
I/flutter ( 5941): #276 _runMainZoned. (dart:ui/hooks.dart:192:5)
I/flutter ( 5941): #277 _startIsolate. (dart:isolate-patch/isolate_patch.dart:300:19)
I/flutter ( 5941): #278 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12)
I/flutter ( 5941): (elided 4 frames from package dart:async)
从异常的提示来看,应该是results为空了,检查一下代码,发现自己已经对这个字段做了空处理,那么:
if (null != daily.results) {
daily.results.forEach((key, value) => {
new List.from(value).forEach((i) => {
widgets.add(ListTile(
title: Text(daily.results[key][i]['desc']),
))
})
});
}
那么在daily.results中可能影响到results的就是daily这个对象了,对daily进行空处理应该就OK了:
if (null != daily && null != daily.results) {
daily.results.forEach((key, value) => {
new List.from(value).forEach((i) => {
widgets.add(ListTile(
title: Text(daily.results[key][i]['desc']),
))
})
});
}
经过测试确实是daily对象为空了。
在Flutter中有着Kotlin相似的空处理语法,下面这种处理方式也是OK的:
if (null != daily?.results) {
daily.results.forEach((key, value) => {
new List.from(value).forEach((i) => {
widgets.add(ListTile(
title: Text(daily.results[key][i]['desc']),
))
})
});
}