admin panel web app
Get firebase
Configure firebase in the flutter project
Source: https://firebase.google.com/docs/flutter/setup?platform=web
Select the platforms your configuration should support using Space
key to toggle selection:
After the flutterfire configure
you'll two changes:
lib/firebase_options.dart
is created- In the fireabse console you see the newly registered web app.
More app configuration to connect with firebase.
# updates pubspec.yaml
flutter pub add firebase_core
# updates lib/firebase_options.dart
flutterfire configure
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
runApp(const MyApp());
}
Now to add specific plugins from the firebase ecosystem, check out this link. https://firebase.google.com/docs/flutter/setup?platform=web#available-plugins
Authentication setup
Phone authentication: https://firebase.google.com/docs/auth/flutter/phone-auth
For authentication, we use firebase_auth
. But the authetication data is contained in cloud
firestore within the same project so we include cloud_firestore
as well.
In Firebase Console:
- Go to Authentication → Sign-in method
- Enable "Phone" as a sign-in provider
App Check with reCAPTCHA
source: https://firebase.google.com/docs/app-check/web/recaptcha-provider