From a55ee0a04c37d7a1eff184f8f9651eccd3010fee Mon Sep 17 00:00:00 2001 From: Muhammad Farooq Iqbal Date: Mon, 20 May 2024 18:31:31 +0500 Subject: [PATCH 1/3] WIP update bug fix --- .flutter-plugins-dependencies | 1 + example/example.dart | 2 +- lib/widgets/rich_suggestion.dart | 15 +- lib/widgets/search_input.dart | 6 +- pubspec.lock | 301 +++++++++++++++++++++++-------- 5 files changed, 240 insertions(+), 85 deletions(-) create mode 100644 .flutter-plugins-dependencies diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies new file mode 100644 index 0000000..6963be9 --- /dev/null +++ b/.flutter-plugins-dependencies @@ -0,0 +1 @@ +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"geolocator_apple","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/","native_build":true,"dependencies":[]},{"name":"google_maps_flutter_ios","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/google_maps_flutter_ios-2.6.0/","native_build":true,"dependencies":[]}],"android":[{"name":"flutter_plugin_android_lifecycle","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.19/","native_build":true,"dependencies":[]},{"name":"geolocator_android","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_android-4.6.0/","native_build":true,"dependencies":[]},{"name":"google_maps_flutter_android","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/google_maps_flutter_android-2.8.0/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]}],"macos":[{"name":"geolocator_apple","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/","native_build":true,"dependencies":[]}],"linux":[],"windows":[{"name":"geolocator_windows","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_windows-0.1.3/","native_build":true,"dependencies":[]}],"web":[{"name":"geolocator_web","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_web-2.2.1/","dependencies":[]},{"name":"google_maps_flutter_web","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/google_maps_flutter_web-0.5.7/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"geolocator","dependencies":["geolocator_android","geolocator_apple","geolocator_web","geolocator_windows"]},{"name":"geolocator_android","dependencies":[]},{"name":"geolocator_apple","dependencies":[]},{"name":"geolocator_web","dependencies":[]},{"name":"geolocator_windows","dependencies":[]},{"name":"google_maps_flutter","dependencies":["google_maps_flutter_android","google_maps_flutter_ios","google_maps_flutter_web"]},{"name":"google_maps_flutter_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"google_maps_flutter_ios","dependencies":[]},{"name":"google_maps_flutter_web","dependencies":[]}],"date_created":"2024-05-20 18:30:31.079510","version":"3.22.0"} \ No newline at end of file diff --git a/example/example.dart b/example/example.dart index 768db3f..71fda75 100644 --- a/example/example.dart +++ b/example/example.dart @@ -12,7 +12,7 @@ class PickerDemoState extends State { return Scaffold( appBar: AppBar(title: const Text('Picker Example')), body: Center( - child: FlatButton( + child: TextButton( child: Text("Pick Delivery location"), onPressed: () { showPlacePicker(); diff --git a/lib/widgets/rich_suggestion.dart b/lib/widgets/rich_suggestion.dart index 7c3a5b1..7abd206 100644 --- a/lib/widgets/rich_suggestion.dart +++ b/lib/widgets/rich_suggestion.dart @@ -24,18 +24,23 @@ class RichSuggestion extends StatelessWidget { final List result = []; final style = TextStyle(color: Colors.grey, fontSize: 15); - final startText = autoCompleteItem.text?.substring(0, autoCompleteItem.offset); + final startText = + autoCompleteItem.text?.substring(0, autoCompleteItem.offset); if (startText?.isNotEmpty == true) { result.add(TextSpan(text: startText, style: style)); } - final boldText = - autoCompleteItem.text?.substring(autoCompleteItem.offset!, autoCompleteItem.offset! + autoCompleteItem.length!); + final boldText = autoCompleteItem.text?.substring(autoCompleteItem.offset!, + autoCompleteItem.offset! + autoCompleteItem.length!); result.add( - TextSpan(text: boldText, style: style.copyWith(color: Theme.of(context).textTheme.bodyText1?.color)), + TextSpan( + text: boldText, + style: style.copyWith( + color: Theme.of(context).textTheme.bodyMedium?.color)), ); - final remainingText = autoCompleteItem.text?.substring(autoCompleteItem.offset! + autoCompleteItem.length!); + final remainingText = autoCompleteItem.text + ?.substring(autoCompleteItem.offset! + autoCompleteItem.length!); result.add(TextSpan(text: remainingText, style: style)); return result; diff --git a/lib/widgets/search_input.dart b/lib/widgets/search_input.dart index 299c917..0e7f6ce 100644 --- a/lib/widgets/search_input.dart +++ b/lib/widgets/search_input.dart @@ -57,11 +57,13 @@ class SearchInputState extends State { padding: EdgeInsets.symmetric(horizontal: 8), child: Row( children: [ - Icon(Icons.search, color: Theme.of(context).textTheme.bodyText1?.color), + Icon(Icons.search, + color: Theme.of(context).textTheme.bodyMedium?.color), SizedBox(width: 8), Expanded( child: TextField( - decoration: InputDecoration(hintText: "Search place", border: InputBorder.none), + decoration: InputDecoration( + hintText: "Search place", border: InputBorder.none), controller: this.editController, onChanged: (value) { setState(() { diff --git a/pubspec.lock b/pubspec.lock index 56e97de..7479291 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,51 +5,74 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.8.2" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + csslib: + dependency: transitive + description: + name: csslib + sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.0.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -59,9 +82,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + sha256: "8cf40eebf5dec866a6d1956ad7b4f7016e6c0cc69847ab946833b7d43743809f" + url: "https://pub.dev" source: hosted - version: "2.0.5" + version: "2.0.19" flutter_test: dependency: "direct dev" description: flutter @@ -76,128 +100,210 @@ packages: dependency: "direct main" description: name: geolocator - url: "https://pub.dartlang.org" + sha256: "5c23f3613f50586c0bbb2b8f970240ae66b3bd992088cf60dd5ee2e6f7dde3a8" + url: "https://pub.dev" source: hosted - version: "9.0.1" + version: "9.0.2" geolocator_android: dependency: transitive description: name: geolocator_android - url: "https://pub.dartlang.org" + sha256: "00c7177a95823dd3ee35ef42fd8666cd27d219ae14cea472ac76a21dff43000b" + url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.6.0" geolocator_apple: dependency: transitive description: name: geolocator_apple - url: "https://pub.dartlang.org" + sha256: bc2aca02423ad429cb0556121f56e60360a2b7d694c8570301d06ea0c00732fd + url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.3.7" geolocator_platform_interface: dependency: transitive description: name: geolocator_platform_interface - url: "https://pub.dartlang.org" + sha256: c6005787efe9e27cb0f6b50230c217e6f0ef8e1e7a8b854efb4f46489e502603 + url: "https://pub.dev" source: hosted - version: "4.0.6" + version: "4.2.3" geolocator_web: dependency: transitive description: name: geolocator_web - url: "https://pub.dartlang.org" + sha256: "102e7da05b48ca6bf0a5bda0010f886b171d1a08059f01bfe02addd0175ebece" + url: "https://pub.dev" source: hosted - version: "2.1.6" + version: "2.2.1" geolocator_windows: dependency: transitive description: name: geolocator_windows - url: "https://pub.dartlang.org" + sha256: "4f4218f122a6978d0ad655fa3541eea74c67417440b09f0657238810d5af6bdc" + url: "https://pub.dev" source: hosted - version: "0.1.1" + version: "0.1.3" + google_maps: + dependency: transitive + description: + name: google_maps + sha256: "47eef3836b49bb030d5cb3afc60b8451408bf34cf753e571b645d6529eb4251a" + url: "https://pub.dev" + source: hosted + version: "7.1.0" google_maps_flutter: dependency: "direct main" description: name: google_maps_flutter - url: "https://pub.dartlang.org" + sha256: c1972cbad779bc5346c49045f26ae45550a0958b1cbca5b524dd3c8954995d28 + url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.6.1" google_maps_flutter_android: dependency: transitive description: name: google_maps_flutter_android - url: "https://pub.dartlang.org" + sha256: "0bcadb80eba39afda77dede89a6caafd3b68f2786b90491eceea4a01c3db181c" + url: "https://pub.dev" source: hosted - version: "2.1.10" + version: "2.8.0" google_maps_flutter_ios: dependency: transitive description: name: google_maps_flutter_ios - url: "https://pub.dartlang.org" + sha256: e5132d17f051600d90d79d9f574b177c24231da702453a036db2490f9ced4646 + url: "https://pub.dev" source: hosted - version: "2.1.11" + version: "2.6.0" google_maps_flutter_platform_interface: dependency: transitive description: name: google_maps_flutter_platform_interface - url: "https://pub.dartlang.org" + sha256: "167af879da4d004cd58771f1469b91dcc3b9b0a2c5334cc6bf71fd41d4b35403" + url: "https://pub.dev" source: hosted - version: "2.2.2" + version: "2.6.0" + google_maps_flutter_web: + dependency: transitive + description: + name: google_maps_flutter_web + sha256: "0c0d5c723d94b295cf86dd1c45ff91d2ac1fff7c05ddca4f01bef9fa0a014690" + url: "https://pub.dev" + source: hosted + version: "0.5.7" + html: + dependency: transitive + description: + name: html + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + url: "https://pub.dev" + source: hosted + version: "0.15.4" http: dependency: "direct main" description: name: http - url: "https://pub.dartlang.org" + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" source: hosted - version: "0.13.5" + version: "0.13.6" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "4.0.2" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + js_wrapping: + dependency: transitive + description: + name: js_wrapping + sha256: e385980f7c76a8c1c9a560dfb623b890975841542471eade630b2871d243851c + url: "https://pub.dev" + source: hosted + version: "0.7.4" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + url: "https://pub.dev" + source: hosted + version: "10.0.4" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "3.0.3" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" source: hosted - version: "0.12.11" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + url: "https://pub.dev" source: hosted - version: "0.1.4" + version: "0.8.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + url: "https://pub.dev" source: hosted - version: "1.7.0" + version: "1.12.0" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" source: hosted - version: "1.8.1" + version: "1.9.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.8" + sanitize_html: + dependency: transitive + description: + name: sanitize_html + sha256: "12669c4a913688a26555323fb9cec373d8f9fbe091f2d01c40c723b33caa8989" + url: "https://pub.dev" + source: hosted + version: "2.1.0" sky_engine: dependency: transitive description: flutter @@ -207,65 +313,106 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + url: "https://pub.dev" source: hosted - version: "0.4.9" + version: "0.7.0" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.2" + uuid: + dependency: transitive + description: + name: uuid + sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8" + url: "https://pub.dev" + source: hosted + version: "4.4.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + url: "https://pub.dev" + source: hosted + version: "14.2.1" + web: + dependency: transitive + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.dev" + source: hosted + version: "0.5.1" sdks: - dart: ">=2.17.0-0 <3.0.0" - flutter: ">=2.10.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.19.0" From cdf77473638e722ec14282101e3531f224ff66a8 Mon Sep 17 00:00:00 2001 From: Muhammad Farooq Iqbal Date: Mon, 20 May 2024 19:49:10 +0500 Subject: [PATCH 2/3] WIP upgrade packages --- .flutter-plugins-dependencies | 2 +- lib/widgets/place_picker.dart | 40 +++++++++++++++++------------------ pubspec.lock | 12 +++++------ pubspec.yaml | 5 ++--- 4 files changed, 29 insertions(+), 30 deletions(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 6963be9..c611321 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"geolocator_apple","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/","native_build":true,"dependencies":[]},{"name":"google_maps_flutter_ios","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/google_maps_flutter_ios-2.6.0/","native_build":true,"dependencies":[]}],"android":[{"name":"flutter_plugin_android_lifecycle","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.19/","native_build":true,"dependencies":[]},{"name":"geolocator_android","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_android-4.6.0/","native_build":true,"dependencies":[]},{"name":"google_maps_flutter_android","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/google_maps_flutter_android-2.8.0/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]}],"macos":[{"name":"geolocator_apple","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/","native_build":true,"dependencies":[]}],"linux":[],"windows":[{"name":"geolocator_windows","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_windows-0.1.3/","native_build":true,"dependencies":[]}],"web":[{"name":"geolocator_web","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_web-2.2.1/","dependencies":[]},{"name":"google_maps_flutter_web","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/google_maps_flutter_web-0.5.7/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"geolocator","dependencies":["geolocator_android","geolocator_apple","geolocator_web","geolocator_windows"]},{"name":"geolocator_android","dependencies":[]},{"name":"geolocator_apple","dependencies":[]},{"name":"geolocator_web","dependencies":[]},{"name":"geolocator_windows","dependencies":[]},{"name":"google_maps_flutter","dependencies":["google_maps_flutter_android","google_maps_flutter_ios","google_maps_flutter_web"]},{"name":"google_maps_flutter_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"google_maps_flutter_ios","dependencies":[]},{"name":"google_maps_flutter_web","dependencies":[]}],"date_created":"2024-05-20 18:30:31.079510","version":"3.22.0"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"geolocator_apple","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/","native_build":true,"dependencies":[]},{"name":"google_maps_flutter_ios","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/google_maps_flutter_ios-2.6.0/","native_build":true,"dependencies":[]}],"android":[{"name":"flutter_plugin_android_lifecycle","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.19/","native_build":true,"dependencies":[]},{"name":"geolocator_android","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_android-4.6.0/","native_build":true,"dependencies":[]},{"name":"google_maps_flutter_android","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/google_maps_flutter_android-2.8.0/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"]}],"macos":[{"name":"geolocator_apple","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_apple-2.3.7/","native_build":true,"dependencies":[]}],"linux":[],"windows":[{"name":"geolocator_windows","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_windows-0.2.3/","native_build":true,"dependencies":[]}],"web":[{"name":"geolocator_web","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/geolocator_web-4.0.0/","dependencies":[]},{"name":"google_maps_flutter_web","path":"/Users/muhammadfarooqiqbal/.pub-cache/hosted/pub.dev/google_maps_flutter_web-0.5.7/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"geolocator","dependencies":["geolocator_android","geolocator_apple","geolocator_web","geolocator_windows"]},{"name":"geolocator_android","dependencies":[]},{"name":"geolocator_apple","dependencies":[]},{"name":"geolocator_web","dependencies":[]},{"name":"geolocator_windows","dependencies":[]},{"name":"google_maps_flutter","dependencies":["google_maps_flutter_android","google_maps_flutter_ios","google_maps_flutter_web"]},{"name":"google_maps_flutter_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"google_maps_flutter_ios","dependencies":[]},{"name":"google_maps_flutter_web","dependencies":[]}],"date_created":"2024-05-20 19:47:49.893388","version":"3.22.0"} \ No newline at end of file diff --git a/lib/widgets/place_picker.dart b/lib/widgets/place_picker.dart index dc2aec1..00e8ee5 100644 --- a/lib/widgets/place_picker.dart +++ b/lib/widgets/place_picker.dart @@ -19,6 +19,7 @@ import '../uuid.dart'; /// /// API key provided should have `Maps SDK for Android`, `Maps SDK for iOS` /// and `Places API` enabled for it +// ignore: must_be_immutable class PlacePicker extends StatefulWidget { /// API key generated from Google Cloud Console. You can get an API key /// [here](https://cloud.google.com/maps-platform/) @@ -30,8 +31,12 @@ class PlacePicker extends StatefulWidget { LocalizationItem? localizationItem; LatLng defaultLocation = LatLng(10.5381264, 73.8827201); - PlacePicker(this.apiKey, - {this.displayLocation, this.localizationItem, LatLng? defaultLocation}) { + PlacePicker( + this.apiKey, { + this.displayLocation, + this.localizationItem, + LatLng? defaultLocation, + }) { if (this.localizationItem == null) { this.localizationItem = new LocalizationItem(); } @@ -90,14 +95,9 @@ class PlacePickerState extends State { super.initState(); if (widget.displayLocation == null) { _getCurrentLocation().then((value) { - if (value != null) { - setState(() { - _currentLocation = value; - }); - } else { - //Navigator.of(context).pop(null); - print("getting current location null"); - } + setState(() { + _currentLocation = value; + }); setState(() { _loadMap = true; }); @@ -137,7 +137,7 @@ class PlacePickerState extends State { locationResult = null; _delayedPop(); return Future.value(false); - } else { + } else { return Future.value(true); } }, @@ -193,7 +193,8 @@ class PlacePickerState extends State { Padding( child: Text(widget.localizationItem!.nearBy, style: TextStyle(fontSize: 16)), - padding: EdgeInsets.symmetric(horizontal: 24, vertical: 8), + padding: + EdgeInsets.symmetric(horizontal: 24, vertical: 8), ), Expanded( child: ListView( @@ -236,9 +237,9 @@ class PlacePickerState extends State { previousSearchTerm = place; - if (context == null) { - return; - } + // if (context == null) { + // return; + // } clearOverlay(); @@ -281,7 +282,7 @@ class PlacePickerState extends State { ), ); - Overlay.of(context)?.insert(this.overlayEntry!); + Overlay.of(context).insert(this.overlayEntry!); autoCompleteSearch(place); } @@ -397,7 +398,7 @@ class PlacePickerState extends State { ), ); - Overlay.of(context)?.insert(this.overlayEntry!); + Overlay.of(context).insert(this.overlayEntry!); } /// Utility function to get clean readable name of a location. First checks @@ -514,9 +515,6 @@ class PlacePickerState extends State { var tmp = result['address_components'][i]; var types = tmp["types"] as List; var shortName = tmp['short_name']; - if (types == null) { - continue; - } if (i == 0) { // [street_number] name = shortName; @@ -648,8 +646,10 @@ class PlacePickerState extends State { } on TimeoutException catch (e) { final locationData = await Geolocator.getLastKnownPosition(); if (locationData != null) { + print("Error: $e"); return LatLng(locationData.latitude, locationData.longitude); } else { + print("Error: $e"); return widget.defaultLocation; } } diff --git a/pubspec.lock b/pubspec.lock index 7479291..7646d28 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -100,10 +100,10 @@ packages: dependency: "direct main" description: name: geolocator - sha256: "5c23f3613f50586c0bbb2b8f970240ae66b3bd992088cf60dd5ee2e6f7dde3a8" + sha256: "149876cc5207a0f5daf4fdd3bfcf0a0f27258b3fe95108fa084f527ad0568f1b" url: "https://pub.dev" source: hosted - version: "9.0.2" + version: "12.0.0" geolocator_android: dependency: transitive description: @@ -132,18 +132,18 @@ packages: dependency: transitive description: name: geolocator_web - sha256: "102e7da05b48ca6bf0a5bda0010f886b171d1a08059f01bfe02addd0175ebece" + sha256: "7a22f400d831f924a89d931ba126a10e6b8b437f31e6b9311320435f3e1571bd" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "4.0.0" geolocator_windows: dependency: transitive description: name: geolocator_windows - sha256: "4f4218f122a6978d0ad655fa3541eea74c67417440b09f0657238810d5af6bdc" + sha256: "53da08937d07c24b0d9952eb57a3b474e29aae2abf9dd717f7e1230995f13f0e" url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "0.2.3" google_maps: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 75d6448..4bf945a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,9 +10,8 @@ dependencies: flutter: sdk: flutter http: ^0.13.5 - google_maps_flutter: ^2.2.0 -# location: ^4.4.0 - geolocator: ^9.0.1 + google_maps_flutter: ^2.6.1 + geolocator: ^12.0.0 dev_dependencies: flutter_test: From 9744d9d6a5cb44c0c3f2532ec930fb6e252935df Mon Sep 17 00:00:00 2001 From: Muhammad Farooq Iqbal Date: Mon, 20 May 2024 19:56:24 +0500 Subject: [PATCH 3/3] WIP bodySmall --- lib/widgets/rich_suggestion.dart | 2 +- lib/widgets/search_input.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/widgets/rich_suggestion.dart b/lib/widgets/rich_suggestion.dart index 7abd206..13bd2a3 100644 --- a/lib/widgets/rich_suggestion.dart +++ b/lib/widgets/rich_suggestion.dart @@ -36,7 +36,7 @@ class RichSuggestion extends StatelessWidget { TextSpan( text: boldText, style: style.copyWith( - color: Theme.of(context).textTheme.bodyMedium?.color)), + color: Theme.of(context).textTheme.bodySmall?.color)), ); final remainingText = autoCompleteItem.text diff --git a/lib/widgets/search_input.dart b/lib/widgets/search_input.dart index 0e7f6ce..1273161 100644 --- a/lib/widgets/search_input.dart +++ b/lib/widgets/search_input.dart @@ -58,7 +58,7 @@ class SearchInputState extends State { child: Row( children: [ Icon(Icons.search, - color: Theme.of(context).textTheme.bodyMedium?.color), + color: Theme.of(context).textTheme.bodySmall?.color), SizedBox(width: 8), Expanded( child: TextField(