import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:get/get.dart';
import 'package:taafee_mobile/common/const/const.dart';
import 'package:taafee_mobile/common/extensions/widget_extension.dart';
import 'package:taafee_mobile/common/widgets/button.dart';
import 'package:taafee_mobile/common/widgets/header_screen.dart';
import 'package:taafee_mobile/common/widgets/text.dart';
import 'package:taafee_mobile/common/widgets/textfiled.dart';

import '../../../../core/routing/routing_manager.dart';

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SingleChildScrollView(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            HeaderScreen(
              "Add Rating",
            ).paddingOnly(top: 20),
            Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                const RegularTextWidget(
                  "Rate this user",
                  color: Colors.black,
                ),
                const RegularTextWidget("What you think about this user?").paddingSymmetric(vertical: 10),
                Container(
                  width: Get.width,
                  alignment: Alignment.center,
                  padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
                  decoration: BoxDecoration(
                    color: Colors.grey.withOpacity(0.5),
                    borderRadius: BorderRadius.circular(20),
                  ),
                  child: RatingBar.builder(
                    unratedColor: Colors.grey,
                    initialRating: 0,
                    minRating: 1,
                    itemSize: 40,
                    direction: Axis.horizontal,
                    allowHalfRating: false,
                    glow: false,
                    itemCount: 5,
                    // glowColor: ,
                    itemPadding: const EdgeInsets.symmetric(horizontal: 8.0),
                    itemBuilder: (context, _) => const Icon(
                      Icons.star_rounded,
                      color: Colors.amber,
                    ),
                    onRatingUpdate: (rating) {},
                  ),
                ),
                TextFieldWidget(
                  maxLines: 7,
                  textInputAction: TextInputAction.newline,
                  onChange: (value) {},
                  keyboardType: TextInputType.multiline,
                  label: "",
                  validate: (value) {
                    return null;
                  },
                  height: Get.height * .3,
                ).paddingOnly(top: 30),
                ButtonWidget(
                  onTap: () {
                    RoutingManager.back();
                  },
                  title: "Done",
                  width: Get.width * .3,
                ).center()
              ],
            ).paddingSymmetric(horizontal: 30, vertical: 20),
          ],
        ),
      ),
    ).makeSafeArea();
  }
}
