skip to Main Content

Flutter – Why is there Error getting value from FutureBuilder?

class TodoList extends ChangeNotifier{Future<bool> GetLoginData() async { final SharedPreferences prefs = await SharedPreferences.getInstance(); notifyListeners(); return prefs.getBool('data')??false; }} class _CheckState extends State<Check> { Widget build(BuildContext context) { final x = Provider.of<TodoList>(context); print(x.GetLoginData().toString()); return FutureBuilder<bool>( future: x.GetLoginData(), builder: (context, snapshot) { if…

VIEW QUESTION
Back To Top
Search