<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="I/flutter ( 5612): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 5612): The following assertion was thrown building MapPage(dirty, state: _MapPageState#7a02d):
I/flutter ( 5612): 'file:///C:/Flutter/flutter/.pub-cache/git/plugins-3897d4305492d658ed5a22570cbe36f3cb2ee73e/packages/google_maps_flutter/lib/src/google_map.dart':
I/flutter ( 5612): Failed assertion: line 24 pos 15: 'initialCameraPosition != null': is not true.
I/flutter ( 5612): 
I/flutter ( 5612): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter ( 5612): more information in this error message to help you determine and fix the underlying cause.
I/flutter ( 5612): In either case, please report this assertion by filing a bug on GitHub:
I/flutter ( 5612):   https://github.com/flutter/flutter/issues/new?template=BUG.md
I/flutter ( 5612): 
I/flutter ( 5612): When the exception was thrown, this was the stack:
I/flutter ( 5612): #2      new GoogleMap (file:///C:/Flutter/flutter/.pub-cache/git/plugins-3897d4305492d658ed5a22570cbe36f3cb2ee73e/packages/google_maps_flutter/lib/src/google_map.dart:24:15)
I/flutter ( 5612): #3      _MapPageState.build (package:tracking_systems/pages/home_page.dart:22:20)
I/flutter ( 5612): #4      StatefulElement.build (package:flutter/src/widgets/framework.dart:3809:27)
I/flutter ( 5612): #5      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3721:15)
I/flutter ( 5612): #6      Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #7      StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 5612): #8      Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #9      SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #10     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #11     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #12     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #13     StatelessElement.update (package:flutter/src/widgets/framework.dart:3781:5)
I/flutter ( 5612): #14     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #15     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #16     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #17     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #18     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #19     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #20     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #21     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #22     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #23     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #24     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #25     StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 5612): #26     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #27     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #28     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #29     StatelessElement.update (package:flutter/src/widgets/framework.dart:3781:5)
I/flutter ( 5612): #30     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #31     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #32     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #33     StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 5612): #34     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #35     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #36     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #37     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #38     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #39     ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter ( 5612): #40     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #41     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #42     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #43     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #44     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #45     StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 5612): #46     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #47     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #48     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #49     StatelessElement.update (package:flutter/src/widgets/framework.dart:3781:5)
I/flutter ( 5612): #50     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #51     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #52     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #53     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #54     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #55     ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter ( 5612): #56     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #57     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #58     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #59     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2286:33)
I/flutter ( 5612): #60     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding&amp;ServicesBinding&amp;SchedulerBinding&amp;PaintingBinding&amp;SemanticsBinding&amp;RendererBinding&amp;WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:676:20)
I/flutter ( 5612): #61     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding&amp;ServicesBinding&amp;SchedulerBinding&amp;PaintingBinding&amp;SemanticsBinding&amp;RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:219:5)
I/flutter ( 5612): #62     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding&amp;ServicesBinding&amp;SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter ( 5612): #63     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding&amp;ServicesBinding&amp;SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter ( 5612): #64     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding&amp;ServicesBinding&amp;SchedulerBinding.scheduleWarmUpFrame.&lt;anonymous closure&gt; (package:flutter/src/scheduler/binding.dart:751:7)
I/flutter ( 5612): #66     _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
I/flutter ( 5612): #67     _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
I/flutter ( 5612): #68     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
I/flutter ( 5612): (elided 3 frames from class _AssertionError and package dart:async)"><pre class="notranslate"><code class="notranslate">I/flutter ( 5612): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 5612): The following assertion was thrown building MapPage(dirty, state: _MapPageState#7a02d):
I/flutter ( 5612): 'file:///C:/Flutter/flutter/.pub-cache/git/plugins-3897d4305492d658ed5a22570cbe36f3cb2ee73e/packages/google_maps_flutter/lib/src/google_map.dart':
I/flutter ( 5612): Failed assertion: line 24 pos 15: 'initialCameraPosition != null': is not true.
I/flutter ( 5612): 
I/flutter ( 5612): Either the assertion indicates an error in the framework itself, or we should provide substantially
I/flutter ( 5612): more information in this error message to help you determine and fix the underlying cause.
I/flutter ( 5612): In either case, please report this assertion by filing a bug on GitHub:
I/flutter ( 5612):   https://github.com/flutter/flutter/issues/new?template=BUG.md
I/flutter ( 5612): 
I/flutter ( 5612): When the exception was thrown, this was the stack:
I/flutter ( 5612): #2      new GoogleMap (file:///C:/Flutter/flutter/.pub-cache/git/plugins-3897d4305492d658ed5a22570cbe36f3cb2ee73e/packages/google_maps_flutter/lib/src/google_map.dart:24:15)
I/flutter ( 5612): #3      _MapPageState.build (package:tracking_systems/pages/home_page.dart:22:20)
I/flutter ( 5612): #4      StatefulElement.build (package:flutter/src/widgets/framework.dart:3809:27)
I/flutter ( 5612): #5      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3721:15)
I/flutter ( 5612): #6      Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #7      StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 5612): #8      Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #9      SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #10     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #11     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #12     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #13     StatelessElement.update (package:flutter/src/widgets/framework.dart:3781:5)
I/flutter ( 5612): #14     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #15     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #16     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #17     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #18     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #19     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #20     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #21     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #22     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #23     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #24     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #25     StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 5612): #26     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #27     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #28     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #29     StatelessElement.update (package:flutter/src/widgets/framework.dart:3781:5)
I/flutter ( 5612): #30     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #31     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #32     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #33     StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 5612): #34     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #35     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #36     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #37     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #38     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #39     ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter ( 5612): #40     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #41     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #42     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #43     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #44     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #45     StatefulElement.update (package:flutter/src/widgets/framework.dart:3878:5)
I/flutter ( 5612): #46     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #47     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #48     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #49     StatelessElement.update (package:flutter/src/widgets/framework.dart:3781:5)
I/flutter ( 5612): #50     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #51     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4867:14)
I/flutter ( 5612): #52     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #53     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #54     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #55     ProxyElement.update (package:flutter/src/widgets/framework.dart:3990:5)
I/flutter ( 5612): #56     Element.updateChild (package:flutter/src/widgets/framework.dart:2742:15)
I/flutter ( 5612): #57     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter ( 5612): #58     Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter ( 5612): #59     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2286:33)
I/flutter ( 5612): #60     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding&amp;ServicesBinding&amp;SchedulerBinding&amp;PaintingBinding&amp;SemanticsBinding&amp;RendererBinding&amp;WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:676:20)
I/flutter ( 5612): #61     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding&amp;ServicesBinding&amp;SchedulerBinding&amp;PaintingBinding&amp;SemanticsBinding&amp;RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:219:5)
I/flutter ( 5612): #62     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding&amp;ServicesBinding&amp;SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter ( 5612): #63     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding&amp;ServicesBinding&amp;SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter ( 5612): #64     _WidgetsFlutterBinding&amp;BindingBase&amp;GestureBinding&amp;ServicesBinding&amp;SchedulerBinding.scheduleWarmUpFrame.&lt;anonymous closure&gt; (package:flutter/src/scheduler/binding.dart:751:7)
I/flutter ( 5612): #66     _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
I/flutter ( 5612): #67     _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
I/flutter ( 5612): #68     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:171:12)
I/flutter ( 5612): (elided 3 frames from class _AssertionError and package dart:async)
</code></pre></div>
<p dir="auto">I want a landscape page in my app<br>
use this code</p>
<div class="highlight highlight-source-dart notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@override
  void initState() {
    super.initState();
    SystemChrome.setPreferredOrientations([
      DeviceOrientation.landscapeRight,
      DeviceOrientation.landscapeLeft,
    ]);
  }"><pre class="notranslate"><span class="pl-k">@override</span>
  <span class="pl-k">void</span> <span class="pl-en">initState</span>() {
    <span class="pl-c1">super</span>.<span class="pl-en">initState</span>();
    <span class="pl-c1">SystemChrome</span>.<span class="pl-en">setPreferredOrientations</span>([
      <span class="pl-c1">DeviceOrientation</span>.landscapeRight,
      <span class="pl-c1">DeviceOrientation</span>.landscapeLeft,
    ]);
  }</pre></div>
<p dir="auto">in android, it works well. app could auto landscape.but it doesn't work in ios.</p>
<p dir="auto">i must  horizontally iphone to make it work.</p>
<p dir="auto">bug?</p>