Files
flutter/lib/features/auth/screens/auth_screen.dart
2026-09-01 21:08:51 +05:45

90 lines
3.2 KiB
Dart

/*
* This file is part of wger Workout Manager <https://github.com/wger-project>.
* Copyright (c) 2020 - 2026 wger Team
*
* wger Workout Manager is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'package:material_ui/material_ui.dart';
import 'package:wger/features/auth/widgets/auth_card.dart';
class AuthScreen extends StatelessWidget {
const AuthScreen();
static const routeName = '/auth';
@override
Widget build(BuildContext context) {
final deviceSize = MediaQuery.sizeOf(context);
final scheme = Theme.of(context).colorScheme;
// The banner carries the white logo, so it has to stay dark in both modes.
// primary is the dark tone in light mode, primaryContainer in dark mode.
final isDark = scheme.brightness == Brightness.dark;
final bannerColor = isDark ? scheme.primaryContainer : scheme.primary;
final onBannerColor = isDark ? scheme.onPrimaryContainer : scheme.onPrimary;
return Scaffold(
backgroundColor: scheme.surface,
body: Stack(
children: [
Positioned(
top: 0,
right: 0,
left: 0,
child: Container(
height: 0.55 * deviceSize.height,
color: bannerColor,
),
),
SingleChildScrollView(
child: SizedBox(
height: deviceSize.height,
width: deviceSize.width,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 0.15 * deviceSize.height),
const Image(
image: AssetImage('assets/images/logo-white.png'),
width: 85,
height: 85,
),
Container(
margin: const EdgeInsets.only(bottom: 20.0),
padding: const EdgeInsets.symmetric(
vertical: 8.0,
horizontal: 94.0,
),
child: Text(
'wger',
style: TextStyle(
color: onBannerColor.withValues(alpha: 0.7),
fontSize: 30,
fontWeight: FontWeight.bold,
),
),
),
SizedBox(height: 0.025 * deviceSize.height),
const Flexible(child: AuthCard()),
],
),
),
),
],
),
);
}
}