/
Ru5Kasper
/
Trackly
Обзор
Документация
Войти
/
Ru5Kasper
/
Trackly
Код
Запросы
1
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
frontend/lib/widgets/auth_screen_layout.dart
93 строки
3 KB
DORANDKOR
feat(frontend): implement dark theme
21 май 2026, 16:08
21 май 2026, 16:08
412c063
Код
Авторство
О чём код?
import 'package:flutter/material.dart'; import '../constants/app_colors.dart'; import '../constants/app_spacing.dart'; class AuthScreenLayout extends StatelessWidget { final GlobalKey<FormState> formKey; final List<Widget> children; final String footerText; final String footerActionText; final VoidCallback onFooterActionTap; const AuthScreenLayout({ super.key, required this.formKey, required this.children, required this.footerText, required this.footerActionText, required this.onFooterActionTap, }); @override Widget build(BuildContext context) { final screenHeight = MediaQuery.of(context).size.height; final screenWidth = MediaQuery.of(context).size.width; return Scaffold( backgroundColor: Theme.of(context).colorScheme.surface, body: SafeArea( child: LayoutBuilder( builder: (context, constraints) { return SingleChildScrollView( keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag, padding: EdgeInsets.only( bottom: MediaQuery.of(context).viewInsets.bottom, ), child: ConstrainedBox( constraints: BoxConstraints(minHeight: constraints.maxHeight), child: Padding( padding: EdgeInsets.symmetric( horizontal: screenWidth * AppSpacing.horizontalPadding, ), child: Form( key: formKey, child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox(height: screenHeight * AppSpacing.topPadding), Column( children: [ Image.asset( 'assets/images/logo.png', height: screenHeight * AppSpacing.logoHeight, fit: BoxFit.contain, ), SizedBox(height: screenHeight * 0.02), ], ), SizedBox( height: screenHeight * AppSpacing.spaceAfterLogo), ...children, SizedBox( height: screenHeight * AppSpacing.spaceAfterButton), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Text(footerText), TextButton( onPressed: onFooterActionTap, child: Text( footerActionText, style: const TextStyle( color: AppColors.primary, fontWeight: FontWeight.bold, ), ), ), ], ), SizedBox( height: screenHeight * AppSpacing.bottomPadding), ], ), ), ), ), ); }, ), ), ); } }