-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scrollable.of() was called with a context that does not contain a Scrollable widget #444
Comments
still not fixed? |
I just used a workaround to this. No replies. Nepali ho ? |
You can wrap the typeahead field in the SingleChildScrollView(
scrollDirection: Axis.vertical,
child: widget
);
|
@monolidth when wrapped with SingleChildScrollView, the callback "onSuggestionSelected" is not working. |
Let me check, will try to fix it since we are using it as well |
news about this? |
Well apparently is this not the only problem, I have fixed the scrolling issue but faced a couple of new issues. |
Thanks for the answer, @monolidth. |
Update @felipecastrosales @jobypthomas. I first implement a custom scroll logic but as I said, had couple of issues. |
@monolidth wow, it actually worked. Very good. 🚀 But tell me, why did you remove It was not very clear to me the objective, "besides just solving the problem". I used it this way. flutter_typeahead:
git:
url: https://github.com/Bavest/flutter_typeahead.git
ref: ffe2ee391888fa4b0a51bd2027e91e21ec85ec6d It is good practice to use |
For scroll problem I managed to fix it in a single simple change... Line 871:
to
Seems like Edit: I am behind the times, two other people have PRs open that fix this already. Neither have been merged. |
heres how i done it, no problem everything works fine Expanded(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(5.0),
border: Border.all(color: Colors.red),
),
child: Padding(
padding: EdgeInsets.all(3.0),
child: TypeAheadField(
textFieldConfiguration:
TextFieldConfiguration(
autofocus: false,
maxLines: 1,
controller: dropOffTextEditingController,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(3),
hintText: "Drop off Location",
labelStyle:
TextStyle(color: Colors.black),
label: Text(
"Your DropOff Location",
style: TextStyle(color: Colors.blue),
),
),
),
suggestionsCallback: (pattern) async {
//if (pattern.isNotEmpty)
return await addressSuggestion(pattern);
// return Future.value();
},
suggestionsBoxController:
SuggestionsBoxController(),
itemBuilder: (context, dynamic suggestion) {
return ListTile(
leading: Icon(
Icons.location_on,
color: Colors.red,
),
title: Text((suggestion as SearchInfo)
.address!
.name!),
subtitle:
Text((suggestion).address!.country!),
);
},
onSuggestionSelected: (dynamic suggestion) {
print("xxx $suggestion");
dropOffTextEditingController.text =
(suggestion as SearchInfo)
.address!
.name!;
Provider.of < AppData > (context, listen: false)
.updateDropOffLocationAddress(
dropOffTextEditingController.text);
//get the coordinates here
GeoPoint ? dropOffPoint = suggestion.point;
print("Coordinates :$dropOffPoint");
Provider.of < AppData > (context, listen: false)
.updateDropOffGeoPoint(dropOffPoint);
// Navigator.pop(
// context, widget.showMapFunction(false));
},
),
),
),
),
), |
The .maybeOf() logic has been merged in to the code for Flutter 3.7.0. Not sure abotu the rest of the issues. |
Can someone try this with 4.3.3 and see if the primary issue has been fixed? |
Yes, has been fixed. |
currently using typeAhead widget to query some parameters, after the recent flutter 3 update i keep getting this error
Scrollable.of() was called with a context that does not contain a Scrollable widget.
This is the widget where the error is pointing
and this is the full error stack
How can I fix it ?
The text was updated successfully, but these errors were encountered: