import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:traderscircuit/Utils/Common/CommonAppbar.dart';
import 'package:traderscircuit/Utils/Common/commonBotton.dart';
import 'package:traderscircuit/Utils/text.dart';
import 'package:traderscircuit/resources/routes/route_name.dart';
import 'package:traderscircuit/view/onBoarding/splashScreen1.dart';

import '../../Utils/Common/custom_drop_down.dart';

class UpdateRiskProfile extends StatefulWidget {
  const UpdateRiskProfile({super.key});

  @override
  State<UpdateRiskProfile> createState() => _UpdateRiskProfileState();
}

class _UpdateRiskProfileState extends State<UpdateRiskProfile> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CommonAppbar(
        titleTxt: "Update Risk Profile",
        customActionWidget: text16W400(""),
      ),
      backgroundColor: Colors.black,
      extendBody: true,
      body: Stack(
        children: [
          const CommonBlurLeft(),
          const CommonBlurRight(),
          Stack(
            children: [
              Padding(
                padding:
                    const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
                child: ListView(
                  physics: const BouncingScrollPhysics(),
                  // mainAxisAlignment: MainAxisAlignment.start,
                  // crossAxisAlignment: CrossAxisAlignment.start,

                  children: [
                    updateRiskProfileData(
                      "What is your investment goal?",
                      "Select your goal",
                    ),
                    updateRiskProfileData(
                      "Add Investment Experience field",
                      "Select your Experience",
                    ),
                    updateRiskProfileData(
                      "What types of stocks do you prefer?",
                      "Select types of stock",
                    ),
                    updateRiskProfileData(
                      "What is your Risk Perception?",
                      "Select your Perception",
                    ),
                    updateRiskProfileData(
                      "What is your favoured Market Condition?",
                      "Select Condition",
                    ),
                    updateRiskProfileData(
                      "What is your Emotional Response to Market Volatility?",
                      "Choose your query",
                    ),
                    SizedBox(
                      height: 70.h,
                    ),
                    CommonBtn(
                      text: "Submit",
                      onTap: () {
                        Get.toNamed(RouteName.mainscreen);
                      },
                    ),
                    SizedBox(
                      height: 10.h,
                    ),
                  ],
                ),
              ),
            ],
          ),
        ],
      ),
    );
  }
}

Widget updateRiskProfileData(
  String tilte,
  String headerText,
) {
  return Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: [
      text18W400(tilte),
      SizedBox(
        height: 15.h,
      ),
      CustomDropDownWidget(
        header: headerText,
        listData: dropHeader[headerText]!,
      ),
      SizedBox(
        height: 35.h,
      ),
    ],
  );
}

Map<String, List<String>> dropHeader = {
  "Select your goal": [
    "Wealth Preservation",
    "Capital Growth",
    "Income Generation",
    "Retirement Planning"
  ],
  "Select your Experience": [
    "No Experience",
    "Beginner (0 - 3 months)",
    "Intermediate (3 - 12 months)",
    "Expert ( > 12 months)",
    "Professional ( 3 - 5 years )"
  ],
  "Select types of stock": [
    "Swing Trade",
    "Options",
    "Multibagger",
    "Long term",
  ],
  "Select your Perception": [
    "Very Conservative",
    "Conservative",
    "Moderate",
    "Aggressive",
  ],
  "Select Condition": [
    "Bullish",
    "Neutral",
    "Bearish",
  ],
  "Choose your query": [
    "Calm",
    "Neutral",
    "Anxious",
    "Stressed",
  ],
};
