mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-02-12 16:52:51 +00:00
clear search box after selecting first nav point
This commit is contained in:
@@ -104,7 +104,6 @@ cp lib/keys.dart.example lib/keys.dart
|
||||
## Roadmap
|
||||
|
||||
### Needed Bugfixes
|
||||
- Clear search box after selecting first nav point
|
||||
- Make submission guide scarier
|
||||
- Tile cache trimming? Does fluttermap handle?
|
||||
- Filter NSI suggestions based on what has already been typed in
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"2.6.4": {
|
||||
"content": [
|
||||
"• Added imperial units support (miles, feet) in addition to metric units (km, meters)",
|
||||
"• Moved units setting from Navigation to Language & Region settings page"
|
||||
"• Moved units setting from Navigation to Language & Region settings page",
|
||||
"• Search text now automatically clears when route planning starts"
|
||||
]
|
||||
},
|
||||
"2.6.3": {
|
||||
|
||||
@@ -26,6 +26,7 @@ class _LocationSearchBarState extends State<LocationSearchBar> {
|
||||
final Debouncer _searchDebouncer = Debouncer(const Duration(milliseconds: 500));
|
||||
|
||||
bool _showResults = false;
|
||||
bool _wasSettingSecondPoint = false; // Track previous state to detect changes
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -161,6 +162,19 @@ class _LocationSearchBarState extends State<LocationSearchBar> {
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<AppState>(
|
||||
builder: (context, appState, child) {
|
||||
// BRUTALIST: Clear search box when route planning starts
|
||||
final isNowSettingSecondPoint = appState.isSettingSecondPoint;
|
||||
if (isNowSettingSecondPoint && !_wasSettingSecondPoint) {
|
||||
// Route planning just started - clear the search box
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_controller.clear();
|
||||
setState(() {
|
||||
_showResults = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
_wasSettingSecondPoint = isNowSettingSecondPoint;
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
|
||||
Reference in New Issue
Block a user