import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:loader_overlay/loader_overlay.dart';

import '../../../app.dart';
import 'widgets/personal_info_form.dart';

class PersonalInformationPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetBuilder<AddressController>(
      init: AddressController(),
      builder: (ac) => Scaffold(
        backgroundColor: ThemeColor.white,
        // resizeToAvoidBottomInset: false,
        appBar: CustomAppbarWidget(
          leading: AppBarBackBtn(),
          elevation: 1.5,
        ),
        body: Padding(
          padding: EdgeInsets.symmetric(horizontal: 16.w),
          child: SingleChildScrollView(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                PersonalInfoForm(),
                SizedBox(height: 50.h),
                LoaderOverlay(
                  useDefaultLoading: false,
                  overlayColor: Colors.transparent,
                  overlayWidget: CustomLoader(),
                  child: AddressList(
                    title: 'our_address'.tr,
                    isSelectable: false,
                    callback: (address) => ac.deleteAddress(context, address),
                  ),
                ),
                AppTheme.appSizeDivider20H,
              ],
            ),
          ),
        ),
      ),
    );
  }
}
