Created
September 3, 2022 16:38
-
-
Save ndugger/57463146589f583c094691f8e9e3458a to your computer and use it in GitHub Desktop.
Flutter Focus Management - FocusScope
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/widgets.dart'; | |
class App extends StatelessWidget { | |
const App({ super.key }); | |
@override | |
Widget build(BuildContext context) { | |
return FocusTraversalGroup( | |
policy: WidgetOrderTraversalPolicy(), | |
child: Builder( | |
builder: (context) => FocusScope( | |
autofocus: true, | |
child: Container() | |
) | |
) | |
); | |
} | |
} | |
void main() { | |
runApp(const App()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment