firestore_ref 0.9.2+4
firestore_ref: ^0.9.2+4 copied to clipboard

Flutter Android iOS macOS

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:firebase_core/firebase_core.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)');

  firestoreOperationCounter.enabled = true;

  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();

  if (isEmulator) {
    FirebaseFunctions.instance.useFunctionsEmulator(
      origin: 'http://$emulatorDomain:5001',
    );
    useFirestoreEmulator();
  } else if (kIsWeb) {
    FirebaseFirestore.instance.settings = const Settings(
      persistenceEnabled: true,
    );
  }

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

Publisher

mono0926.com

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

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

More

Packages that depend on firestore_ref