ui improvements

export_module_ui_ux_enhancement_signup
Sikander Saleem 1 day ago
parent 7186fb13c0
commit 15187d30f4

@ -276,7 +276,7 @@ class UserProvider extends ChangeNotifier {
// } // }
// return response.statusCode; // return response.statusCode;
// } // }
Future<GeneralResponseModel> sendForgetPasswordOtp({required BuildContext context, required String employeeId}) async { Future<GeneralResponseModel> sendForgetPasswordOtp({required BuildContext context, required String employeeId, required String typeSend}) async {
GeneralResponseModel generalResponseModel = GeneralResponseModel(responseCode: -1); GeneralResponseModel generalResponseModel = GeneralResponseModel(responseCode: -1);
if (_loading == true) return generalResponseModel; if (_loading == true) return generalResponseModel;
_loading = true; _loading = true;
@ -284,7 +284,7 @@ class UserProvider extends ChangeNotifier {
Response response; Response response;
try { try {
showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading()); showDialog(context: context, barrierDismissible: false, builder: (context) => const AppLazyLoading());
response = await ApiManager.instance.post(URLs.sendForgetPasswordOtp + '?employeeId=$employeeId', showToast: false, body: {}); response = await ApiManager.instance.post(URLs.sendForgetPasswordOtp, showToast: false, body: {"employeeId": employeeId, "typeSend": typeSend});
generalResponseModel = GeneralResponseModel.fromJson(json.decode(response.body)); generalResponseModel = GeneralResponseModel.fromJson(json.decode(response.body));
_loading = false; _loading = false;
if (response.statusCode >= 200 && response.statusCode < 300) { if (response.statusCode >= 200 && response.statusCode < 300) {

@ -72,81 +72,82 @@ class _ApplicationDemoRequestFormScreenState extends State<ApplicationDemoReques
autovalidateMode: AutovalidateMode.disabled, autovalidateMode: AutovalidateMode.disabled,
child: Column( child: Column(
children: [ children: [
Column( SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.all(16),
children: [ child: Column(
AppTextFormField( crossAxisAlignment: CrossAxisAlignment.start,
controller: _fullNameController, mainAxisSize: MainAxisSize.min,
labelText: 'Full Name *', spacing: 12,
textInputType: TextInputType.name, children: [
validator: (value) { AppTextFormField(
if (!_formSubmitted && _fullNameController.text.isEmpty) return null; controller: _fullNameController,
if (_fullNameController.text.isEmpty) return 'Full Name is required'; labelText: 'Full Name *',
return null; textInputType: TextInputType.name,
}, validator: (value) {
), if (!_formSubmitted && _fullNameController.text.isEmpty) return null;
16.height, if (_fullNameController.text.isEmpty) return 'Full Name is required';
AppTextFormField( return null;
controller: _emailController, },
labelText: 'Email Address *', ),
textInputType: TextInputType.emailAddress, AppTextFormField(
validator: (value) { controller: _emailController,
if (!_formSubmitted && _emailController.text.isEmpty) return null; labelText: 'Email Address *',
if (_emailController.text.isEmpty) return 'Email is required'; textInputType: TextInputType.emailAddress,
if (!Validator.isEmail(_emailController.text)) return 'Invalid email format'; validator: (value) {
return null; if (!_formSubmitted && _emailController.text.isEmpty) return null;
}, if (_emailController.text.isEmpty) return 'Email is required';
), if (!Validator.isEmail(_emailController.text)) return 'Invalid email format';
16.height, return null;
AppTextFormField( },
controller: _mobileController, ),
labelText: 'Mobile Number *', AppTextFormField(
textInputType: TextInputType.phone, controller: _mobileController,
validator: (value) { labelText: 'Mobile Number *',
if (!_formSubmitted && _mobileController.text.isEmpty) return null; textInputType: TextInputType.phone,
if (_mobileController.text.isEmpty) return 'Mobile Number is required'; validator: (value) {
if (!Validator.isPhoneNumber(_mobileController.text)) return 'Invalid mobile number'; if (!_formSubmitted && _mobileController.text.isEmpty) return null;
return null; if (_mobileController.text.isEmpty) return 'Mobile Number is required';
}, if (!Validator.isPhoneNumber(_mobileController.text)) return 'Invalid mobile number';
), return null;
16.height, },
AppTextFormField( ),
controller: _companyNameController, AppTextFormField(
labelText: 'Company Name *', controller: _companyNameController,
textInputType: TextInputType.text, labelText: 'Company Name *',
validator: (value) { textInputType: TextInputType.text,
if (!_formSubmitted && _companyNameController.text.isEmpty) return null; validator: (value) {
if (_companyNameController.text.isEmpty) return 'Company Name is required'; if (!_formSubmitted && _companyNameController.text.isEmpty) return null;
return null; if (_companyNameController.text.isEmpty) return 'Company Name is required';
}, return null;
), },
16.height, ),
MultipleItemDropDownMenu<ApplicationDemoRoleModel, NullableLoadingProvider>( MultipleItemDropDownMenu<ApplicationDemoRoleModel, NullableLoadingProvider>(
context: context, context: context,
title: 'Select Roles *', title: 'Select Roles *',
initialValue: _selectedRoles, initialValue: _selectedRoles,
staticData: provider.roles, staticData: provider.roles,
loading: provider.roleLoading, loading: provider.roleLoading,
showAsFullScreenDialog: true, showAsFullScreenDialog: true,
onSelect: (selectedRoles) { onSelect: (selectedRoles) {
setState(() { setState(() {
_selectedRoles = selectedRoles ?? []; _selectedRoles = selectedRoles ?? [];
_rolesValidationError = null; // Clear error when roles are selected _rolesValidationError = null; // Clear error when roles are selected
}); });
}, },
), ),
if (_rolesValidationError != null) if (_rolesValidationError != null)
Padding( Padding(
padding: const EdgeInsets.only(top: 8, left: 16), padding: const EdgeInsets.only(top: 8, left: 16),
child: Text( child: Text(
_rolesValidationError!, _rolesValidationError!,
style: AppTextStyles.tinyFont.copyWith( style: AppTextStyles.tinyFont.copyWith(
color: AppColor.red30, color: AppColor.red30,
),
), ),
), ),
), ],
], ).toShadowContainer(context, borderRadius: 20),
).paddingAll(16).expanded, ).expanded,
FooterActionButton.footerContainer( FooterActionButton.footerContainer(
context: context, context: context,
child: AppFilledButton( child: AppFilledButton(

@ -5,6 +5,7 @@ import 'package:test_sa/controllers/validator/validator.dart';
import 'package:test_sa/extensions/int_extensions.dart'; import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart';
import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart';
import 'package:test_sa/modules/signup/models/company_model.dart'; import 'package:test_sa/modules/signup/models/company_model.dart';
import 'package:test_sa/modules/signup/models/group_model.dart'; import 'package:test_sa/modules/signup/models/group_model.dart';
import 'package:test_sa/modules/signup/models/signup_request_model.dart'; import 'package:test_sa/modules/signup/models/signup_request_model.dart';
@ -95,41 +96,35 @@ class _SignUpScreenState extends State<SignUpScreen> {
appBar: const DefaultAppBar(title: "Sign Up"), appBar: const DefaultAppBar(title: "Sign Up"),
body: Column( body: Column(
children: [ children: [
Expanded( SingleChildScrollView(
padding: EdgeInsets.all(16.toScreenWidth),
child: Form( child: Form(
key: _formKey, key: _formKey,
child: SingleChildScrollView( child: Column(
padding: EdgeInsets.all(16.toScreenWidth), mainAxisSize: MainAxisSize.min,
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, spacing: 12,
children: [ children: [
_buildAssetGroupDropdown(), _buildAssetGroupDropdown(),
16.height, // 16.height,
if (_selectedAssetGroup != null) ...[ if (_selectedAssetGroup != null) ...[
_buildCompanyDropdown(), _buildCompanyDropdown(),
16.height, // 16.height,
],
if (_selectedCompany != null) ..._buildDynamicFields(),
], ],
), if (_selectedCompany != null) ..._buildDynamicFields(),
), ],
).toShadowContainer(context, borderRadius: 20),
), ),
), ).expanded,
if (_selectedCompany != null) if (_selectedCompany != null)
Container( FooterActionButton.footerContainer(
padding: EdgeInsets.all(16.toScreenWidth), context: context,
decoration: BoxDecoration( child: AppFilledButton(
color: AppColor.background(context), label: "Submit",
boxShadow: [ maxWidth: true,
BoxShadow( loading: _isSubmitting,
color: Colors.black.withOpacity(0.05), disableButton: _isSubmitting,
blurRadius: 10, onPressed: _submitForm,
offset: const Offset(0, -2),
),
],
),
child: SafeArea(
child: _buildSubmitButton(),
), ),
), ),
], ],
@ -199,20 +194,20 @@ class _SignUpScreenState extends State<SignUpScreen> {
if (_isHMGGroup) { if (_isHMGGroup) {
return [ return [
_buildEmployeeIdField(), _buildEmployeeIdField(),
16.height, // 16.height,
if (_employeeFetched) ...[ if (_employeeFetched) ...[
_buildReadOnlyField("Full Name", _fullNameController), _buildReadOnlyField("Full Name", _fullNameController),
_buildReadOnlyField("Email Address", _emailController), _buildReadOnlyField("Email Address", _emailController),
_buildReadOnlyField("Mobile Number", _mobileController), _buildReadOnlyField("Mobile Number", _mobileController),
// _buildReadOnlyField("Site", _siteController), // _buildReadOnlyField("Site", _siteController),
// _buildReadOnlyField("Department", _departmentController), // _buildReadOnlyField("Department", _departmentController),
16.height, // 16.height,
_buildExtensionField(), _buildExtensionField(),
16.height, // 16.height,
_buildSiteDropdown(), _buildSiteDropdown(),
16.height, // 16.height,
_buildDepartmentDropdown(), _buildDepartmentDropdown(),
16.height, // 16.height,
_buildRoleField(), _buildRoleField(),
], ],
]; ];
@ -220,17 +215,17 @@ class _SignUpScreenState extends State<SignUpScreen> {
return [ return [
// Employee ID is auto-generated for Non-HMG, so not shown during signup // Employee ID is auto-generated for Non-HMG, so not shown during signup
_buildFullNameField(), _buildFullNameField(),
16.height, // 16.height,
_buildEmailField(), _buildEmailField(),
16.height, // 16.height,
_buildMobileField(), _buildMobileField(),
16.height, // 16.height,
_buildExtensionField(), _buildExtensionField(),
16.height, // 16.height,
_buildSiteDropdown(), _buildSiteDropdown(),
16.height, // 16.height,
_buildDepartmentDropdown(), _buildDepartmentDropdown(),
16.height, // 16.height,
_buildRoleField(), _buildRoleField(),
]; ];
} }
@ -285,7 +280,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
} }
Widget _buildReadOnlyField(String label, TextEditingController controller) { Widget _buildReadOnlyField(String label, TextEditingController controller) {
if(controller.text.isEmpty) { if (controller.text.isEmpty) {
return const SizedBox(); return const SizedBox();
} }
return Column( return Column(
@ -403,16 +398,6 @@ class _SignUpScreenState extends State<SignUpScreen> {
); );
} }
Widget _buildSubmitButton() {
return AppFilledButton(
label: "Submit",
maxWidth: true,
loading: _isSubmitting,
disableButton: _isSubmitting,
onPressed: _submitForm,
);
}
Future<void> _fetchEmployeeDetails(String employeeId) async { Future<void> _fetchEmployeeDetails(String employeeId) async {
final employee = await _signUpProvider.getEmployeeFromERP(employeeId); final employee = await _signUpProvider.getEmployeeFromERP(employeeId);
@ -436,7 +421,7 @@ class _SignUpScreenState extends State<SignUpScreen> {
_emailController.text = employee.employeeEmailAddress ?? ''; _emailController.text = employee.employeeEmailAddress ?? '';
_mobileController.text = employee.employeeMobileNumber ?? ''; _mobileController.text = employee.employeeMobileNumber ?? '';
//Todo need to map site and department from ERP data //Todo need to map site and department from ERP data
_departmentController.text = ''; _departmentController.text = '';
_siteController.text = employee.branchCode ?? ''; _siteController.text = employee.branchCode ?? '';
}); });
} else { } else {

@ -12,6 +12,7 @@ import 'package:test_sa/models/new_models/general_response_model.dart';
import 'package:test_sa/new_views/app_style/app_color.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_filled_button.dart';
import 'package:test_sa/new_views/forget_password_module/reset_password_view.dart'; import 'package:test_sa/new_views/forget_password_module/reset_password_view.dart';
import 'package:test_sa/views/widgets/item_views/info_text_widget.dart';
class ForgetPasswordVerifyOtpView extends StatefulWidget { class ForgetPasswordVerifyOtpView extends StatefulWidget {
Map<String, dynamic> data = {}; Map<String, dynamic> data = {};
@ -65,9 +66,9 @@ class _ForgetPasswordVerifyOtpViewState extends State<ForgetPasswordVerifyOtpVie
color: Colors.black, color: Colors.black,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColor.white10, color: AppColor.background(context),
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
border: Border.all(color: AppColor.white10, width: 1), border: Border.all(color: AppColor.borderColor(context), width: 1),
), ),
); );
@ -82,17 +83,17 @@ class _ForgetPasswordVerifyOtpViewState extends State<ForgetPasswordVerifyOtpVie
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
context.translation.otpVerification.heading2(context).custom(color: AppColor.white936, fontWeight: FontWeight.w500), Text(context.translation.otpVerification, style: AppTextStyles.heading2.copyWith(color: AppColor.headingTextColor(context), fontWeight: FontWeight.w500)),
8.height, 8.height,
'${context.translation.pleaseEnterTheOtpSentTo} ${widget.data['phoneNumber']}'.bodyText2(context).custom(color: AppColor.neutral120, fontWeight: FontWeight.w500), InfoTextLabelWidget(label: '${context.translation.pleaseEnterTheOtpSentTo} ${widget.data['phoneNumber']}'),
40.height, 32.height,
Center( Center(
child: Pinput( child: Pinput(
length: 4, length: 4,
defaultPinTheme: defaultPinTheme, defaultPinTheme: defaultPinTheme,
focusedPinTheme: defaultPinTheme.copyWith( focusedPinTheme: defaultPinTheme.copyWith(
decoration: defaultPinTheme.decoration?.copyWith( decoration: defaultPinTheme.decoration?.copyWith(
border: Border.all(color: AppColor.neutral40, width: 1), border: Border.all(color: AppColor.borderColor(context), width: 1),
), ),
), ),
onCompleted: (pin) { onCompleted: (pin) {
@ -112,10 +113,7 @@ class _ForgetPasswordVerifyOtpViewState extends State<ForgetPasswordVerifyOtpVie
? () async { ? () async {
UserProvider _userProvider = Provider.of<UserProvider>(context, listen: false); UserProvider _userProvider = Provider.of<UserProvider>(context, listen: false);
String employeeId = widget.data['employeeId']; String employeeId = widget.data['employeeId'];
GeneralResponseModel response = await _userProvider.sendForgetPasswordOtp( GeneralResponseModel response = await _userProvider.sendForgetPasswordOtp(context: context, employeeId: employeeId, typeSend: widget.data['typeSend']);
context: context,
employeeId: employeeId,
);
// Restart the timer // Restart the timer
_startTimer(); _startTimer();

@ -11,6 +11,8 @@ 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_filled_button.dart';
import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart'; import 'package:test_sa/new_views/common_widgets/app_text_form_field.dart';
import 'package:test_sa/new_views/pages/login_page.dart'; import 'package:test_sa/new_views/pages/login_page.dart';
import 'package:test_sa/views/widgets/item_views/info_header_widget.dart';
import 'package:test_sa/views/widgets/item_views/info_text_widget.dart';
import '../../controllers/providers/api/user_provider.dart'; import '../../controllers/providers/api/user_provider.dart';
import '../../controllers/validator/validator.dart'; import '../../controllers/validator/validator.dart';
@ -45,9 +47,9 @@ class _ResetPasswordViewState extends State<ResetPasswordView> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
context.translation.resetPassword.heading2(context).custom(color: AppColor.white936, fontWeight: FontWeight.w500), Text(context.translation.resetPassword, style: AppTextStyles.heading2.copyWith(color: AppColor.headingTextColor(context), fontWeight: FontWeight.w500)),
8.height, 8.height,
context.translation.pleaseEnterTheNewPassword.bodyText2(context).custom(color: AppColor.neutral120, fontWeight: FontWeight.w500), InfoTextLabelWidget(label: context.translation.pleaseEnterTheNewPassword),
32.height, 32.height,
AppTextFormField( AppTextFormField(
initialValue: "", initialValue: "",
@ -56,10 +58,11 @@ class _ResetPasswordViewState extends State<ResetPasswordView> {
labelText: context.translation.password, labelText: context.translation.password,
obscureText: !_passwordVisible, obscureText: !_passwordVisible,
suffixIcon: Icon( suffixIcon: Icon(
// Based on passwordVisible state choose the icon // Based on passwordVisible state choose the icon
_passwordVisible ? Icons.visibility : Icons.visibility_off, _passwordVisible ? Icons.visibility : Icons.visibility_off,
color: context.isDark ? AppColor.neutral10 : AppColor.neutral20, color: AppColor.icon2Color(context))
).paddingOnly(end: 12).onPress(() { .paddingOnly(end: 12)
.onPress(() {
setState(() { setState(() {
_passwordVisible = !_passwordVisible; _passwordVisible = !_passwordVisible;
}); });
@ -82,10 +85,7 @@ class _ResetPasswordViewState extends State<ResetPasswordView> {
onSaved: (value) { onSaved: (value) {
confirmPassword = value; confirmPassword = value;
}, },
suffixIcon: Icon( suffixIcon: Icon(_confirmPasswordVisible ? Icons.visibility : Icons.visibility_off, color: AppColor.icon2Color(context)).paddingOnly(end: 12).onPress(() {
_confirmPasswordVisible ? Icons.visibility : Icons.visibility_off,
color: context.isDark ? AppColor.neutral10 : AppColor.neutral20,
).paddingOnly(end: 12).onPress(() {
setState(() { setState(() {
_confirmPasswordVisible = !_confirmPasswordVisible; _confirmPasswordVisible = !_confirmPasswordVisible;
}); });
@ -107,11 +107,11 @@ class _ResetPasswordViewState extends State<ResetPasswordView> {
if (newPassword != confirmPassword) { if (newPassword != confirmPassword) {
Fluttertoast.showToast(msg: 'Password not matched try again'); Fluttertoast.showToast(msg: 'Password not matched try again');
} else { } else {
UserProvider userProvider = Provider.of<UserProvider>(context,listen: false); UserProvider userProvider = Provider.of<UserProvider>(context, listen: false);
UpdatePasswordModel updatePasswordModel = UpdatePasswordModel updatePasswordModel =
UpdatePasswordModel(password: newPassword, confirmPassword: confirmPassword, userId: userProvider.verifyOtpModel.userId, token: userProvider.verifyOtpModel.token); UpdatePasswordModel(password: newPassword, confirmPassword: confirmPassword, userId: userProvider.verifyOtpModel.userId, token: userProvider.verifyOtpModel.token);
GeneralResponseModel generalResponseModel = await userProvider.updateNewPassword(context: context, updatePasswordModel: updatePasswordModel); GeneralResponseModel generalResponseModel = await userProvider.updateNewPassword(context: context, updatePasswordModel: updatePasswordModel);
if (generalResponseModel.isSuccess==true) { if (generalResponseModel.isSuccess == true) {
newPassword = ''; newPassword = '';
confirmPassword = ''; confirmPassword = '';
Navigator.of(context).pushNamedAndRemoveUntil(LoginPage.routeName, (routes) => true); Navigator.of(context).pushNamedAndRemoveUntil(LoginPage.routeName, (routes) => true);

@ -20,6 +20,7 @@ import 'package:test_sa/modules/applicationDemo/screens/demo_request_form_screen
import 'package:test_sa/new_views/app_style/app_color.dart'; import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/new_views/forget_password_module/forget_passwod_verify_otp.dart'; import 'package:test_sa/new_views/forget_password_module/forget_passwod_verify_otp.dart';
import 'package:test_sa/new_views/pages/land_page/land_page.dart'; import 'package:test_sa/new_views/pages/land_page/land_page.dart';
import 'package:test_sa/views/widgets/dialogs/dialog.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../../controllers/providers/api/user_provider.dart'; import '../../controllers/providers/api/user_provider.dart';
@ -160,14 +161,29 @@ class _LoginPageState extends State<LoginPage> {
Align( Align(
alignment: AlignmentDirectional.centerEnd, alignment: AlignmentDirectional.centerEnd,
child: context.translation.forgotPassword.bodyText(context).custom(color: AppColor.primary10, fontWeight: FontWeight.w500).onPress(() async { child: context.translation.forgotPassword.bodyText(context).custom(color: AppColor.primary10, fontWeight: FontWeight.w500).onPress(() async {
String? methodType;
bool result = await showDialog(
context: context,
builder: (_) =>
AAlertDialog(title: "OTP Verification".addTranslation, content: "Please choose the OTP verification method".addTranslation, button1Text: "SMS", button2Text: "Email"),
);
if (result == true) {
methodType = "SMS";
} else {
methodType = "EMAIL";
}
if (methodType == null) {
return;
}
if (userNameController.text.isNotEmpty) { if (userNameController.text.isNotEmpty) {
GeneralResponseModel response = await _userProvider.sendForgetPasswordOtp(context: context, employeeId: userNameController.text); GeneralResponseModel response = await _userProvider.sendForgetPasswordOtp(context: context, employeeId: userNameController.text, typeSend: methodType);
if (response.isSuccess == true) { if (response.isSuccess == true) {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => ForgetPasswordVerifyOtpView( builder: (context) => ForgetPasswordVerifyOtpView(
data: {'employeeId': userNameController.text, 'phoneNumber': response.data}, data: {'employeeId': userNameController.text, 'phoneNumber': response.data, 'typeSend': methodType},
))); )));
// Navigator.push(context, ForgetPasswordVerifyOtpView.routeName); // Navigator.push(context, ForgetPasswordVerifyOtpView.routeName);
} else { } else {

@ -9,8 +9,10 @@ import 'package:test_sa/new_views/app_style/app_color.dart';
class AAlertDialog extends StatelessWidget { class AAlertDialog extends StatelessWidget {
final String? title; final String? title;
final String? content; final String? content;
final String? button1Text;
final String? button2Text;
const AAlertDialog({Key? key, this.title, this.content}) : super(key: key); const AAlertDialog({Key? key, this.title, this.content, this.button1Text, this.button2Text}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -21,14 +23,14 @@ class AAlertDialog extends StatelessWidget {
actions: <Widget>[ actions: <Widget>[
TextButton( TextButton(
// child: Text(_subtitle.confirm), // child: Text(_subtitle.confirm),
child: Text(context.translation.confirm), child: Text(button1Text ?? context.translation.confirm),
onPressed: () { onPressed: () {
Navigator.of(context).pop(true); Navigator.of(context).pop(true);
}, },
), ),
TextButton( TextButton(
// child: Text(_subtitle.cancel), // child: Text(_subtitle.cancel),
child: Text(context.translation.cancel), child: Text(button2Text ?? context.translation.cancel),
onPressed: () { onPressed: () {
Navigator.of(context).pop(false); Navigator.of(context).pop(false);
}, },
@ -43,14 +45,14 @@ class AAlertDialog extends StatelessWidget {
actions: <Widget>[ actions: <Widget>[
TextButton( TextButton(
// child: Text(_subtitle.confirm), // child: Text(_subtitle.confirm),
child: Text(context.translation.confirm, style: AppTextStyles.bodyText.copyWith(color: AppColor.loadingColor(context))), child: Text(button1Text ?? context.translation.confirm, style: AppTextStyles.bodyText.copyWith(color: AppColor.loadingColor(context))),
onPressed: () { onPressed: () {
Navigator.of(context).pop(true); Navigator.of(context).pop(true);
}, },
), ),
TextButton( TextButton(
// child: Text(_subtitle.cancel), // child: Text(_subtitle.cancel),
child: Text(context.translation.cancel, style: AppTextStyles.bodyText.copyWith(color: AppColor.loadingColor(context))), child: Text(button2Text ?? context.translation.cancel, style: AppTextStyles.bodyText.copyWith(color: AppColor.loadingColor(context))),
onPressed: () { onPressed: () {
Navigator.of(context).pop(false); Navigator.of(context).pop(false);
}, },
@ -59,7 +61,3 @@ class AAlertDialog extends StatelessWidget {
); );
} }
} }

Loading…
Cancel
Save