I have a problem with a simple code. I have a Futurbuider and in this one in a text that I updated with setState but it returns me each time the text present in my Future
class _HomejeuState extends State<Homejeu> {
bool _visible = true;
var list = [];
var texte1 = '';
Future<String> showLoginPage() async {
var sharedPreferences = await SharedPreferences.getInstance();
var valeurlangue = sharedPreferences.getString("Langconfig") ?? 'NON';
if (valeurlangue == 'FR') {
list = [1, 2, 3, 4, 5];
texte1 =
'bla bla bla bla bla bla';
} else {
list = [7, 8, 9, 0];
texte1 =
'hello hello hello hello hello hello';
}
return valeurlangue;
}
I modify the text via a void function
void lanceuboule() {
Future.delayed(const Duration(milliseconds: 500), () {
setState(() {
texteboule = 'text text text text';
});
});
}
I do not understand. I have the impression that completely relaunches the futurbluider widget. how to prevent it if that is the problem. Thank you