Open jeffersonmello opened 2 years ago
Hey @jeffersonmello,
if your TextField
s or TextFormField
s are connected to a TextEditingController
than the state should be preserved.
Here is an example which worked for me:
class ExampleWithTextField extends StatelessWidget {
final controller1 = TextEditingController();
final controller2 = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Example 3'),
),
body: ContainedTabBarView(
tabs: [
Text('First'),
Text('Second'),
],
views: [
Container(
child: TextField(
controller: controller1,
),
),
Container(
child: TextField(
controller: controller2,
),
),
],
),
);
}
}
I hope this helps, if not, please provide more information and your code :)