Adds the ability to manage categories in the settings page. This includes: - Registers CategoryCubit in the dependency injection container. - Introduces a new CategoryListPage for editing categories. - Adds translations for category management related text. - Adds unselected icon color to the theme. - Updates the date format in the transaction dialog.
52 lines
1.5 KiB
Dart
52 lines
1.5 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
|
|
|
// Расширение темы для добавления пользовательских цветов.
|
|
@immutable
|
|
class CustomColors extends ThemeExtension<CustomColors> {
|
|
const CustomColors({
|
|
required this.income,
|
|
required this.expense,
|
|
this.divider, // Добавлен цвет для разделителей
|
|
this.accent, // Добавлен цвет для акцентов
|
|
this.unselectedIcon, // Цвет для невыбранных иконок
|
|
});
|
|
|
|
final Color? income;
|
|
final Color? expense;
|
|
final Color? divider;
|
|
final Color? accent;
|
|
final Color? unselectedIcon; // Цвет для невыбранных иконок
|
|
|
|
@override
|
|
CustomColors copyWith({
|
|
Color? income,
|
|
Color? expense,
|
|
Color? divider,
|
|
Color? accent,
|
|
Color? unselectedIcon,
|
|
}) {
|
|
return CustomColors(
|
|
income: income ?? this.income,
|
|
expense: expense ?? this.expense,
|
|
divider: divider ?? this.divider,
|
|
accent: accent ?? this.accent,
|
|
unselectedIcon: unselectedIcon ?? this.unselectedIcon,
|
|
);
|
|
}
|
|
|
|
@override
|
|
CustomColors lerp(ThemeExtension<CustomColors>? other, double t) {
|
|
if (other is! CustomColors) {
|
|
return this;
|
|
}
|
|
return CustomColors(
|
|
income: Color.lerp(income, other.income, t),
|
|
expense: Color.lerp(expense, other.expense, t),
|
|
divider: Color.lerp(divider, other.divider, t),
|
|
accent: Color.lerp(accent, other.accent, t),
|
|
unselectedIcon: Color.lerp(unselectedIcon, other.unselectedIcon, t),
|
|
);
|
|
}
|
|
}
|