Skip to content

Instantly share code, notes, and snippets.

@karabanovbs
Created December 1, 2020 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karabanovbs/fef74b1af40ddc777180f4ed408435bd to your computer and use it in GitHub Desktop.
Save karabanovbs/fef74b1af40ddc777180f4ed408435bd to your computer and use it in GitHub Desktop.
AutofillGroup with navigation BUG
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