You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudsolutions-atoms/lib/views/pages/user/update_profile_info_bottmsh...

94 lines
3.7 KiB
Dart

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);
},
),
),
],
);
}
}