fix styles on the add card page, move the parser to a separate file, change the styles of the page of one news item, add a parser for the subscription page, add the input field for the qr code

This commit is contained in:
2026-06-01 17:15:08 +03:00
parent 0b6757e26f
commit b9da1d3064
9 changed files with 300 additions and 307 deletions

View File

@@ -58,27 +58,10 @@ class _PromoCodeScreenContentState extends State<_PromoCodeScreenContent> {
BlocListener<PromoCodeBloc, PromoCodeState>(
listener: (context, state) {
if (state.status == PromoCodeStatus.success) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
'Промокод активирован! Баланс: ${state.newBalance?.toStringAsFixed(2)} BYN',
),
backgroundColor: Colors.green,
),
);
// Очищаем поле визуально
promoController.clear();
// Ждем чуть меньше, чтобы пользователь увидел успех
Future.delayed(const Duration(milliseconds: 1200), () {
Future.delayed(const Duration(milliseconds: 800), () {
if (mounted) Navigator.pop(context);
});
} else if (state.status == PromoCodeStatus.failure) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(state.errorMessage ?? 'Ошибка активации'),
backgroundColor: Colors.red,
),
);
}
},
child: BlocBuilder<PromoCodeBloc, PromoCodeState>(