Refactor: Change profile tab cancel actions to reset form state instead of navigating, and adjust agent availability UI.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:real_estate_mobile/core/constants/app_colors.dart';
|
||||
import 'package:real_estate_mobile/features/profile/presentation/providers/profile_provider.dart';
|
||||
import 'package:real_estate_mobile/features/profile/presentation/widgets/profile_shared_widgets.dart';
|
||||
@@ -90,7 +89,16 @@ class _ChangePasswordTabState extends ConsumerState<ChangePasswordTab> {
|
||||
const SizedBox(height: 40),
|
||||
ProfileActionButtons(
|
||||
onSave: _changePassword,
|
||||
onCancel: () => context.go('/home'),
|
||||
onCancel: () {
|
||||
_currentPasswordController.clear();
|
||||
_newPasswordController.clear();
|
||||
_confirmPasswordController.clear();
|
||||
setState(() {
|
||||
_showCurrentPassword = false;
|
||||
_showNewPassword = false;
|
||||
_showConfirmPassword = false;
|
||||
});
|
||||
},
|
||||
isSaving: _isChangingPassword,
|
||||
saveLabel: 'Update Password',
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user