import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:yumi/app_localizations.dart';
import 'package:yumi/ui_kit/components/text/sc_text.dart';
import 'package:yumi/app/constants/sc_global_config.dart';

import 'package:yumi/ui_kit/widgets/room_reward_countdown_timer.dart';

class RoomRewardRulePage extends StatefulWidget {
  @override
  _RoomRewardRulePageState createState() => _RoomRewardRulePageState();
}

class _RoomRewardRulePageState extends State<RoomRewardRulePage> {
  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Container(
        height: ScreenUtil().screenHeight * 0.85,
        width: ScreenUtil().screenWidth,
        decoration: BoxDecoration(
          image: DecorationImage(
            image: AssetImage("sc_images/room/sc_icon_room_reward_bg.png"),
            fit: BoxFit.fill,
          ),
        ),
        child: Column(
          children: [
            SizedBox(height: 38.w),
            Stack(
              alignment: Alignment.center,
              children: [
                Image.asset(
                  SCGlobalConfig.lang == "ar"
                      ? "sc_images/room/sc_icon_room_reward_rule_title_ar.png"
                      : "sc_images/room/sc_icon_room_reward_rule_title_en.png",
                  width: 190.w,
                ),
                Row(
                  children: [
                    SizedBox(width: 20.w),
                    Transform.flip(
                      flipX: SCGlobalConfig.lang == "ar" ? true : false, // 水平翻转
                      flipY: false, // 垂直翻转设为 false
                      child: GestureDetector(
                        child: Image.asset(
                          "sc_images/room/sc_icon_roomgift_rule_back_bg.png",
                          width: 20.w,
                        ),
                        onTap: () {
                          SmartDialog.dismiss(tag: "showRoomRewardRulePage");
                        },
                      ),
                    ),
                  ],
                ),
              ],
            ),
            Expanded(
              child: SingleChildScrollView(
                child: Container(
                  margin: EdgeInsets.symmetric(
                    horizontal: 15.w,
                  ).copyWith(top: 15.w),
                  child: Image.asset(
                    SCGlobalConfig.lang == "ar"
                        ? "sc_images/room/sc_icon_room_reward_rule_content_ar.png"
                        : "sc_images/room/sc_icon_room_reward_rule_content_en.png",
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
