Closed vladox1975 closed 1 year ago
I run the clean command and pub get; but still the problem.
Can you send me the code with the Accordion (and all accordion sections) so I can have a look?
Hi,
import 'package:accordion/accordion.dart'; import 'package:flutter/material.dart'; import 'dart:convert'; import 'package:http/http.dart' as http;
Other imports....
class Ayuda extends StatefulWidget { @override _AyudaState createState() => _AyudaState(); }
class _AyudaState extends State
}
List listaCertificados = [];
List
widgetsCertificados.add(
**AccordionSection(**
leftIcon: Icon(
Icons.help_rounded,
color: Colors.white,
),
isOpen: false,
headerBackgroundColor:
cont.isOdd ? Colors.blue : Color.fromRGBO(22, 101, 180, 1),
header: Text(item.descripcion,
style: TextStyle(color: Colors.white, fontSize: 17)),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
child: Text(item.detalle),
),
Container(
margin: EdgeInsets.fromLTRB(0, 15, 0, 0),
child: YoutubePlayer(
controller: _controller,
liveUIColor: Colors.amber,
),
)
],
),
));
cont += 1;
}
});
}
} catch (e) {
}
}
@override void initState() { if (mounted) { // setState(() => recibirCertificados(); // ); super.initState(); } }
@override Widget build(BuildContext context) { Responsive responsive = new Responsive(context); return new WillPopScope( onWillPop: () async { Navigator.of(context).pop(); return false; }, child: new Scaffold( appBar: new AppBar( toolbarHeight: responsive.dp(14), leading: new IconButton( icon: new Icon( Icons.arrow_back_rounded, size: 35.0, ), onPressed: () { Navigator.of(context).pop(); }), backgroundColor: Color.fromRGBO(22, 101, 180, 1), flexibleSpace: FlexibleSpaceBar( centerTitle: true, title: BannerSuperior( nombre: Users.objUser.nombre == '' ? null : Users.objUser.nombre, porcTopLogo: 0, porcBottomLogo: 1, porcTopLogin: 4, porcBottomLogin: 0, tipoOro: false, tipoInsumo: false, ), ), ), body: SafeArea( child: Container( margin: EdgeInsets.fromLTRB(0, 15, 0, 0), child: Accordion( maxOpenSections: 1, children: widgetsCertificados, ), ), ), ), ); } }
Hard to say without all the imports. But you seem to create a list of AccordionSection separately ... have you tried moving the creation of those sections directly into the Accordion? Just a guess. Another idea would be to use the included example app and base your app on that by changing it. Getting the debug message from GetX is normal (see example app) and not an error itself.
Hi,
In the debugging console it tells me that a large number of ListController instances are being created. That ends up crashing my interface and disconnecting debugging.