class Graficos extends StatefulWidget {
final String id;
final List<int>? myList;
const Graficos({super.key, required this.id, this.myList});
@override
State<Graficos> createState() => _GraficosState();
}
class _GraficosState extends State<Graficos> {
late List<int>? _myList;
String nome = "";
List<String> ListaNomes = [];
List<String> ListaPontos7Dias = [];
List<String> ListaPontos30Dias = [];
List<String> ListaPontos365Dias = [];
late GoRouterState _state;
late GlobalVariables _globalVariables;
@override
void initState() {
super.initState();
_myList = widget.myList;
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
_state = GoRouterState.of(context);
_globalVariables = Provider.of<GlobalVariables>(context, listen: false);
if (_myList != null) {
print(widget.myList.toString());
} else {
context.go('/menu/${widget.id}');
}
}
Im passing a list of ids from one page to another one and the problem that im encourting is that when I make a hot reload/reload on the page they starting giving error,I wanna correct that im a way to could make a reload on the app web and the data still there. Im working with flutter building a website