content: import 'package:flutter/material.dart';
  import 'package:flutter_riverpod/flutter_riverpod.dart';
  import 'package:flutter_screenutil/flutter_screenutil.dart';
  import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
  import 'package:Satsails/translations/localizations.dart';
  import 'package:Satsails/helpers/swap_helpers.dart';
  
  
  class Exchange extends ConsumerStatefulWidget {
    const Exchange({super.key});
  
    @override
    _ExchangeState createState() => _ExchangeState();
  }
  
  class _ExchangeState extends ConsumerState<Exchange> {
  
    final TextEditingController controller = TextEditingController();
  
    @override
    void initState() {
      super.initState();
      // Placeholder for existing logic
      WidgetsBinding.instance.addPostFrameCallback((_) {
        final swapType = ref.read(swapTypeProvider);
        if (swapType != null) {
          ref.read(swapTypeNotifierProvider.notifier).updateProviders(swapType);
        }
      });
    }
  
    @override
    Widget build(BuildContext context) {
      return WillPopScope(
        onWillPop: () async {
          final FocusScopeNode currentFocus = FocusScope.of(context);
          if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) {
            currentFocus.unfocus();
          }
          return false;
        },
        child: Scaffold(
          backgroundColor: Colors.transparent,
          appBar: AppBar(
            backgroundColor: Colors.black,
            centerTitle: false,
            automaticallyImplyLeading: false,
            title: Text(
              'Exchange'.i18n,
              style: TextStyle(color: Colors.white, fontSize: 22.sp, fontWeight: FontWeight.bold),
            ),
          ),
          body: SafeArea(
            bottom: false,
            child: Stack(
              children: [
                const Positioned.fill(
                  child: DecoratedBox(
                    decoration: BoxDecoration(color: Colors.black),
                  ),
                ),
                KeyboardDismissOnTap(
                  child: Padding(
                    padding: EdgeInsets.symmetric(horizontal: 16.w),
                    child: Column(
                      children: [
                        SizedBox(height: 16.h),
                        Expanded(
                          child: SingleChildScrollView(
                            child: Column(
                              children: [
                                ..._buildInternalSwapWidgets(),
                                SizedBox(height: 150.h)
                              ],
                            ),
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
              ],
            ),
          ),
        ),
      );
    }
  
    List<Widget> _buildInternalSwapWidgets() {
      return [
        buildBalanceCardWithSlider(ref, controller, context),
        SizedBox(height: 16.h),
        buildExchangeCard(context, ref, controller),
        SizedBox(height: 24.h),
        slideToSend(ref, context),
      ];
    }
  }