This commit implements a complete authentication flow, including user registration. - Introduces an `AuthRegisterRequested` event to handle user registration. - Persists the user ID in settings upon successful authentication. - Modifies `AuthBloc` to load the user based on the stored ID, improving app launch persistence. - Refactors `UserCubit` to only manage the user state and removes authentication logic. - Removes `UserCubit` initialization from `main.dart` and triggers `AuthStarted` to initiate the authentication process.
22 lines
482 B
Dart
22 lines
482 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class SplashScreen extends StatelessWidget {
|
|
const SplashScreen({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return const Scaffold(
|
|
body: Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
CircularProgressIndicator(),
|
|
SizedBox(height: 20),
|
|
Text('Загрузка...'),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|