搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫HasanToufiqAhamed/bound_location_picker

bound_location_picker

HasanToufiqAhamed/bound_location_picker open-source repository details.

bound_location_picker 專案封面
星標
0
分支
0
最近推送(UTC)
2025年2月25日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

Bound Location Picker for Flutter

Pub Version

A Flutter package created by the official google_maps_flutter plugin, which can help you to picked locations within a boundary.

Highlighted feature
  • Pick location within the Polygon boundary
  • Pick location within the Circular Radius boundary

Made by @Hasan

Android iOS Web
Support SDK 20+ iOS 11+ Same as Flutter's
Regular Picker Circle Boundary Polygon Boundary

💻 Usage

First, add bound_location_picker as a dependency in your pubspec.yaml file.

dependencies:
  flutter:
    sdk: flutter

  bound_location_picker: ^update_version

Don't forget to flutter pub get.

Android
  1. Set the minSdkVersion in android/app/build.gradle:
android {
    defaultConfig {
        minSdkVersion 20
    }
}

This means that app will only be available for users that run Android SDK 20 or higher.

  1. Specify your API key in the application manifest android/app/src/main/AndroidManifest.xml:
<manifest ...
  <application ...
    <meta-data android:name="com.google.android.geo.API_KEY"
               android:value="YOUR KEY HERE"/>
iOS

To set up, specify your API key in the application delegate ios/Runner/AppDelegate.m:

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "GoogleMaps/GoogleMaps.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [GMSServices provideAPIKey:@"YOUR KEY HERE"];
  [GeneratedPluginRegistrant registerWithRegistry:self];
  return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end

Or in your swift code, specify your API key in the application delegate ios/Runner/AppDelegate.swift:

import UIKit
import Flutter
import GoogleMaps

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GMSServices.provideAPIKey("YOUR KEY HERE")
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}
Web

You'll need to modify the web/index.html file of your Flutter Web application to include the Google Maps JS SDK.

Check the google_maps_flutter_web README for the latest information on how to prepare your App to use Google Maps on the web.

Sample Usage
class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: BoundLocationPicker(
          initialCameraPosition: const LatLng(24.540725, 89.631088),
          onPickedLocation: (LatLng? location) {
            ///TODO do something using location 
          },
          onLocationUpdateListener: (LatLng? location) {
            ///TODO do something with current location
          },
          locationPickerImage: const AssetImage("assets/pin_point.png"),
          circleBoundary: CircleBoundary(radius: 800),
          enablePickedButton: true,
        ),
      ),
    );
  }
}
👨🏻‍💻Contribute to the project

All contributions are welcome.

GitHub

Hasan Toufiq Ahamed GitHub avatar
GitHub 作者

Hasan Toufiq Ahamed ↗

Mobile Application Developer | Flutter Developer

Apsis Solutions LimitedDhaka, Bangladehs
語言DartRubyKotlinSwiftHTMLObjective-C

此儲存庫發佈的套件

使用的依賴

依賴清單 8 項

  • flutter{"sdk":"flutter"}
  • google_maps_flutter^2.10.0
  • logger^2.5.0
  • flutter_web_plugins{"sdk":"flutter"}
  • web^0.5.1
  • plugin_platform_interface^2.0.2
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^4.0.0

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗