changePasswordView property
String
get
changePasswordView
Implementation
static String get changePasswordView =>
'''import 'package:flutter/material.dart';
import 'package:mega_commons/mega_commons.dart';
import 'package:mega_commons_dependencies/mega_commons_dependencies.dart';
import 'package:mega_features/mega_features.dart';
class ChangePasswordView extends GetView<ChangePasswordController> {
const ChangePasswordView({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Alterar Senha'),
),
body: Container(
padding: const EdgeInsets.all(12),
child: Center(
child: SingleChildScrollView(
child: Form(
key: controller.formKey,
child: Column(
children: [
MegaTextFieldWidget(
controller.currentPassword,
labelText: 'Senha',
isRequired: true,
keyboardType: TextInputType.visiblePassword,
suffixIcon: const Icon(FontAwesomeIcons.eye),
),
MegaTextFieldWidget(
controller.newPassword,
labelText: 'Nova Senha',
isRequired: true,
keyboardType: TextInputType.visiblePassword,
suffixIcon: const Icon(FontAwesomeIcons.eye),
),
MegaTextFieldWidget(
controller.confirmPassword,
labelText: 'Confirmar Senha',
isRequired: true,
keyboardType: TextInputType.visiblePassword,
suffixIcon: const Icon(FontAwesomeIcons.eye),
validator: Validatorless.multiple([
Validatorless.required('Confirmar Senha obrigatória'),
Validatorless.min(
6,
'Confirmar Senha precisa ter pelo menos 6 caracteres',
),
Validators.compare(
controller.newPassword,
'Senha diferente de Nova Senha',
),
]),
),
const SizedBox(height: 16),
Obx(
() => MegaBaseButton(
'Alterar',
onButtonPress: () async {
await controller.onSubmit();
},
isLoading: controller.isLoading,
),
),
],
),
),
),
),
),
);
}
}
''';