11import 'package:bb_mobile/core/exchange/domain/entity/order.dart' ;
2+ import 'package:bb_mobile/core/themes/app_theme.dart' ;
23import 'package:bb_mobile/core/utils/build_context_x.dart' ;
34import 'package:bb_mobile/core/widgets/inputs/bb_keyboard_actions.dart' ;
45import 'package:bb_mobile/core/widgets/scrollable_column.dart' ;
6+ import 'package:bb_mobile/features/sell/presentation/bloc/sell_bloc.dart' ;
7+ import 'package:bb_mobile/features/sell/presentation/sell_failure_l10n.dart' ;
58import 'package:bb_mobile/features/sell/ui/widgets/sell_amount_currency_dropdown.dart' ;
69import 'package:bb_mobile/features/sell/ui/widgets/sell_amount_input_bottom_buttons.dart' ;
710import 'package:bb_mobile/features/sell/ui/widgets/sell_amount_input_field.dart' ;
811import 'package:flutter/material.dart' ;
12+ import 'package:flutter_bloc/flutter_bloc.dart' ;
913import 'package:gap/gap.dart' ;
1014import 'package:go_router/go_router.dart' ;
1115
@@ -68,6 +72,8 @@ class _SellScreenState extends State<SellScreen> {
6872 });
6973 },
7074 ),
75+ const Gap (16.0 ),
76+ const _SellError (),
7177 const Spacer (),
7278 SellAmountInputBottomButtons (
7379 formKey: _formKey,
@@ -91,3 +97,31 @@ class _SellScreenState extends State<SellScreen> {
9197 super .dispose ();
9298 }
9399}
100+
101+ class _SellError extends StatelessWidget {
102+ const _SellError ();
103+
104+ @override
105+ Widget build (BuildContext context) {
106+ final failure = context.select (
107+ (SellBloc bloc) => bloc.state is SellInitialState
108+ ? (bloc.state as SellInitialState ).failure
109+ : null ,
110+ );
111+
112+ if (failure == null ) return const SizedBox .shrink ();
113+
114+ return Center (
115+ child: Padding (
116+ padding: const EdgeInsets .symmetric (horizontal: 16.0 ),
117+ child: Text (
118+ failure.toTranslated (context),
119+ style: context.font.bodyMedium? .copyWith (
120+ color: context.appColors.error,
121+ ),
122+ textAlign: TextAlign .center,
123+ ),
124+ ),
125+ );
126+ }
127+ }
0 commit comments