firestore_ref 0.8.21 copy "firestore_ref: ^0.8.21" to clipboard
firestore_ref: ^0.8.21 copied to clipboard

outdated

Firestore reference/document typed acccess helpers. You can write organized safe code by this.

example/lib/main.dart

import 'package:cloud_functions/cloud_functions.dart';
import 'package:example/router.dart';
import 'package:firestore_ref/firestore_ref.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart' hide Router;

import 'app.dart';
import 'model/service/service.dart';
import 'util/util.dart';

Future<void> main() async {
  const isEmulator = bool.fromEnvironment('IS_EMULATOR');
  logger.fine('start(isEmulator: $isEmulator)');

  recordFirestoreOperationCount = true;

  WidgetsFlutterBinding.ensureInitialized();

  if (isEmulator) {
    CloudFunctions.instance.useFunctionsEmulator(
      origin: 'http://$emulatorDomain:5001',
    );
    await useFirestoreEmulator();
  } else if (kIsWeb) {
    await Firestore.instance.settings(persistenceEnabled: true);
  }

  runApp(
    MultiProvider(
      providers: [
        Provider(create: (context) => AppInfo()),
        Provider(create: (context) => Router()),
        ChangeNotifierProvider(
          create: (context) => Authenticator()..signInAnonymously(),
        ),
      ],
      child: App(),
    ),
  );
}
25
likes
0
pub points
66%
popularity

Publisher

verified publishermono0926.com

Firestore reference/document typed acccess helpers. You can write organized safe code by this.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cloud_firestore, disposable_provider, firebase, flutter, json_annotation, meta, quiver, rxdart, simple_logger

More

Packages that depend on firestore_ref