Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with product picture during onboarding #5860

Open
monsieurtanuki opened this issue Nov 15, 2024 · 0 comments
Open

Issue with product picture during onboarding #5860

monsieurtanuki opened this issue Nov 15, 2024 · 0 comments
Labels
🤗 Onboarding We need to onboard users on how the app works, but also on content like Nutri-Score, Eco-Score…

Comments

@monsieurtanuki
Copy link
Contributor

What

  • During the onboarding, the product picture isn't properly refreshed and displays an error instead.

Steps to reproduce the behavior

  1. Restart the onboarding
  2. Go to the "good product" page
  3. See error

Screenshot/Mockup/Before-After

Image

Logs

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following assertion was thrown building Image(image:
NetworkImage("https://images.openfoodfacts.org/images/products/093/270/067/481501/front_en.280.400.jpg",
scale: 1.0), frameBuilder: null, loadingBuilder: Closure: (BuildContext, Widget, ImageChunkEvent?)
=> Widget, width: 102.9, height: 102.9, fit: contain, alignment: Alignment.center,
this.excludeFromSemantics: false, filterQuality: medium, dirty, dependencies: [Directionality,
MediaQuery, _EffectiveTickerMode, _LocalizationsScope-[GlobalKey#9fbd3]], state:
_ImageState#86901(stream: ImageStream#0f57f(MultiFrameImageStreamCompleter#48530, unresolved, 2
listeners, 0 ephemeralErrorListeners), pixels: null, loadingProgress: null, frameNumber: null,
wasSynchronouslyLoaded: false)):
setState() or markNeedsBuild() called during build.
This ProductPicture widget cannot be marked as needing to build because the framework is already in
the process of building widgets. A widget can be marked as needing to be built during the build
phase only if one of its ancestors is currently building. This exception is allowed because the
framework builds parent widgets before children, which means a dirty descendant will always be
built. Otherwise, the framework might not visit this widget during this build phase.
The widget on which setState() or markNeedsBuild() was called was:
  ProductPicture
The widget which was currently being built when the offending call was made was:
  Image

The relevant error-causing widget was:
  Image
  Image:file:///C:/Users/fabri/StudioProjects/smooth-app/packages/smooth_app/lib/cards/product_cards/smooth_product_imag
  e.dart:286:26

When the exception was thrown, this was the stack:
#0      Element.markNeedsBuild.<anonymous closure> (package:flutter/src/widgets/framework.dart:5177:9)
#1      Element.markNeedsBuild (package:flutter/src/widgets/framework.dart:5189:6)
#2      State.setState (package:flutter/src/widgets/framework.dart:1223:15)
#3      _ProductPictureState.build.<anonymous closure>
(package:smooth_app/cards/product_cards/smooth_product_image.dart:103:24)
#4      _ProductPictureWithImageProvider._buildImage.<anonymous closure>
(package:smooth_app/cards/product_cards/smooth_product_image.dart:305:17)
#5      _ImageState.build (package:flutter/src/widgets/image.dart:1268:36)
#6      StatefulElement.build (package:flutter/src/widgets/framework.dart:5729:27)
#7      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5617:15)
#8      StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5780:11)
#9      Element.rebuild (package:flutter/src/widgets/framework.dart:5333:7)
#10     BuildScope._tryRebuild (package:flutter/src/widgets/framework.dart:2693:15)
#11     BuildScope._flushDirtyElements (package:flutter/src/widgets/framework.dart:2752:11)
#12     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:3048:18)
#13     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:1162:21)
#14     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:468:5)
#15     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1397:15)
#16     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1318:9)
#17     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1176:5)
#18     _invoke (dart:ui/hooks.dart:312:13)
#19     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:419:5)
#20     _drawFrame (dart:ui/hooks.dart:283:31)

════════════════════════════════════════════════════════════════════════════════════════════════════
@teolemon teolemon added the 🤗 Onboarding We need to onboard users on how the app works, but also on content like Nutri-Score, Eco-Score… label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤗 Onboarding We need to onboard users on how the app works, but also on content like Nutri-Score, Eco-Score…
Projects
Status: 💬 To discuss and validate
Development

No branches or pull requests

2 participants