WIP
This commit is contained in:
parent
66bc8e9f3e
commit
2028ab996d
|
@ -192,33 +192,35 @@ class _AppState extends State<App> {
|
||||||
}
|
}
|
||||||
void openAppLink(Uri uri) {
|
void openAppLink(Uri uri) {
|
||||||
final bool isRecovered = StorageUtil().isRecovered;
|
final bool isRecovered = StorageUtil().isRecovered;
|
||||||
if(isRecovered) return;
|
if (isRecovered) return;
|
||||||
StorageUtil().isRecovered = true;
|
StorageUtil().isRecovered = true;
|
||||||
|
|
||||||
final String email = uri.queryParameters['email'] ?? '';
|
final String email = uri.queryParameters['email'] ?? '';
|
||||||
final String token = uri.queryParameters['token'] ?? '';
|
final String token = uri.queryParameters['token'] ?? '';
|
||||||
final BuildContext context = StorageUtil().context!;
|
|
||||||
final bool isNotEmpty = email.isNotEmpty && token.isNotEmpty;
|
final bool isNotEmpty = email.isNotEmpty && token.isNotEmpty;
|
||||||
|
if (isNotEmpty) {
|
||||||
|
final BuildContext context = StorageUtil().context!;
|
||||||
final MediaQueryData mediaQuery = MediaQuery.of(context);
|
final MediaQueryData mediaQuery = MediaQuery.of(context);
|
||||||
final double height = mediaQuery.size.height * 0.8;
|
final double height = mediaQuery.size.height * 0.8;
|
||||||
final FlutterFlowTheme theme = FlutterFlowTheme.of(context);
|
final FlutterFlowTheme theme = FlutterFlowTheme.of(context);
|
||||||
final Widget screen = ForgotPasswordScreen(email: email, token: token);
|
final Widget screen = ForgotPasswordScreen(email: email, token: token);
|
||||||
final Widget Function(BuildContext) builder = (context) => screen;
|
builder(context) => screen;
|
||||||
if (isNotEmpty) {
|
WidgetsBinding.instance.addPersistentFrameCallback((_) {
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => SizedBox(height: height, child: builder(context)),
|
builder: (context) =>
|
||||||
|
SizedBox(height: height, child: builder(context)),
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
showDragHandle: true,
|
showDragHandle: true,
|
||||||
barrierColor: theme.primaryText.withOpacity(0.2),
|
barrierColor: theme.primaryText.withOpacity(0.2),
|
||||||
backgroundColor: theme.primaryBackground,
|
backgroundColor: theme.primaryBackground,
|
||||||
|
useSafeArea: true,
|
||||||
|
enableDrag: true,
|
||||||
|
isDismissible: true,
|
||||||
).then((_) => StorageUtil().isRecovered = false);
|
).then((_) => StorageUtil().isRecovered = false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// Use the extracted email and token as needed
|
|
||||||
// navigatorKey.currentState?.pushNamed('/forgotPassword', arguments: {'email': email, 'token': token});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
void _setupFirebaseMessaging() async {
|
void _setupFirebaseMessaging() async {
|
||||||
FirebaseMessaging messaging = FirebaseMessaging.instance;
|
FirebaseMessaging messaging = FirebaseMessaging.instance;
|
||||||
|
|
|
@ -130,29 +130,17 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
|
||||||
elevation: 0.0,
|
elevation: 0.0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
SafeArea buildBody(BuildContext context) {
|
SafeArea buildBody(BuildContext context) {
|
||||||
late final String message = FFLocalizations.of(context).getVariableText(
|
late final String message = FFLocalizations.of(context).getVariableText(
|
||||||
ptText: 'Qual será a sua nova senha? Insira abaixo e confirme.',
|
ptText: 'Qual será a sua nova senha? Insira abaixo e confirme.',
|
||||||
enText: 'What will be your new password? Enter it below and confirm.',
|
enText: 'What will be your new password? Enter it below and confirm.',
|
||||||
);
|
);
|
||||||
return SafeArea(
|
return SafeArea(
|
||||||
child: Row(
|
|
||||||
mainAxisSize: MainAxisSize.max,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: 6,
|
|
||||||
child: Container(
|
|
||||||
width: 100.0,
|
|
||||||
height: double.infinity,
|
|
||||||
decoration: BoxDecoration(color: FlutterFlowTheme.of(context).primaryBackground),
|
|
||||||
alignment: const AlignmentDirectional(0.0, -1.0),
|
|
||||||
child: Align(
|
|
||||||
alignment: const AlignmentDirectional(0.0, 0.0),
|
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 20.0), // Adiciona espaçamento inferior
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
width: 291.0,
|
width: 291.0,
|
||||||
|
@ -207,6 +195,8 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
|
||||||
focusNode: _model.passwordRegisterFormFocusNode,
|
focusNode: _model.passwordRegisterFormFocusNode,
|
||||||
visibility: _model.passwordRegisterFormVisibility,
|
visibility: _model.passwordRegisterFormVisibility,
|
||||||
onVisibilityToggle: () => setState(() => _model.passwordRegisterFormVisibility = !_model.passwordRegisterFormVisibility),
|
onVisibilityToggle: () => setState(() => _model.passwordRegisterFormVisibility = !_model.passwordRegisterFormVisibility),
|
||||||
|
label: FFLocalizations.of(context).getVariableText(ptText: 'Nova Senha', enText: 'New Password'),
|
||||||
|
hint: FFLocalizations.of(context).getVariableText(ptText: 'Insira sua senha', enText: 'Enter your password'),
|
||||||
),
|
),
|
||||||
_buildPasswordField(
|
_buildPasswordField(
|
||||||
context,
|
context,
|
||||||
|
@ -214,6 +204,8 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
|
||||||
focusNode: _model.passwordConfirmFormFocusNode,
|
focusNode: _model.passwordConfirmFormFocusNode,
|
||||||
visibility: _model.passwordConfirmFormVisibility,
|
visibility: _model.passwordConfirmFormVisibility,
|
||||||
onVisibilityToggle: () => setState(() => _model.passwordConfirmFormVisibility = !_model.passwordConfirmFormVisibility),
|
onVisibilityToggle: () => setState(() => _model.passwordConfirmFormVisibility = !_model.passwordConfirmFormVisibility),
|
||||||
|
label: FFLocalizations.of(context).getVariableText(ptText: 'Confirme a Senha', enText: 'Confirm Password'),
|
||||||
|
hint: FFLocalizations.of(context).getVariableText(ptText: 'Confirme sua senha', enText: 'Confirm your password'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
@ -259,29 +251,17 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Widget _buildPasswordField(BuildContext context,
|
||||||
|
{
|
||||||
Widget _buildPasswordField(
|
|
||||||
BuildContext context, {
|
|
||||||
required TextEditingController? controller,
|
required TextEditingController? controller,
|
||||||
required FocusNode? focusNode,
|
required FocusNode? focusNode,
|
||||||
required bool visibility,
|
required bool visibility,
|
||||||
required VoidCallback onVisibilityToggle}){
|
required VoidCallback onVisibilityToggle,
|
||||||
final label = FFLocalizations.of(context).getVariableText(
|
required String hint,
|
||||||
ptText: 'Senha',
|
required String label,
|
||||||
enText: 'Password',
|
}){
|
||||||
);
|
|
||||||
final hint = FFLocalizations.of(context).getVariableText(
|
|
||||||
ptText: 'Insira sua senha',
|
|
||||||
enText: 'Enter your password',
|
|
||||||
);
|
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 0.0, 16.0),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
|
|
Loading…
Reference in New Issue