Files
mcbeno-app/lib/screens/profile_screen.dart
b3ni15 871bfcdccb feat: Initialize Flutter app with authentication and scheduling features
- Removed TypeScript configuration file (tsconfig.json).
- Added Flutter plugin dependencies for secure storage.
- Implemented main application structure with routing for login, profile, and schedule screens.
- Developed LoginScreen with authentication logic and user feedback.
- Created ProfileScreen to display user profile information and logout functionality.
- Built ScheduleScreen to show weekly work schedule with navigation controls.
- Integrated AuthService for handling authentication, token storage, and API interactions.
- Updated pubspec.yaml with necessary dependencies for the Flutter project.
2025-08-20 22:48:54 +02:00

32 lines
1.1 KiB
Dart

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<AuthService>(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'))
])
],
),
),
);
}
}