geopoint_sql 0.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 55

Geopoint Sql #

pub package

Sql operations for geospatial data. Uses Geopoint and Geojson for data structures and Sqlcool for database management.

Documentation #

Init a geospatial database #

   import 'package:sqlcool/sqlcool.dart';
   import 'package:geopoint_sql/geopoint_sql.dart';

   final geoDb = Db();
   await geoDb
      .init(
         path: "geodb.sqlite",
         schema: [geoPointSchema, geoSerieSchema],
         verbose: true)
      .catchError((dynamic e) {
         throw ("Can not init geo database $e");
      });

Crud operations #

For geopoints:

   import 'package:geopoint_sql/geopoint_sql.dart';

   final geoPointSql = GeoPointSql(db: geoDb);
   // save
   geoPointSql.save(
      geoPoint: GeoPoint(name: "point", latitude: 0.0, longitude: 0.0));

For geoseries:

   import 'package:geopoint_sql/geopoint_sql.dart';

   final geoSerieSql = GeoSerieSql(db: geoDb);
   // save
   geoSerieSql.save(
      geoSerie: GeoSerie(name: "serie1", geoPoints: <GeoPoint>[]));
   // update
   geoSerieSql.update(
      geoSerie: GeoSerie(name: "serie1", geoPoints: <GeoPoint>[]));
   // delete
   geoSerieSql.delete(someExistingGeoserie);

Admin crud view #

   import 'package:geopoint_sql/geopoint_sql.dart';

   @override
   Widget build(BuildContext context) {
      return Scaffold(
         body: GeoCrudNavigationPage(db: geoDb, activeTab: ActiveTab.line));
   }

Screenshot

Changelog #

0.2.0 #

  • Add a GeoDb class
  • Use more strict analysis options
  • Update dependencies
  • Add builder function in schema
  • Fix geopoint image schema

0.1.1 #

Fix type cast for save geopoint

0.1.0 #

Initial release

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:pedantic/pedantic.dart';
import 'package:geopoint_sql/geopoint_sql.dart';
import 'conf.dart';
import 'geocrud.dart';

void main() {
  runApp(MyApp());
  unawaited(initDb());
}

Future<void> initDb() async {
  await geoDb
      .init(
          path: "geodb.sqlite",
          schema: [geoPointSchema, geoSerieSchema],
          verbose: true)
      .catchError((dynamic e) {
    throw ("Can not init geo database $e");
  });
}

final routes = {
  '/': (BuildContext context) => GeoCrudPage(),
};

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Geopoint sql example',
      routes: routes,
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  geopoint_sql: ^0.2.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:geopoint_sql/geopoint_sql.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
9
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
55
Learn more about scoring.

We analyzed this package on May 25, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.1
  • pana: 0.13.8-dev
  • Flutter: 1.17.0

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
cupertino_icons ^0.1.2 0.1.3
extra_pedantic ^1.1.1+3 1.2.0
flutter 0.0.0
geopoint ^0.7.0 0.7.1
pedantic ^1.7.0 1.9.0
sqlcool ^4.1.1 4.3.1
sqlview ^0.4.0 0.4.0
Transitive dependencies
ansicolor 1.0.2
card_settings 1.9.3
charcode 1.1.3
collection 1.14.12
console_log_handler 1.1.6
file_chooser 0.1.2
file_picker 1.9.0+1
file_picker_cross 2.0.0
flutter_colorpicker 0.3.4
flutter_cupertino_settings 0.3.0
flutter_masked_text 0.8.0
flutter_material_pickers 1.5.4
flutter_plugin_android_lifecycle 1.0.8
flutter_slidable 0.5.4
http 0.12.1
http_parser 3.1.4
intl 0.16.1
latlong 0.6.1
logging 0.11.4
meta 1.1.8
path 1.7.0
path_provider 1.6.9
path_provider_macos 0.0.4+3
path_provider_platform_interface 1.0.2
platform 2.2.1
plugin_platform_interface 1.0.2
sky_engine 0.0.99
slugify2 0.2.1
source_span 1.7.0
sqflite 1.3.0+1
sqflite_common 1.0.1
string_scanner 1.0.5
synchronized 2.2.0
term_glyph 1.1.0
typed_data 1.1.6
validate 1.7.0
vector_math 2.0.8
Dev dependencies
flutter_test