Skip to content

Commit

Permalink
chore: remove suggestions box controller
Browse files Browse the repository at this point in the history
  • Loading branch information
clragon authored and sjmcdowall committed Nov 25, 2023
1 parent d9c88df commit 221a369
Show file tree
Hide file tree
Showing 14 changed files with 416 additions and 360 deletions.
9 changes: 4 additions & 5 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class _FormExampleState extends State<FormExample> {

String? _selectedCity;

SuggestionsBoxController suggestionBoxController = SuggestionsBoxController();
SuggestionsBox suggestionBoxController = SuggestionsBox();

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -174,7 +174,7 @@ class _FormExampleState extends State<FormExample> {
suggestionsBox,
onSuggestionSelected: (suggestion) =>
_typeAheadController.text = suggestion,
suggestionsBoxController: suggestionBoxController,
suggestionsBox: suggestionBoxController,
validator: (value) =>
value!.isEmpty ? 'Please select a city' : null,
onSaved: (value) => _selectedCity = value,
Expand Down Expand Up @@ -421,8 +421,7 @@ class CupertinoFormExample extends StatefulWidget {
class _FavoriteCitiesPage extends State<CupertinoFormExample> {
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final TextEditingController _typeAheadController = TextEditingController();
final SuggestionsBoxController _suggestionsBoxController =
SuggestionsBoxController();
final SuggestionsBox _suggestionsBoxController = SuggestionsBox();
String favoriteCity = 'Unavailable';

@override
Expand All @@ -441,7 +440,7 @@ class _FavoriteCitiesPage extends State<CupertinoFormExample> {
const Text('What is your favorite city?'),
const SizedBox(height: 10),
CupertinoTypeAheadFormField(
suggestionsBoxController: _suggestionsBoxController,
suggestionsBox: _suggestionsBoxController,
suggestionsBoxDecoration: CupertinoSuggestionsBoxDecoration(
borderRadius: BorderRadius.circular(8),
),
Expand Down
1 change: 0 additions & 1 deletion lib/flutter_typeahead.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export 'package:flutter_typeahead/src/typedef.dart';
export 'package:flutter_typeahead/src/material/field/typeahead_field.dart';
export 'package:flutter_typeahead/src/material/field/text_field_configuration.dart';
export 'package:flutter_typeahead/src/material/field/typeahead_form_field.dart';
export 'package:flutter_typeahead/src/common/suggestions_box/suggestions_box_controller.dart';
export 'package:flutter_typeahead/src/material/suggestions_box/suggestions_box_decoration.dart';
export 'package:flutter_typeahead/src/material/suggestions_box/suggestions_list.dart';
export 'package:flutter_typeahead/src/common/suggestions_box/suggestions_box.dart';
Expand Down
Loading

0 comments on commit 221a369

Please sign in to comment.