jjzjj

rightDiceNumber

全部标签

flutter - setState 函数不更新有状态小部件下的图像

我正在尝试构建骰子游戏,如果用户单击该游戏,应该从Assets文件夹更改图像,但图像没有改变,但终端中的值正在更新setState方法可能无法正常工作import'package:flutter/material.dart';import'dart:math';voidmain(){returnrunApp(MaterialApp(home:Scaffold(backgroundColor:Colors.red,appBar:AppBar(title:Center(child:Text('Dicee')),backgroundColor:Colors.red,),body:DicePa

flutter - setState 函数不更新有状态小部件下的图像

我正在尝试构建骰子游戏,如果用户单击该游戏,应该从Assets文件夹更改图像,但图像没有改变,但终端中的值正在更新setState方法可能无法正常工作import'package:flutter/material.dart';import'dart:math';voidmain(){returnrunApp(MaterialApp(home:Scaffold(backgroundColor:Colors.red,appBar:AppBar(title:Center(child:Text('Dicee')),backgroundColor:Colors.red,),body:DicePa