Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'dart:async';
- import 'package:firebase_auth/firebase_auth.dart';
- import 'package:flutter/material.dart';
- import 'package:plantual_1/scenes/home.dart';
- import 'package:plantual_1/ui/auth/signInScreen.dart';
- class splashServices{
- void isLogin(BuildContext context){
- final auth = FirebaseAuth.instance;
- final user = auth.currentUser;
- if(user != null){
- Timer(const Duration(seconds: 2),
- () => Navigator.push(context, MaterialPageRoute(builder: (context) => Home())));
- }else{
- Timer(const Duration(seconds: 2),
- () => Navigator.push(context, MaterialPageRoute(builder: (context) => signInScreen())));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement