Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
5.2 kB
1
Indexable
Never
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:rooty/theme/app_colors.dart';
import 'package:rooty/widgets/common_widgets.dart';
import 'about_you_screen_logic.dart';

class AboutYouScreenView extends GetView<AboutYouScreenLogic> {
  const AboutYouScreenView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CommonWidgets.commonAppBar(title: "AboutYou", pageCount: 1),
      backgroundColor: AppColors.white,
      resizeToAvoidBottomInset: true,
      body: SingleChildScrollView(
        scrollDirection: Axis.vertical,
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            CommonWidgets.userInfoField(
                title: "What's your first name(s)?", hintText: "e.g. John"),
            CommonWidgets.userInfoField(
                title: "What's your last name(s)?", hintText: 'e.g. Adams'),
            CommonWidgets.userInfoField(
                title: "What's your date of birth?", hintText: 'DD/MM/YY'),
            CommonWidgets.dropDownTextField(
              title: "Which university/college have you enrolled in abroad?",
              hintText: "e.g.  University College Cork",
              textController: controller.universityTextController,
              itemList: controller.itemList,
            ),
            CommonWidgets.dropDownTextField(
              title: "What study level are you pursuing?",
              hintText: "e.g.  Post Graduate",
              textController: controller.universityTextController,
              itemList: controller.itemList,
            ),
            CommonWidgets.dropDownTextField(
              title: "What course area are you interested in?",
              hintText: "e.g.  Law",
              textController: controller.universityTextController,
              itemList: controller.itemList,
            ),
            Padding(
              padding: EdgeInsets.only(left: 20.w),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    "Who are you moving abroad with?",
                    style: TextStyle(
                      color: AppColors.darkBrown,
                      fontSize: 14.sp,
                      fontWeight: FontWeight.w800,
                    ),
                  ),
                  SizedBox(
                    height: 200.h,
                    width: Get.width,
                    child: GridView.builder(
                        shrinkWrap: true,
                        physics: const NeverScrollableScrollPhysics(),
                        gridDelegate:
                            const SliverGridDelegateWithFixedCrossAxisCount(
                          crossAxisCount: 3,
                          crossAxisSpacing: 0,
                          mainAxisSpacing: 10,
                          childAspectRatio: 3,
                        ),
                        padding: EdgeInsets.only(left: 0, right: 10.w, top: 20.h),
                        itemCount: controller.movingAbroadWithList.length,
                        itemBuilder: (_, index) {
                          return Obx(() {
                            return ActionChip(
                              onPressed: () {
                                controller.isSelected[index] =
                                    !controller.isSelected[index];
                              },
                              shape: RoundedRectangleBorder(
                                borderRadius: BorderRadius.circular(50),
                                side: BorderSide(
                                  color: controller.isSelected[index]
                                      ? AppColors.shadowColor.withAlpha(40)
                                      : AppColors.darkBrown,
                                ),
                              ),
                              padding: EdgeInsets.all(10.w),
                              avatar: Icon(Icons.person, color: controller.isSelected[index]
                                  ? AppColors.white : AppColors.darkBrown,),
                              label:
                                  Text(controller.movingAbroadWithList[index]),
                              backgroundColor: controller.isSelected[index]
                                  ? AppColors.primaryColorLight
                                  : AppColors.white,
                              labelStyle: TextStyle(
                                color: controller.isSelected[index]
                                  ? AppColors.white : AppColors.darkBrown,
                              ),
                            );
                          });
                        }),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
Leave a Comment