Jeff McMorris
1 min readMay 15, 2019

--

Hard to tell where the problem might be.

class HomeScreenState extends State<HomeScreen> {

StateModel appState;

}

@override

Widget build(BuildContext context) {

appState = StateWidget.of(context).state;

String nickname = appState?.user?.email;

}

You may not be putting all of the above code in your dart code to reference appState. Also the ? make sure you are not trying to call something that doesn’t exist. Also in your main.dart make sure you wrap your state.

void main() {

StateWidget stateWidget = new StateWidget(

child: new MyApp(),

);

runApp(stateWidget);

}

--

--

Responses (2)