Small fixes
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
- Комментируй в коде каждое изменение, которое ты делаешь, что бы мне было понятно и я учился на этом.
|
||||
- Комментарии и твои ответы должны быть на русском языке
|
||||
- When generating new Flutter code, please follow the existing coding style.
|
||||
- Цветовая палитра черно-белая
|
||||
- Все настройки цветов выноси в тему
|
||||
|
||||
## Coding Style:
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ class Category {
|
||||
return {
|
||||
'id': id,
|
||||
'name': name,
|
||||
'color': color.value, // Сохраняем только значение цвета
|
||||
'color': color.toARGB32(), // Сохраняем только значение цвета
|
||||
'icon': icon.codePoint,
|
||||
'isIncome': isIncome,
|
||||
'userId': userId, // Добавляем userId в Map
|
||||
|
||||
@@ -52,18 +52,19 @@ class _LoginPageState extends State<LoginPage> {
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
onPressed: () async { // Комментарий: Делаем onPressed асинхронным
|
||||
if (_formKey.currentState!.validate()) {
|
||||
final userService = GetIt.instance<UserService>();
|
||||
userService.createAndSetUser(
|
||||
final authBloc = context.read<AuthBloc>(); // Комментарий: Получаем AuthBloc до асинхронной операции
|
||||
await userService.createAndSetUser( // Комментарий: Используем await
|
||||
_nameController.text,
|
||||
_emailController.text,
|
||||
).then((_) {
|
||||
final user = userService.currentUser;
|
||||
if (user != null) {
|
||||
context.read<AuthBloc>().add(AuthLoggedIn(user: user));
|
||||
}
|
||||
});
|
||||
);
|
||||
if (!mounted) return; // Комментарий: Проверяем, что виджет все еще в дереве виджетов после await
|
||||
final user = userService.currentUser;
|
||||
if (user != null) {
|
||||
authBloc.add(AuthLoggedIn(user: user)); // Комментарий: Используем полученный AuthBloc
|
||||
}
|
||||
}
|
||||
},
|
||||
child: Text(localizations.loginButtonText), // Локализованный текст
|
||||
|
||||
@@ -11,7 +11,7 @@ class AppTheme {
|
||||
primary: Colors.black, // Основной цвет - черный
|
||||
secondary: Colors.grey[800]!, // Вторичный цвет - темно-серый
|
||||
surface: Colors.white, // Фон поверхностей
|
||||
background: Colors.grey[50]!, // Общий фон - очень светлый серый
|
||||
|
||||
),
|
||||
appBarTheme: const AppBarTheme(
|
||||
backgroundColor: Colors.white, // Белый фон AppBar
|
||||
@@ -49,7 +49,7 @@ class AppTheme {
|
||||
primary: Colors.white, // Основной цвет - белый
|
||||
secondary: Colors.grey[300]!, // Вторичный цвет - светлый серый
|
||||
surface: Colors.grey[900]!, // Фон поверхностей
|
||||
background: Colors.black, // Общий фон - черный
|
||||
|
||||
),
|
||||
appBarTheme: AppBarTheme(
|
||||
backgroundColor: Colors.grey[900]!, // Темно-серый фон AppBar
|
||||
|
||||
+10
-2
@@ -621,6 +621,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.1"
|
||||
sprintf:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sprintf
|
||||
sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "7.0.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -689,10 +697,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: uuid
|
||||
sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313"
|
||||
sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.7"
|
||||
version: "4.5.1"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
+6
-6
@@ -34,11 +34,11 @@ dependencies:
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
cupertino_icons: ^1.0.8
|
||||
hive_ce: ^2.11.3
|
||||
hive_ce_flutter: ^2.3.1
|
||||
get_it: ^7.2.0
|
||||
hive_ce: ^2.11.3 # Обновлено до последней версии
|
||||
hive_ce_flutter: ^2.3.1 # Обновлено до последней версии
|
||||
get_it: ^7.7.0 # Обновлено до последней версии
|
||||
path_provider: ^2.0.15
|
||||
uuid: ^3.0.7
|
||||
uuid: ^4.0.0 # Обновлено до последней версии
|
||||
logger: ^2.5.0
|
||||
flutter_bloc: ^9.1.1
|
||||
equatable: ^2.0.7
|
||||
@@ -49,11 +49,11 @@ dependencies:
|
||||
|
||||
|
||||
dev_dependencies:
|
||||
hive_ce_generator: ^1.9.2
|
||||
hive_ce_generator: ^1.9.2 # Возвращено к совместимой версии
|
||||
build_runner: ^2.4.0
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_lints: ^5.0.0
|
||||
flutter_lints: ^5.0.0 # Возвращено к совместимой версии
|
||||
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
|
||||
Reference in New Issue
Block a user