- 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.
32 lines
1.1 KiB
Dart
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'))
|
|
])
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|