61 lines
2.0 KiB
Dart
61 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import '../blocs/theme/theme_cubit.dart';
|
|
import '../blocs/theme/theme_state.dart';
|
|
import '../widgets/app_background.dart';
|
|
import '../widgets/auth_form.dart';
|
|
import '../../core/di/injection_container.dart';
|
|
import '../blocs/login/login_bloc.dart';
|
|
|
|
class AuthScreen extends StatelessWidget {
|
|
const AuthScreen({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return BlocProvider(
|
|
create: (context) => sl<LoginBloc>(),
|
|
child: Scaffold(
|
|
resizeToAvoidBottomInset: false,
|
|
body: AppBackground(
|
|
child: SafeArea(
|
|
child: Column(
|
|
children: [
|
|
const SizedBox(height: 60),
|
|
// Dynamic Logo from backend
|
|
Center(
|
|
child: BlocBuilder<ThemeCubit, ThemeState>(
|
|
builder: (context, state) {
|
|
if (state is ThemeLoaded) {
|
|
return Image.network(
|
|
state.logoUrl,
|
|
width: 62,
|
|
height: 62,
|
|
errorBuilder:
|
|
(_, __, ___) =>
|
|
const Icon(Icons.image_not_supported),
|
|
);
|
|
}
|
|
return const Text(
|
|
'LOGO',
|
|
style: TextStyle(
|
|
fontSize: 36,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
letterSpacing: 2,
|
|
),
|
|
);
|
|
},
|
|
),
|
|
),
|
|
// const SizedBox(height: 15),
|
|
// Form - taking remaining space and centered
|
|
Expanded(child: Center(child: const AuthForm())),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|