WIP
This commit is contained in:
parent
2028ab996d
commit
939a6291e6
|
@ -186,40 +186,41 @@ class _AppState extends State<App> {
|
||||||
Future<void> initDeepLinks() async {
|
Future<void> initDeepLinks() async {
|
||||||
_appLinks = AppLinks();
|
_appLinks = AppLinks();
|
||||||
_linkSubscription = _appLinks.uriLinkStream.listen((uri) {
|
_linkSubscription = _appLinks.uriLinkStream.listen((uri) {
|
||||||
final bool isRecovered = !StorageUtil().isRecovered;
|
final bool isRecovered = StorageUtil().isRecovered;
|
||||||
if (isRecovered) openAppLink(uri);
|
if (!isRecovered) openAppLink(uri);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
void openAppLink(Uri uri) {
|
void openAppLink(Uri uri) {
|
||||||
final bool isRecovered = StorageUtil().isRecovered;
|
final bool isRecovered = StorageUtil().isRecovered;
|
||||||
|
log('isRecovered: $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 bool isNotEmpty = email.isNotEmpty && token.isNotEmpty;
|
final bool isNotEmpty = email.isNotEmpty && token.isNotEmpty;
|
||||||
if (isNotEmpty) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (isNotEmpty ) {
|
||||||
final BuildContext context = StorageUtil().context!;
|
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);
|
||||||
builder(context) => screen;
|
builder(context) => screen;
|
||||||
WidgetsBinding.instance.addPersistentFrameCallback((_) {
|
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) =>
|
builder: (context) => SizedBox(height: height, child: builder(context)),
|
||||||
SizedBox(height: height, child: builder(context)),
|
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
showDragHandle: true,
|
showDragHandle: true,
|
||||||
barrierColor: theme.primaryText.withOpacity(0.2),
|
barrierColor: theme.primaryBackground.withOpacity(0.2),
|
||||||
backgroundColor: theme.primaryBackground,
|
backgroundColor: theme.primaryBackground,
|
||||||
useSafeArea: true,
|
useSafeArea: true,
|
||||||
enableDrag: true,
|
enableDrag: true,
|
||||||
isDismissible: true,
|
isDismissible: true,
|
||||||
).then((_) => StorageUtil().isRecovered = false);
|
).then((_) => StorageUtil().isRecovered = false);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void _setupFirebaseMessaging() async {
|
void _setupFirebaseMessaging() async {
|
||||||
|
|
|
@ -136,6 +136,8 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
|
||||||
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: Container(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 20.0), // Adiciona espaçamento inferior
|
padding: const EdgeInsets.only(bottom: 20.0), // Adiciona espaçamento inferior
|
||||||
|
@ -251,17 +253,10 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Widget _buildPasswordField(BuildContext context,
|
Widget _buildPasswordField(BuildContext context, {required TextEditingController? controller, required FocusNode? focusNode, required bool visibility, required VoidCallback onVisibilityToggle, required String hint, required String label,}) {
|
||||||
{
|
|
||||||
required TextEditingController? controller,
|
|
||||||
required FocusNode? focusNode,
|
|
||||||
required bool visibility,
|
|
||||||
required VoidCallback onVisibilityToggle,
|
|
||||||
required String hint,
|
|
||||||
required String label,
|
|
||||||
}){
|
|
||||||
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(
|
||||||
|
@ -331,4 +326,5 @@ class _ForgotPasswordScreenState extends State<ForgotPasswordScreen> with Ticker
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue