title: Flutter Bad State: Future already completed and Updated Layout info required
body: <p>Just started working on my app and I'm getting</p>
  <pre><code>Bad state: Future already completed
  
  When the exception was thrown, this was the stack: 
  #1      WidgetsBinding.drawFrame.&lt;anonymous closure&gt; (package:flutter/src/widgets/binding.dart:865:30)
  #2      SchedulerBinding._executeTimingsCallbacks (package:flutter/src/scheduler/binding.dart:289:19)
  #6      _invoke1 (dart:ui/hooks.dart:182:10)
  #7      PlatformDispatcher._reportTimings (dart:ui/platform_dispatcher.dart:441:5)
  #8      _reportTimings (dart:ui/hooks.dart:120:31)
  ...
  The TimingsCallback that gets executed was: Closure: (List&lt;FrameTiming&gt;) =&gt; void
  </code></pre>
  <p>But There is also</p>
  <pre><code>Updated layout information required for RenderParagraph#d3031 NEEDS-LAYOUT NEEDS-PAINT to calculate semantics.
  'package:flutter/src/rendering/object.dart':
  Failed assertion: line 2653 pos 12: '!_needsLayout'
  
  
  Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
  In either case, please report this assertion by filing a bug on GitHub:
    https://github.com/flutter/flutter/issues/new?template=2_bug.md
  
  When the exception was thrown, this was the stack: 
  #2      RenderObject._getSemanticsForParent (package:flutter/src/rendering/object.dart:2653:12)
  #3      RenderObject._getSemanticsForParent.&lt;anonymous closure&gt; (package:flutter/src/rendering/object.dart:2675:61)
  #4      ContainerRenderObjectMixin.visitChildren (package:flutter/src/rendering/object.dart:3331:14)
  #5      RenderObject.visitChildrenForSemantics (package:flutter/src/rendering/object.dart:2760:5)
  #6      RenderObject._getSemanticsForParent (package:flutter/src/rendering/object.dart:2670:5)
  </code></pre>
  <p>My code is this so far
  <strong>Main.dart</strong></p>
  <pre><code>void main() =&gt; runApp(AppName());
  
  class AppName extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        theme: ThemeData.dark(),
        initialRoute: WelcomeScreen.id,
        routes: {
          WelcomeScreen.id: (context) =&gt; WelcomeScreen(),
          SignUpScreen.id: (context) =&gt; SignUpScreen(),
          LoginScreen.id: (context) =&gt; LoginScreen(),
          HomeScreen.id: (context) =&gt; HomeScreen(),
          SearchScreen.id: (context) =&gt; SearchScreen(),
          MessagesScreen.id: (context) =&gt; MessagesScreen(),
          ProfileScreen.id: (context) =&gt; ProfileScreen(),
          RegistraionScreen.id: (context) =&gt; RegistraionScreen(),
        },
      );
    }
  }
  </code></pre>
  <p><strong>welcome_screen.dart</strong></p>
  <pre><code>class WelcomeScreen extends StatefulWidget {
    static String id = 'welcome_screen';
    @override
    _WelcomeScreenState createState() =&gt; _WelcomeScreenState();
  }
  
  class _WelcomeScreenState extends State&lt;WelcomeScreen&gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: Expanded(
          child: Text(
            'Welcome',
            style: TextStyle(
              fontWeight: FontWeight.bold,
              fontSize: 40,
              color: Colors.white,
            ),
          ),
        ),
      );
    }
  }
  </code></pre>
  <p>I have tried restarting my app restarting my IDE, simulator, and computer to no avail and all the other questions with the same error had something wrong with their flutter however when I run <code>flutter doctor</code> I get no errors</p>
  <p>Sorry if it's something small and stupid I'm not seeing I'm new to dart and flutter. Thanks for your help.</p>