flutter_canvas_firebase_apis 0.0.4 copy "flutter_canvas_firebase_apis: ^0.0.4" to clipboard
flutter_canvas_firebase_apis: ^0.0.4 copied to clipboard

A Flutter package for connecting Flutter applications with Firebase on Android and IOS developed by fluttercanvas.io.

example/lib/main.dart

import 'package:flutter_canvas_firebase_apis/flutter_canvas_firebase_apis.dart';

import 'package:flutter/material.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  firebaseInit();
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  MyApp({super.key});
  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String? docId;
  _insertDocument({data, collectionName}) async {
    String newDocId = await insert(data, collectionName);
    var snackBar = SnackBar(
      content: Text('Inserted Succesfully , document ID: $newDocId'),
    );
    ScaffoldMessenger.of(context).showSnackBar(snackBar);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Firestore Example'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ElevatedButton(
              onPressed: _insertDocument(
                  data: {'name': 'John Doe', 'age': 30},
                  collectionName: 'user'),
              child: Text('Insert Document'),
            ),
          ],
        ),
      ),
    );
  }
}
3
likes
130
points
47
downloads

Publisher

verified publisherfluttercanvas.io

Weekly Downloads

A Flutter package for connecting Flutter applications with Firebase on Android and IOS developed by fluttercanvas.io.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

cloud_firestore, firebase_auth, firebase_core, flutter, google_sign_in

More

Packages that depend on flutter_canvas_firebase_apis