firestorm 0.2.1
firestorm: ^0.2.1 copied to clipboard
A data access API and ODM tool for Firebase's Firestore and Realtime Database
example/example.dart
/// This example shows basic usage of Firestorm:
/// - Defining a data entity annotated with @FirestormObject (see commented code below).
/// - Generating code using the Firestorm code generator.
/// - Initializing Firestorm with Firebase.
/// - Registering classes
/// - Using Firestorm to perform CRUD operations on the data entity.
/*
import 'package:firestorm/firestorm.dart';
@FirestormObject()
class Person {
String id;
String firstname;
String lastname;
int age;
double height;
bool isEmployed;
List<String> friends;
Person(this.id, this.firstname, this.lastname, this.age, this.height,
this.isEmployed, this.friends);
}
*/
import 'package:firestorm/firestorm.dart';
import 'package:firestorm/fs/fs.dart';
import 'package:firestorm/rdb/rdb.dart';
import 'package:flutter/widgets.dart';
main() async {
WidgetsFlutterBinding.ensureInitialized();
await FS.init(); // Initialize Firestore if used.
await RDB.init(); // Initialize Realtime database if used.
//registerClasses(); // To be generated by running `dart pub run build_runner build`
runApp(Container()); //Run your Flutter app here...
}