I want to pass a variable from a statelesswidget to a stateful widget. But when I do so, i have to remove the const from the constructor of GameScreen. Which is generally not advised and will make the statelesswidget equivalent to a stateful widget interms of system resources(since it will be a variable and not a const), is there any other way i can do it?
code:
class GameScreen extends StatelessWidget {
const GameScreen({Key? key}) : super(key: key);
final gameState = Get.find<SudokuGame>();
@override
Widget build(BuildContext context) {
return const Scaffold(
body: ExampleGameScreenUI(),//I want to send gameState as a parameter to ExampleGameScreenUI
);
}
}