====== Flutter / debug ====== * Dart & Flutter support for Visual Studio Code [[https://dartcode.org/docs/debugging-commands/|Debugging Commands]] ===== Attraper un maximum d'erreurs ===== {{ :informatique:flutter:debug_catch_max_errors.png?nolink&400 |}} ===== Le rendu plante sans rien dans la debug console ===== Le rendu ne va pas, il plante sans rien "//dire//" **(1)** et aucune erreur dans la "debug console". On observe dans la partie "call stack" **(2)** le message en rouge "Paused on exception", c'est là qui faut dire au debugger de continuer "Continue (F5)" **(3)** pour voir apparaître les détails de l'erreur **(4)**. {{:informatique:flutter:debug_rendering_01.png?nolink&300|}} {{:informatique:flutter:debug_rendering_02.png?nolink&400|}} {{:informatique:flutter:debug_rendering_03.png?nolink&400|}} Par exemple un ''ListView'' dans un ''Column'' génère l'erreur, avec souvent une explication. ════════ Exception caught by rendering library ═════════════════════════════════ The following assertion was thrown during performResize(): Vertical viewport was given unbounded height. Viewports expand in the scrolling direction to fill their container. In this case, a vertical viewport was given an unlimited amount of vertical space in which to expand. This situation typically happens when a scrollable widget is nested inside another scrollable widget. If this widget is always nested in a scrollable widget there is no need to use a viewport because there will always be enough vertical space for the children. In this case, consider using a Column or Wrap instead. Otherwise, consider using a CustomScrollView to concatenate arbitrary slivers into a single scrollable. The relevant error-causing widget was: ListView ListView:file:///home/.../CroustiWiki.flutter/lib/widgets/duks_list.dart:53:27 ... ════════ Exception caught by rendering library ═════════════════════════════════ RenderBox was not laid out: RenderViewport#6f0f6 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 2251 pos 12: 'hasSize' The relevant error-causing widget was: ListView ListView:file:///home/.../CroustiWiki.flutter/lib/widgets/duks_list.dart:53:27 ════════════════════════════════════════════════════════════════════════════════