mirror of
https://github.com/kevin-DL/commander_league_flutter.git
synced 2026-01-11 18:44:33 +00:00
Firebase in progress
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
|||||||
|
|
||||||
// Import the firebase_core plugin
|
// Import the firebase_core plugin
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
|
import 'package:firebase_auth/firebase_auth.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(MyApp());
|
runApp(MyApp());
|
||||||
@@ -18,12 +19,14 @@ class _MyAppState extends State<MyApp> {
|
|||||||
// Set default `_initialized` and `_error` state to false
|
// Set default `_initialized` and `_error` state to false
|
||||||
bool _initialized = false;
|
bool _initialized = false;
|
||||||
bool _error = false;
|
bool _error = false;
|
||||||
|
FirebaseAuth auth;
|
||||||
|
|
||||||
// Define an async function to initialize FlutterFire
|
// Define an async function to initialize FlutterFire
|
||||||
void initializeFlutterFire() async {
|
void initializeFlutterFire() async {
|
||||||
try {
|
try {
|
||||||
// Wait for Firebase to initialize and set `_initialized` state to true
|
// Wait for Firebase to initialize and set `_initialized` state to true
|
||||||
await Firebase.initializeApp();
|
await Firebase.initializeApp();
|
||||||
|
auth = FirebaseAuth.instance;
|
||||||
setState(() {
|
setState(() {
|
||||||
_initialized = true;
|
_initialized = true;
|
||||||
});
|
});
|
||||||
@@ -72,7 +75,13 @@ class _MyAppState extends State<MyApp> {
|
|||||||
// closer together (more dense) than on mobile platforms.
|
// closer together (more dense) than on mobile platforms.
|
||||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
||||||
),
|
),
|
||||||
home: Home(title: 'Commander League Home Page'),
|
initialRoute: '/',
|
||||||
|
routes: {
|
||||||
|
'/': (context) => Home(
|
||||||
|
title: 'Commander League Home Page',
|
||||||
|
),
|
||||||
|
'/loading': (context) => Loading(),
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1
lib/services/authenticattion_service.dart
Normal file
1
lib/services/authenticattion_service.dart
Normal file
@@ -0,0 +1 @@
|
|||||||
|
class AutenticationService {}
|
||||||
Reference in New Issue
Block a user