Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
6.0 kB
1
Indexable
Never
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:get/get.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: "About You", pageCount: 1),
      backgroundColor: AppColors.white,
      resizeToAvoidBottomInset: true,
      body: SingleChildScrollView(
        scrollDirection: Axis.vertical,
        child: Padding(
          padding: EdgeInsets.symmetric(vertical: 20.w),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              CommonWidgets.userInfoField(
                title: "What's your first name(s)?",
                hintText: "e.g. John",
                focusNode: controller.firstNameFocusNode,
                onChanged: (value) {
                  controller.firstName = value;
                },
              ),
              CommonWidgets.userInfoField(
                title: "What's your last name(s)?",
                hintText: 'e.g. Adams',
                focusNode: controller.lastNameFocusNode,
                onChanged: (value) {
                  controller.lastName = value;
                },
              ),
              CommonWidgets.userInfoField(
                title: "What's your date of birth?",
                hintText: 'DD/MM/YY',
                focusNode: controller.dobFocusNode,
                onChanged: (value) {
                  controller.dob = value;
                },
              ),
              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.symmetric(horizontal: 20.w, vertical: 10.h),
                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: StaggeredGrid.count(
                        crossAxisCount: 3,
                        children: List.generate(
                          controller.movingAbroadWithList.length,
                          (index) => Container(
                            margin: EdgeInsets.only(right: 10.w),
                            alignment: Alignment.centerLeft,
                            child: 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],
                                overflow: TextOverflow.visible,
                              ),
                              backgroundColor: controller.isSelected[index]
                                  ? AppColors.primaryColorLight
                                  : AppColors.white,
                              labelStyle: TextStyle(
                                color: controller.isSelected[index]
                                    ? AppColors.white
                                    : AppColors.darkBrown,
                              ),
                            ),
                          ),
                        ),
                      ),
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
Leave a Comment