at_location_flutter 3.1.1 copy "at_location_flutter: ^3.1.1" to clipboard
at_location_flutter: ^3.1.1 copied to clipboard

outdated

A Flutter plugin project to share locations between two @‎signs and track them on OSM (OpenStreetMap).

Now for some internet optimism. #

pub package gitHub license

at_location_flutter #

Introduction #

A flutter package to share and receive location between two atsigns.

Get Started: #

Initially to get a basic overview of the SDK, you must read the atsign docs.

To use this package you must be having a basic setup, Follow here to get started.

Installation: #

To use this library in your app, add it to your pubspec.yaml

  dependencies:
    at_location_flutter: ^3.1.1

Add to your project

flutter pub get 

Import in your application code

import 'package:at_location_flutter/at_location_flutter.dart';

Clone it from github #

Feel free to fork a copy of the source from the GitHub Repo

Initialising: #

It is expected that the app will first authenticate an atsign using the Onboarding widget.

The location service needs to be initialised with a required GlobalKey

await initializeLocationService(
      navKey,
      mapKey: 'xxxx',
      apiKey: 'xxxx',
      showDialogBox: true,
      streamAlternative: (__){},
      isEventInUse: true, 
    );

As this package needs location permission, so add these for:

IOS: (ios/Runner/Info.plist)

<key>NSLocationWhenInUseUsageDescription</key>
<string>Explain the description here.</string>

Android: (android/app/src/main/AndroidManifest.xml)

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

Usage #

To share location with an atsign for 30 minutes:

sendShareLocationNotification(receiver, 30);

To request location from an atsign:

sendRequestLocationNotification(receiver);

To view location of atsigns:

AtLocationFlutterPlugin(
  ['atsign1', 'atsign2', ...]
)

To use the default map view:

Navigator.push(
      context,
      MaterialPageRoute(
          builder: (context) => MapScreen(
                currentAtSign: AtLocationNotificationListener().currentAtSign,
                userListenerKeyword: locationNotificationModel,
              )),
    );

To use the default home screen view:

Navigator.push(
      context,
      MaterialPageRoute(
        builder: (BuildContext context) => HomeScreen(),
    ));

Different datatypes used in the package:

 - LocationNotificationModel: Contains the details of a share/request location and is sent to atsigns while sharing / requesting.
 - LocationDataModel: Gets transferred in the background, contains the actual geo-coordinates and other details.
 - KeyLocationModel - The package uses this to keep a track of all the share/request notifications.

Steps to get mapKey #

Steps to get apiKey #

Example #

We have a good example with explanation in the at_location_flutter package.

Open source usage and contributions #

This is freely licensed open source code, so feel free to use it as is, suggest changes or enhancements or create your own version. See CONTRIBUTING.md for detailed guidance on how to setup tools, tests and make a pull request.