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.
This commit is contained in:
31
lib/screens/profile_screen.dart
Normal file
31
lib/screens/profile_screen.dart
Normal file
@@ -0,0 +1,31 @@
|
||||
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'))
|
||||
])
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user