import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:nearle/views/helpers/constants/Font_constant.dart';
import 'package:nearle/controllers/rewards_controller.dart';
import 'package:nearle/views/Dashboard/profile/rewards_card.dart';

class RiderRewardsPage extends StatelessWidget {
  const RiderRewardsPage({super.key});

  @override
  Widget build(BuildContext context) {
    final RewardsController rewardsController = Get.isRegistered<RewardsController>()
        ? Get.find<RewardsController>()
        : Get.put(RewardsController());

    return Scaffold(
      backgroundColor: Colors.grey.shade100,
      appBar: AppBar(
        title: Text(
          "REWARDS",
          style: TextStyle(
            color: Colors.black,
            fontSize: FontConstants.xxxLarge(context).sp,
            fontWeight: FontWeight.bold,
            fontFamily: FontConstants.fontFamily,
          ),
        ),
        backgroundColor: Colors.grey.shade100,
        elevation: 0,
        leading: IconButton(
          icon: const Icon(Icons.arrow_back, color: Colors.black),
          onPressed: () => Navigator.pop(context),
        ),
      ),
      body: SafeArea(
        child: SingleChildScrollView(
          physics: const BouncingScrollPhysics(),
          padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 10.h),
          child: RewardsCard(
            controller: rewardsController,
            showFullDetails: true,
          ),
        ),
      ),
    );
  }
}
