Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:firebase_auth/firebase_auth.dart';
- import 'package:flutter/material.dart';
- import 'package:plantual_1/utils/utils.dart';
- import 'package:plantual_1/ui/auth/signInScreen.dart';
- class settings extends StatefulWidget {
- const settings({super.key});
- @override
- State<settings> createState() => _settingsState();
- }
- class _settingsState extends State<settings> {
- final auth = FirebaseAuth.instance;
- @override
- Widget build(BuildContext context) {
- return Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.start,
- children: [
- Padding(padding: EdgeInsets.only(top: 20)),
- Text('Ваша почта: ${auth.currentUser!.email.toString()}', style: TextStyle(fontSize: 20),),
- Padding(padding: EdgeInsets.only(top: 20)),
- Text('Ваш UID: ${auth.currentUser!.uid.toString()}', style: TextStyle(fontSize: 20),),
- Padding(padding: EdgeInsets.only(top: 20)),
- Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- Text('Выйти', style: TextStyle(fontSize: 20),),
- IconButton(
- onPressed: (){
- auth.signOut().then((value){
- Navigator.push(context, MaterialPageRoute(builder: (context) => signInScreen()));
- }).onError((error, stackTrace){
- utilsDone().toastMessage(error.toString());
- });
- },
- icon: Icon(Icons.logout, size: 40,)),
- ],
- ),
- ],
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement