Baseflow / flutter-geocoding

A Geocoding plugin for Flutter
https://baseflow.com
MIT License
136 stars 71 forks source link

[Bug]: Public API should be namespaced (as static functions of a class) #217

Open lukehutch opened 6 months ago

lukehutch commented 6 months ago

Please check the following before submitting a new issue.

Please select affected platform(s)

Steps to reproduce

Currently the API methods of flutter-geocoding are exposed as toplevel public functions.

The functions placemarkFromCoordinates and locationFromAddress are specific enough that it is likely to be obvious that they are geocoder methods. However, that is not true for setLocaleIdentifier or isPresent.

Expected results

These should all be static methods of a class, PlatformGeocoder or something, so that it is obvious which package the methods are calling into (and so that there's no possibility of name clashes with other public methods).

Actual results

As above

Code sample

N/A

Screenshots or video

Screenshots or video demonstration [Upload media here]

Version

2.2.1

Flutter Doctor output

Doctor output ```console $ flutter doctor -v [✓] Flutter (Channel beta, 3.20.0-1.2.pre, on Fedora Linux 39 (Workstation Edition) 6.7.7-200.fc39.x86_64, locale en_US.utf8) • Flutter version 3.20.0-1.2.pre on channel beta at /opt/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 1751123cde (3 weeks ago), 2024-02-21 22:06:22 -0800 • Engine revision 299e852cb9 • Dart version 3.4.0 (build 3.4.0-99.1.beta) • DevTools version 2.31.0 [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1) • Android SDK at /home/luke/Android/Sdk • Platform android-34, build-tools 33.0.1 • Java binary at: /opt/android-studio/jbr/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) • All Android licenses accepted. [✓] Chrome - develop for the web • Chrome at google-chrome [✓] Linux toolchain - develop for Linux desktop • clang version 17.0.6 (Fedora 17.0.6-2.fc39) • cmake version 3.27.7 • ninja version 1.11.1 • pkg-config version 1.9.5 [✓] Android Studio (version 2022.2) • Android Studio at /opt/android-studio • Flutter plugin version 73.0.2 • Dart plugin version 222.4582 • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) [✓] VS Code (version 1.87.0) • VS Code at /usr/share/code • Flutter extension version 3.85.20240301 [✓] VS Code (version 1.88.0-insider) • VS Code at /usr/share/code-insiders • Flutter extension version 3.79.20231130 [✓] Connected device (3 available) • sdk gphone x86 64 (mobile) • emulator-5554 • android-x64 • Android 13 (API 33) (emulator) • Linux (desktop) • linux • linux-x64 • Fedora Linux 39 (Workstation Edition) 6.7.7-200.fc39.x86_64 • Chrome (web) • chrome • web-javascript • Google Chrome 122.0.6261.94 [✓] Network resources • All expected network resources are available. • No issues found! ```
TimHoogstrate commented 6 months ago

Dear @lukehutch,

Seems like an interesting suggestion. I'll label this as an enhancement.

Kind regards,