communicate with widget flutter code example
Example 1: flutter widget destructor
//In a state of a statefull widget
@override
void dispose() {
_bloc.dispose();
super.dispose();
}
Example 2: stateless widget flutter
class GreenFrog extends StatelessWidget {
const GreenFrog({ Key key }) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(color: const Color(0xFF2DBD3A));
}
}