Advertisement
Hevernooo

Проверка

Nov 19th, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.68 KB | None | 0 0
  1. import 'dart:async';
  2. import 'package:firebase_auth/firebase_auth.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:plantual_1/scenes/home.dart';
  5. import 'package:plantual_1/ui/auth/signInScreen.dart';
  6.  
  7. class splashServices{
  8.   void isLogin(BuildContext context){
  9.  
  10.     final auth = FirebaseAuth.instance;
  11.  
  12.     final user = auth.currentUser;
  13.  
  14.     if(user != null){
  15.       Timer(const Duration(seconds: 2),
  16.               () => Navigator.push(context, MaterialPageRoute(builder: (context) => Home())));
  17.     }else{
  18.       Timer(const Duration(seconds: 2),
  19.               () => Navigator.push(context, MaterialPageRoute(builder: (context) => signInScreen())));
  20.     }
  21.   }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement