import 'package:flutter/material.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:liberin_project_manager/src/screens/Login/enter_mobile_number_screen.dart'; import 'package:liberin_project_manager/src/project_owner/home/project_owner_home_screen.dart'; import 'package:liberin_project_manager/src/screens/home/home_screen.dart'; import 'package:liberin_project_manager/unused/phone_auth_test.dart'; class DashboardPage extends StatefulWidget { @override _DashboardPageState createState() => _DashboardPageState(); } class _DashboardPageState extends State<DashboardPage> { String uid = ''; getUid() {} @override void initState() { this.uid = ''; FirebaseAuth.instance.currentUser().then((val) { setState(() { this.uid = val.uid; }); }).catchError((e) { print(e); }); super.initState(); } @override Widget build(BuildContext context) { return new Scaffold( appBar: new AppBar( title: new Text('Dashboard'), centerTitle: true, ), body: Center( child: Container( child: new Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ new Text('You are now logged in as ${uid}'), SizedBox( height: 15.0, ), new OutlineButton( borderSide: BorderSide( color: Colors.red, style: BorderStyle.solid, width: 3.0), child: Text('Logout'), onPressed: () { FirebaseAuth.instance.signOut().then((action) { Navigator.push( context, MaterialPageRoute( builder: (BuildContext context) => ShowUserTask())); }).catchError((e) { print(e); }); }, ), ], ), ), )); } }
Comments
Post a Comment