Created
December 1, 2020 12:08
-
-
Save karabanovbs/fef74b1af40ddc777180f4ed408435bd to your computer and use it in GitHub Desktop.
AutofillGroup with navigation BUG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text('Screen 1'), | |
), | |
body: Builder( | |
builder: (context) { | |
return AutofillGroup( | |
child: TextFormField( | |
autofocus: true, | |
onChanged: (value) { | |
Navigator.of(context).pushReplacement(MaterialPageRoute( | |
builder: (context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('Screen 2'), | |
), | |
body: TextField( | |
autofocus: true, | |
onChanged: (value) {}, | |
), | |
); | |
}, | |
)); | |
}, | |
), | |
); | |
}, | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment