google_maps_schema_parser 1.0.0-1 copy "google_maps_schema_parser: ^1.0.0-1" to clipboard
google_maps_schema_parser: ^1.0.0-1 copied to clipboard

A google_maps_flutter Schema Parser using schema_widget.

GitHub issues GitHub forks GitHub stars GitHub license Pub style: effective dart GitHub tag (latest SemVer) GitHub top language GitHub contributors GitHub last commit Flutter CI

Convert JSON to Widget validating with JSON Schema for Flutter apps #

What is it #

The google_maps_schema_parser is a parser implementation to google_maps_flutter Flutter package implemented with base on schema_widget package that produces widgets dynamically interpreting JSON objects.

Installation #

  • Add this to your package's pubspec.yaml file:
dependencies:
  get_it:
  schema_widget:
  google_maps_schema_parser: ^1.0.0-1
  • Install packages from the command line: with Flutter:
$ flutter packages get
  • Import it into the code file:
 import 'package:google_maps_schema_parser/google_maps_schema_parser.dart'; 

Usage #

import 'package:flutter/material.dart';
import 'package:get_it/get_it.dart';
import 'package:schema_widget/schema_widget.dart';
import 'package:google_maps_schema_parser/google_maps_schema_parser.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Google Maps Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: Center(
          child: FutureBuilder(
            future: GetIt.I.allReady(ignorePendingAsyncCreation: false),
            builder: (buildContext, snapshot) {
              if (snapshot.hasData) {
                return SchemaWidget.parse<Widget>(context, {
                  "type": "GoogleMap",
                  "initialCameraPosition": {
                    "target": {
                      "latitude": 0.0,
                      "longitude": 0.0
                    }
                  }
                });
              }

              return Container();
            },
          ),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: _incrementCounter,
          tooltip: 'Increment',
          child: Icon(Icons.add),
        ),
      ),
    );
  }
}

Next steps #

  • Publish Package;
  • Make MVP;
  • Minimal documentation;
  • Add list of default supported Widgets;
  • Add list of default supported Types;
  • Create content about;
1
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A google_maps_flutter Schema Parser using schema_widget.

Repository (GitHub)
View/report issues

License

Apache-2.0 (LICENSE)

Dependencies

flutter, google_maps_flutter, json_schema, logging, schema_widget

More

Packages that depend on google_maps_schema_parser