1
0
mirror of https://github.com/flutter/samples.git synced 2026-04-01 17:23:18 +00:00

Clean up ng-flutter a bit (#2236)

No functional change, just while I was verifying it still works with the
latest Angular releases, completed some cleanup as well.
This commit is contained in:
Parker Lougheed
2024-04-08 16:22:25 -05:00
committed by GitHub
parent 37e149d8a6
commit 6b8f18392d
10 changed files with 97 additions and 103 deletions

View File

@@ -9,18 +9,18 @@ class TextFieldDemo extends StatefulWidget {
}
class _TextFieldDemoState extends State<TextFieldDemo> {
late TextEditingController textController;
late final TextEditingController textController;
@override
void initState() {
super.initState();
// Initial value of the text box
// Initial value of the text box.
textController = TextEditingController.fromValue(TextEditingValue(
text: widget.text.value,
selection: TextSelection.collapsed(offset: widget.text.value.length)));
// Report changes
// Report changes.
textController.addListener(_onTextControllerChange);
// Listen to changes from the outside
// Listen to changes from the outside.
widget.text.addListener(_onTextStateChanged);
}