import 'package:flutter/material.dart';

import '../../../../utils/resource_manager/color_manager.dart';
import '../screens/book_page.dart';

class CurrentBalanceWidget extends StatelessWidget {
  final String userBalance;
  const CurrentBalanceWidget({
    super.key,
    required this.userBalance,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
          color: ColorsManager.onPrimaryColor,
          borderRadius: BorderRadius.circular(20)),
      child: Row(
        children: [
          Expanded(
              flex: 75,
              child: Padding(
                padding: EdgeInsets.all(12),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Expanded(
                        child: Text(
                      'Current Balance',
                      style: TextStyle(
                        color: ColorsManager.blackColor,
                        fontWeight: FontWeight.bold,
                        fontSize: 17,
                      ),
                    )),
                    SizedBox(
                      height: 10,
                    ),
                    Expanded(
                        child: Row(
                      crossAxisAlignment: CrossAxisAlignment.end,
                      mainAxisAlignment: MainAxisAlignment.start,
                      children: [
                        Text(
                          userBalance,
                          style: TextStyle(
                              color: ColorsManager.blueColor1,
                              fontWeight: FontWeight.bold,
                              fontSize: 50),
                        ),
                        SizedBox(
                          width: 5,
                        ),
                        Text(
                          'Points',
                          style: TextStyle(
                              color: ColorsManager.blueColor1,
                              fontWeight: FontWeight.bold,
                              fontSize: 17),
                        ),
                      ],
                    )),
                  ],
                ),
              )),
          Expanded(
            flex: 25,
            child: InkWell(
              //TODO:should use custom Navigator
              onTap: () => Navigator.of(context).push(MaterialPageRoute(
                builder: (context) => BookPage(),
              )),
              child: Container(
                alignment: Alignment.center,
                padding: EdgeInsets.only(left: 15),
                height: double.infinity,
                decoration: BoxDecoration(
                  color: ColorsManager.blueColor,
                  borderRadius:
                      BorderRadius.horizontal(right: Radius.circular(20)),
                ),
                child: Text(
                  'Book Now',
                  style: TextStyle(
                      color: ColorsManager.onPrimaryColor,
                      fontWeight: FontWeight.bold,
                      fontSize: 20),
                ),
              ),
            ),
          )
        ],
      ),
    );
  }
}
