sync changes
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:be_happy/presentation/viewmodel/payment_methods_bloc.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
@@ -6,6 +7,7 @@ import '../../core/app_colors.dart';
|
||||
import '../components/custom_app_bar.dart';
|
||||
import '../components/card_input_field.dart'; // ← новый импорт
|
||||
import '../components/utils/card_formatter.dart';
|
||||
import '../event/payment_methods_event.dart';
|
||||
import '../viewmodel/add_card_bloc.dart';
|
||||
import '../event/add_card_event.dart';
|
||||
import '../state/add_card_state.dart';
|
||||
@@ -28,7 +30,6 @@ class AddCardScreen extends StatelessWidget {
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
// 🔹 ВЕРХНЯЯ ЧАСТЬ (шапка + форма)
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
@@ -37,7 +38,6 @@ class AddCardScreen extends StatelessWidget {
|
||||
const CustomAppBar(title: 'Добавление карты'),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// 🔹 ОСНОВНОЙ КОНТЕЙНЕР С ПОЛЯМИ
|
||||
Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
@@ -46,7 +46,6 @@ class AddCardScreen extends StatelessWidget {
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// Номер карты
|
||||
BlocBuilder<AddCardBloc, AddCardState>(
|
||||
builder: (context, state) {
|
||||
return CardInputField(
|
||||
@@ -60,7 +59,6 @@ class AddCardScreen extends StatelessWidget {
|
||||
],
|
||||
letterSpacing: 2,
|
||||
onChanged: (value) {
|
||||
// Очищаем от пробелов перед отправкой в BLoC
|
||||
final cleanValue = value.replaceAll(' ', '');
|
||||
context.read<AddCardBloc>().add(CardNumberChanged(cleanValue));
|
||||
},
|
||||
@@ -137,7 +135,6 @@ class AddCardScreen extends StatelessWidget {
|
||||
|
||||
const SizedBox(height: 20),
|
||||
|
||||
// 🔹 КНОПКА "ДОБАВИТЬ КАРТУ"
|
||||
BlocBuilder<AddCardBloc, AddCardState>(
|
||||
builder: (context, state) {
|
||||
return Container(
|
||||
@@ -153,7 +150,8 @@ class AddCardScreen extends StatelessWidget {
|
||||
? () => {
|
||||
context.read<AddCardBloc>().add(
|
||||
AddCardSubmitted()),
|
||||
context.go("/home/payment-methods")
|
||||
context.read<PaymentMethodsBloc>()..add(PaymentMethodsStarted()),
|
||||
context.pop()
|
||||
}
|
||||
: null,
|
||||
borderRadius: BorderRadius.circular(
|
||||
@@ -205,7 +203,6 @@ class AddCardScreen extends StatelessWidget {
|
||||
horizontal: 20, vertical: 24),
|
||||
child: Column(
|
||||
children: [
|
||||
// Текст о безопасности
|
||||
const Text(
|
||||
'Мы не сохраняем данные карты у себя. Оплата происходит '
|
||||
'через сертифицированный провайдер Беларуси bePaid. '
|
||||
@@ -221,10 +218,6 @@ class AddCardScreen extends StatelessWidget {
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// Логотипы платёжных систем
|
||||
|
||||
const SizedBox(height: 24),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -178,7 +178,7 @@ class OrderHistoryDetailScreen extends StatelessWidget {
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.3),
|
||||
borderRadius: BorderRadius.circular(12), // Опционально: скругление углов
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Text(
|
||||
order.status == 'Paid' ? 'ОПЛАЧЕН' : 'НЕ ОПЛАЧЕН',
|
||||
@@ -262,7 +262,7 @@ class OrderHistoryDetailScreen extends StatelessWidget {
|
||||
const SizedBox(height: 12),
|
||||
_DetailRow(
|
||||
label: 'Страховка',
|
||||
value: order.isInsurance ? '1 руб' : '—',
|
||||
value: order.isInsurance ? "${order.insurancePrice} руб." : '—',
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -3,7 +3,9 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import '../../core/app_colors.dart';
|
||||
import '../components/code_dots.dart';
|
||||
import '../event/map_event.dart';
|
||||
import '../event/spalsh_event.dart';
|
||||
import '../viewmodel/map_bloc.dart';
|
||||
import '../viewmodel/pin_bloc.dart';
|
||||
import '../event/pin_event.dart';
|
||||
import '../state/pin_state.dart';
|
||||
@@ -143,6 +145,24 @@ class _PinLoginScreenState extends State<PinLoginScreen> {
|
||||
style: const TextStyle(color: AppColors.white70),
|
||||
),
|
||||
|
||||
const SizedBox(height: 20),
|
||||
|
||||
if (state is! PinCreateInProgress)
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
context.read<MapBloc>().add(LogoutPressed());
|
||||
context.read<SplashBloc>().add(AuthCheckRequested());
|
||||
},
|
||||
child: const Text(
|
||||
"Забыли PIN-код?",
|
||||
style: TextStyle(
|
||||
color: AppColors.whiteText,
|
||||
decoration: TextDecoration.underline,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 40),
|
||||
|
||||
],
|
||||
|
||||
@@ -2,9 +2,11 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import '../../core/app_colors.dart';
|
||||
import '../../di/service_locator.dart';
|
||||
import '../../domain/entities/payment_card.dart';
|
||||
import '../../domain/usecase/get_payment_cards_usecase.dart';
|
||||
import '../components/app_checkbox.dart';
|
||||
import '../components/custom_app_bar.dart'; // ✅ Уже есть
|
||||
import '../components/gradient_button.dart';
|
||||
import '../components/payment_option.dart';
|
||||
@@ -51,7 +53,6 @@ class TopUpScreen extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
_buildCardSelector(state, context),
|
||||
_buildAddCardButton(() => context.push("/home/payment-methods/add-card")),
|
||||
const SizedBox(height: 20),
|
||||
_buildAgreement(state, context),
|
||||
const Spacer(),
|
||||
@@ -159,7 +160,6 @@ class TopUpScreen extends StatelessWidget {
|
||||
subtitle: '****${state.selectedCard!.cardLastNumber}',
|
||||
isSelected: true,
|
||||
onTap: () async {
|
||||
// Открываем модалку как вложенную, не закрывая текущую
|
||||
final selectedCard = await showModalBottomSheet<PaymentCard>(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
@@ -236,18 +236,22 @@ class TopUpScreen extends StatelessWidget {
|
||||
|
||||
Widget _buildAgreement(TopUpState state, BuildContext context) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Checkbox(
|
||||
AppCheckbox(
|
||||
value: state.isAgreed,
|
||||
onChanged: (v) =>
|
||||
context.read<TopUpBloc>().add(ToggleAgreement(v ?? false)),
|
||||
side: const BorderSide(color: Colors.white54),
|
||||
),
|
||||
const Expanded(
|
||||
child: Text(
|
||||
'Я принимаю условия покупки бонусного пакета, при котором денежные средства не подлежат возврату...',
|
||||
style: TextStyle(color: Colors.white54, fontSize: 12),
|
||||
const SizedBox(width: 12),
|
||||
Flexible(
|
||||
child: Text.rich(
|
||||
TextSpan(
|
||||
text: 'Я принимаю условия покупки бонусного пакета, при котором денежные средства не подлежат возврату... ',
|
||||
style: const TextStyle(
|
||||
color: AppColors.white70,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -266,23 +270,4 @@ class TopUpScreen extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAddCardButton(VoidCallback onPressed) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: OutlinedButton.icon(
|
||||
onPressed: onPressed,
|
||||
icon: const Icon(Icons.add, color: Colors.white),
|
||||
label: const Text(
|
||||
'Добавить платежную карту',
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
style: OutlinedButton.styleFrom(
|
||||
side: const BorderSide(color: Colors.white54),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user