updating a stateful widget from child code example
Example: make stateful widget flutter
class MyClass extends StatefulWidget {
MyClassState createState() => new MyClassState();
}
class MyClassState extends State<MyClass> {
//Widgets and other code here
}