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