Bonjour, quand je compile , il me dis l’objet à reçu une taille infinie.
Le ListView est apparemment le problème, mais en essayant différent widget, cela ma revient à la même erreur. Vous avez une idée de comment résoudre cela?
════════ Exception caught by rendering library ═════════════════════════════════
RenderIndexedSemantics object was given an infinite size during layout.
The relevant error-causing widget was
ListView
════════════════════════════════════════════════════════════════════════════════
body: InteractiveViewer(
child: ListView(shrinkWrap: false, children: <Widget>[
AspectRatio(
aspectRatio: 1 / 1,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
AspectRatio(
aspectRatio: 1,
child: target != null
? Image(
width: 800,
fit: BoxFit.fitWidth,
image: target!,
)
: Container(),
),
],
),
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
_img.buffer.lengthInBytes == 0
? Container()
: LimitedBox(
maxHeight: 100.0,
child: Image.memory(_img.buffer.asUint8List())),
ElevatedButton(
onPressed: () async {
await addText(nom, prenom, rue, lieu, date);
},
child: const Text('Ajoutés vos informations'),
),
],
),
_buildNom(),
_buildPrenom(),
_buildRue(),
_buildLieu(),
_buildDate(),
Column(
children: [
Padding(
padding: EdgeInsets.all(8.0),
child: Signature(
color: color,
key: _sign,
onSign: () {
final sign = _sign.currentState;
},
backgroundPainter: null,
strokeWidth: strokeWidth,
),
),
ElevatedButton(
onPressed: () async {
final sign = _sign.currentState;
//retrieve image data, do whatever you want with it (send to server, save locally...)
final image = await sign!.getData();
var data = await image.toByteData(
format: ui.ImageByteFormat.png);
sign.clear();
final encoded = base64.encode(data!.buffer.asUint8List());
setState(() {
_img = data;
});
debugPrint("onPressed " + encoded);
},
child: const Text("Afficher sur le contrat")),
ElevatedButton(
onPressed: () {
final sign = _sign.currentState;
sign!.clear();
setState(() {
_img = ByteData(0);
});
debugPrint("cleared");
},
child: const Text("Effacé")),
],
),
]),
));