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

Flutter – FutureBuilder weird behaviour

I have a FutureBuilder which the future is this : Future<Tutor> future(Object? args) async { print("running future ...${args}"); String title = ""; String content = ""; final SharedPreferences prefs = await SharedPreferences.getInstance(); if (args != null) { debugPrint("args is not…

VIEW QUESTION
Back To Top
Search