import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import '../services/auth_service.dart'; class ProfileScreen extends StatelessWidget { @override Widget build(BuildContext context) { final auth = Provider.of(context); final profile = auth.profile; return Scaffold( appBar: AppBar(title: Text('Profil')), body: Center( child: profile == null ? Text('Nincs profil') : Column( mainAxisSize: MainAxisSize.min, children: [ Text(profile['FullName'] ?? '', style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold)), SizedBox(height: 8), Text('UserID: ${profile['UserID'] ?? ''}'), SizedBox(height: 16), Row(mainAxisSize: MainAxisSize.min, children: [ ElevatedButton(onPressed: () async { await auth.logout(); Navigator.pushReplacementNamed(context, '/'); }, child: Text('Kijelentkezés')), SizedBox(width: 12), ElevatedButton(onPressed: () async { await auth.loadProfile(); }, child: Text('Frissít')) ]) ], ), ), ); } }