add cache for latitude and use in searchdelagate

This commit is contained in:
2024-11-23 13:29:25 +01:00
parent 23aec689f1
commit 627eb778ad
2 changed files with 23 additions and 40 deletions

View File

@@ -367,7 +367,11 @@ class _MyHomePageState extends State<ListItemMenu> {
border: OutlineInputBorder(),
suffixIcon: IconButton(
icon: const Icon(Icons.clear),
onPressed: () {
onPressed: () async {
SharedPreferences prefs =
await SharedPreferences.getInstance();
prefs.remove("city_lat");
prefs.remove("city_long");
setState(() {
Datepicker.text = '';
});
@@ -464,7 +468,7 @@ class _MyHomePageState extends State<ListItemMenu> {
onPressed: () {
showSearch(
context: context,
delegate: SearchDelegateExample(geoQuery: inputGeo.text),
delegate: SearchDelegateExample(),
);
},
),