How to pass data from 2nd activity to 1st activity when pressed back? – android

I’ve 2 activities, Activity1 and Activity2. In Activity1 I’ve a Button and TextView. When the button is clicked Activity2 is started. In Activity2 I’ve an EditText. I want to display the data retrieved from EditText in Activity2 in the TextView in Activity1 when back is pressed from Activity2. can someone help me with the code … Read more

Passing Data to a Stateful Widget in Flutter

I’m wondering what the recommended way of passing data to a stateful widget, while creating it, is. The two styles I’ve seen are: class ServerInfo extends StatefulWidget { Server _server; ServerInfo(Server server) { this._server = server; } @override State<StatefulWidget> createState() => new _ServerInfoState(_server); } class _ServerInfoState extends State<ServerInfo> { Server _server; _ServerInfoState(Server server) { this._server … Read more