1
resposta

Failed assertion: line 5307 pos 12: '!_debugLocked': is not true.

Oi gente! Estou há tempos enfrentando um erro aqui e não acho de jeito nenhum. Só acontece depois de eu fazer login, quando vai pra IndexScreen, que joga a HomeScreen (não cabe o código aqui). Creio que pode ter algo a ver com o StreamBuilder. Eis o stacktrace:

======== Exception caught by widgets library =======================================================
The following assertion was thrown building Navigator-[GlobalObjectKey<NavigatorState> _WidgetsAppState#d5fc3](dirty, dependencies: [UnmanagedRestorationScope, HeroControllerScope], state: NavigatorState#4b95f(tickers: tracking 2 tickers)):
'package:flutter/src/widgets/navigator.dart': Failed assertion: line 5307 pos 12: '!_debugLocked': is not true.


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

The relevant error-causing widget was: 
  MaterialApp file:///C:/Users/mpliv/Asteroide/katie_app/lib/main.dart:17:5
When the exception was thrown, this was the stack: 
#2      NavigatorState.build (package:flutter/src/widgets/navigator.dart:5307:12)
#3      StatefulElement.build (package:flutter/src/widgets/framework.dart:4691:27)
#4      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4574:15)
#5      StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4746:11)
#6      Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
...
====================================================================================================
Reloaded 0 libraries in 308ms.

Main:

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(
    MaterialApp(
      title: 'Katie App',
      theme: ThemeData(
        primaryColor: BabyColors.UndefinedColors(brightness: 'dark'), // Color(0xFF6b6578),
        accentColor: BabyColors.UndefinedColors(), //Color(0xFF9a91ac),
        dividerColor: BabyColors.UndefinedColors(brightness: 'light'), //Color(0xFFddd7e9),
        fontFamily: 'Bariol',
        appBarTheme: AppBarTheme(/*color: Color(0xFFFBFBFB),*/),
      ),
      initialRoute: '/',
      onGenerateRoute: RoutesApp.generateRoute,
      debugShowCheckedModeBanner: false,
    ),
  );
}
1 resposta

Olá Eloísa, bom dia.. tudo bom?

Seu erro pode ser a navegação entre os Widgets, se não for.. eu encontrei duas soluções para um erro semelhante ao seu e pode te ajudar. dá uma olhada nesse link e nesse link aqui também.

Qualquer coisa, estamos a disposição.