geoairnmapdb 0.0.4 geoairnmapdb: ^0.0.4 copied to clipboard
flutter plugin for airnmap Database, a cloud-hosted NoSQL database with realtime data syncing across Android and iOS clients, and offline access.
import 'dart:convert';
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:geoairnmapdb/geoairnmapdb.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
final api = GeodbApi('x', '+');
var logLocation,fetchLocation;
@override
void initState() {
super.initState();
initPlatformState();
}
Future<void> initPlatformState() async {
Map form = {
"cid": "xxx",
"uid": "xx",
"sess": "xx",
"uid_long": "xx",
"uid_lat": "xx",
"uid_mil": "x",
"uid_address": "Unnamed Address",
};
logLocation = await api.PushSubscription(form: form);
fetchLocation =
await api.ReadSubscriptionLocation("xxx", "xxx");
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Airnmap Geo'),
),
body: Center(
child: Text(fetchLocation['uid_long'].toString()),
),
),
);
}
}