Skip to content

Commit 5a95882

Browse files
committed
autocomplete [nfc]: Shorten name of widget's MentionAutocompleteView
This widget is all about managing autocompletes, so there isn't another kind of view model that this is likely to get confused with.
1 parent eb642d2 commit 5a95882

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/widgets/autocomplete.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ class ComposeAutocomplete extends StatefulWidget {
2626
}
2727

2828
class _ComposeAutocompleteState extends State<ComposeAutocomplete> {
29-
MentionAutocompleteView? _mentionAutocompleteView; // TODO different autocomplete view types
29+
MentionAutocompleteView? _viewModel; // TODO different autocomplete view types
3030

3131
void _composeContentChanged() {
3232
final newAutocompleteIntent = widget.controller.autocompleteIntent();
3333
if (newAutocompleteIntent != null) {
3434
final store = PerAccountStoreWidget.of(context);
35-
_mentionAutocompleteView ??= MentionAutocompleteView.init(
35+
_viewModel ??= MentionAutocompleteView.init(
3636
store: store, narrow: widget.narrow);
37-
_mentionAutocompleteView!.query = newAutocompleteIntent.query;
37+
_viewModel!.query = newAutocompleteIntent.query;
3838
} else {
39-
if (_mentionAutocompleteView != null) {
40-
_mentionAutocompleteView!.dispose();
41-
_mentionAutocompleteView = null;
39+
if (_viewModel != null) {
40+
_viewModel!.dispose();
41+
_viewModel = null;
4242
}
4343
}
4444
}
@@ -61,7 +61,7 @@ class _ComposeAutocompleteState extends State<ComposeAutocomplete> {
6161
@override
6262
void dispose() {
6363
widget.controller.removeListener(_composeContentChanged);
64-
_mentionAutocompleteView?.dispose();
64+
_viewModel?.dispose();
6565
super.dispose();
6666
}
6767

0 commit comments

Comments
 (0)