|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart';
|
|
|
|
|
import 'package:test_sa/views/pages/user/profile_page.dart';
|
|
|
|
|
|
|
|
|
|
class UpdateProfileInfoBottmsheet extends StatelessWidget {
|
|
|
|
|
UpdateUserInfoModel userInfoModel;
|
|
|
|
|
|
|
|
|
|
UpdateProfileInfoBottmsheet({super.key, required this.userInfoModel});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
"Email".bodyText(context).custom(color: AppColor.black20),
|
|
|
|
|
8.height,
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
labelText: "Email",
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
initialValue: userInfoModel.email,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
textInputType: TextInputType.emailAddress,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
userInfoModel.email = value;
|
|
|
|
|
},
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
"Phone Number".bodyText(context).custom(color: AppColor.black20),
|
|
|
|
|
8.height,
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
labelText: "Phone Number",
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
initialValue: userInfoModel.phoneNo,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
textInputType: TextInputType.phone,
|
|
|
|
|
showShadow: false,
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
userInfoModel.phoneNo = value;
|
|
|
|
|
},
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
"Extension No".bodyText(context).custom(color: AppColor.black20),
|
|
|
|
|
8.height,
|
|
|
|
|
AppTextFormField(
|
|
|
|
|
labelText: "Extension No",
|
|
|
|
|
backgroundColor: AppColor.neutral100,
|
|
|
|
|
initialValue: userInfoModel.extensionNo,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
labelStyle: AppTextStyles.textFieldLabelStyle,
|
|
|
|
|
textInputType: const TextInputType.numberWithOptions(decimal: true),
|
|
|
|
|
showShadow: false,
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
userInfoModel.extensionNo = value;
|
|
|
|
|
},
|
|
|
|
|
style: Theme.of(context).textTheme.titleMedium,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).toShadowContainer(context).paddingAll(16),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 16.toScreenHeight),
|
|
|
|
|
color: AppColor.white10,
|
|
|
|
|
child: AppFilledButton(
|
|
|
|
|
label: "Update",
|
|
|
|
|
buttonColor: AppColor.neutral50,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
//TODO call update api here...
|
|
|
|
|
// showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
|
|
|
|
|
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|