set state on download

This commit is contained in:
julian 2023-07-26 16:29:09 -06:00
parent 04b9cddb19
commit 7390c498c7

View file

@ -42,6 +42,7 @@ class MonkeyView extends ConsumerStatefulWidget {
class _MonkeyViewState extends ConsumerState<MonkeyView> { class _MonkeyViewState extends ConsumerState<MonkeyView> {
late final String walletId; late final String walletId;
List<int>? imageBytes;
String receivingAddress = ""; String receivingAddress = "";
@ -205,8 +206,7 @@ class _MonkeyViewState extends ConsumerState<MonkeyView> {
final bool isDesktop = Util.isDesktop; final bool isDesktop = Util.isDesktop;
List<int>? imageBytes; imageBytes ??= (manager.wallet as BananoWallet).getMonkeyImageBytes();
imageBytes = (manager.wallet as BananoWallet).getMonkeyImageBytes();
//edit for desktop //edit for desktop
return Background( return Background(
@ -360,7 +360,7 @@ class _MonkeyViewState extends ConsumerState<MonkeyView> {
SizedBox( SizedBox(
width: 300, width: 300,
height: 300, height: 300,
child: SvgPicture.memory(Uint8List.fromList(imageBytes)), child: SvgPicture.memory(Uint8List.fromList(imageBytes!)),
), ),
isDesktop isDesktop
? const SizedBox( ? const SizedBox(
@ -466,6 +466,13 @@ class _MonkeyViewState extends ConsumerState<MonkeyView> {
subMessage: "We are fetching your MonKey", subMessage: "We are fetching your MonKey",
); );
imageBytes = (manager.wallet as BananoWallet)
.getMonkeyImageBytes();
if (imageBytes != null) {
setState(() {});
}
// if (isDesktop) { // if (isDesktop) {
// Navigator.of(context).popUntil( // Navigator.of(context).popUntil(
// ModalRoute.withName( // ModalRoute.withName(