at_location_flutter

Last updated:

0 purchases

at_location_flutter Image
at_location_flutter Images
Add to Cart

Description:

at location flutter

Overview #
The at_location_flutter package is for Flutter developers who want to implement location feature in their apps. This package provides the feature to share and receive location between two atsigns.
This open source package is written in Dart, supports Flutter and follows the
atPlatform's decentralized, edge computing model with the following features:

Cryptographic control of data access through personal data stores
No application backend needed
End to end encryption where only the data owner has the keys
Private and surveillance free connectivity
Share locations and view them on map

We call giving people control of access to their data “flipping the internet”
and you can learn more about how it works by reading this overview.
Get Started: #
There are three options to get started using this package.
1. Quick start - generate a skeleton app with at_app #
This package includes a working sample application in the Example directory that you can use to create a personalized
copy using at_app create in four commands.
$ flutter pub global activate at_app
$ at_app create --sample=<package ID> <app name>
$ cd <app name>
$ flutter run
copied to clipboard
Notes:

You only need to run flutter pub global activate once
Use at_app.bat for Windows

2. Clone it from GitHub #
Feel free to fork a copy of the source from the GitHub repo. The example code contained there is the same as the template that is used by at_app above.
$ git clone https://github.com/atsign-foundation/at_widgets.git
copied to clipboard
3. Manually add the package to a project #
Instructions on how to manually add this package to you project can be found on pub.dev here.
How it works #
Setup #
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,
);
copied to clipboard
As this package needs location permission, so add these for:
IOS: (ios/Runner/Info.plist)
<key>NSLocationWhenInUseUsageDescription</key>
<string>Explain the description here.</string>
copied to clipboard
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" />
copied to clipboard
Usage #
To share location with an atsign for 30 minutes:
sendShareLocationNotification(receiver, 30);
copied to clipboard
To request location from an atsign:
sendRequestLocationNotification(receiver);
copied to clipboard
To view location of atsigns:
AtLocationFlutterPlugin(
['atsign1', 'atsign2', ...]
)
copied to clipboard
To use the default map view:
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => MapScreen(
currentAtSign: AtLocationNotificationListener().currentAtSign,
userListenerKeyword: locationNotificationModel,
)),
);
copied to clipboard
To use the default home screen view:
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) => HomeScreen(),
));
copied to clipboard
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.
copied to clipboard
Steps to get mapKey #

Go to https://cloud.maptiler.com/maps/streets/
Click on sign in or create a free account
Come back to https://cloud.maptiler.com/maps/streets/ if not redirected automatically
Get your key from your Embeddable viewer input text box

Eg : https://api.maptiler.com/maps/streets/?key=<YOUR_MAP_KEY>#-0.1/-2.80318/-38.08702


Copy <YOUR_MAP_KEY> and use it.

Steps to get apiKey #

Go to https://developer.here.com/tutorials/getting-here-credentials/ and follow the steps

Example #
We have a good example with explanation in the at_location_flutter package.
Open source usage and contributions #
This is 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.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.