Экран выбора страны, динамик цвета

This commit is contained in:
noxzion
2026-03-17 16:36:58 +05:00
parent 852a3f8456
commit 81ea86c546
8 changed files with 436 additions and 363 deletions
+42 -11
View File
@@ -1,3 +1,4 @@
import 'package:dynamic_color/dynamic_color.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:komet/frontend/screens/auth/login_screen.dart';
@@ -9,19 +10,49 @@ void main() async {
class MyApp extends StatelessWidget {
const MyApp({super.key});
static const _fallbackSeed = Color(0xFFC1C4FF);
static ColorScheme _adjustScheme(ColorScheme base) {
return base.copyWith(
surface: Color.alphaBlend(
base.primary.withValues(alpha: 0.05),
const Color(0xFF0D0D14),
),
surfaceContainerHigh: Color.alphaBlend(
base.primary.withValues(alpha: 0.08),
const Color(0xFF1A1A26),
),
surfaceContainerHighest: Color.alphaBlend(
base.primary.withValues(alpha: 0.12),
const Color(0xFF262636),
),
);
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Komet',
debugShowCheckedModeBanner: false,
theme: ThemeData(
useMaterial3: true,
brightness: Brightness.dark,
textTheme: GoogleFonts.interTextTheme(
ThemeData.dark().textTheme,
),
),
home: const LoginScreen(),
return DynamicColorBuilder(
builder: (ColorScheme? lightDynamic, ColorScheme? darkDynamic) {
final baseScheme = darkDynamic ?? ColorScheme.fromSeed(
seedColor: _fallbackSeed,
brightness: Brightness.dark,
);
final darkScheme = _adjustScheme(baseScheme);
return MaterialApp(
title: 'Komet',
debugShowCheckedModeBanner: false,
theme: ThemeData(
useMaterial3: true,
colorScheme: darkScheme,
textTheme: GoogleFonts.interTextTheme(
ThemeData.dark().textTheme,
),
),
home: const LoginScreen(),
);
},
);
}
}