firestore_api_parser 1.0.4 copy "firestore_api_parser: ^1.0.4" to clipboard
firestore_api_parser: ^1.0.4 copied to clipboard

outdated

A Flutter and Dart plugin allowing you to convert the JSON format used by firestore to represent its documents or collections to the conventional JSON data format

example/firestore_api_parser_example.dart

import 'package:firestore_api_parser/firestore_api_parser.dart';

import 'agent.dart';

void main() {
  final missions = <Map<String, String>>[
    {'2022': 'No Time To Die'},
    {'2015': 'Spectre'},
    {'2006': 'Casino Royale'},
  ];

  final names = {'lastname': 'BOND', 'firstname': 'James', 'initial': 'JB'};

  final jb = Agent(
      names: names,
      missions: missions,
      status: 'In service',
      round: 20.5,
      timestamp: DateTime.parse('2021-10-07T19:00:00Z'),
      storageRef: 'projects/my_great_project/databases/(default)/documents/USERS/an_user_id',
      nullable: null,
      coordinates: {'latitude': -64, 'longitude': -86});
  final fParser = FirestoreApiParser();

  final doc = fParser.parseJson(json: jb.toJson()); //convert

  print(doc);

  print('\n------------SEPARATOR------------\n');

  final json = fParser.parseFirestoreDocument(documentJson: doc);

  print(json);
}
7
likes
0
pub points
63%
popularity

Publisher

unverified uploader

A Flutter and Dart plugin allowing you to convert the JSON format used by firestore to represent its documents or collections to the conventional JSON data format

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

json_annotation, meta

More

Packages that depend on firestore_api_parser