From 81119b45532aab61ea5065a57f123bac4c7f39e7 Mon Sep 17 00:00:00 2001 From: Ruben Horn <5367484+rubenhorn@users.noreply.github.com> Date: Tue, 4 Jan 2022 05:23:27 +0100 Subject: [PATCH] resolves #124 (#126) --- lib/presentation/auth/auth_screen.dart | 2 +- .../auth/widgets/legal_notice.dart | 61 +++++++++++++++++++ .../auth/widgets/verify_phone.dart | 3 + 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 lib/presentation/auth/widgets/legal_notice.dart diff --git a/lib/presentation/auth/auth_screen.dart b/lib/presentation/auth/auth_screen.dart index 560f2cf0..7766a956 100644 --- a/lib/presentation/auth/auth_screen.dart +++ b/lib/presentation/auth/auth_screen.dart @@ -81,7 +81,7 @@ class _AuthPageState extends State { child: Column( children: [ SizedBox( - height: 470.0, + height: 520.0, child: PageView( controller: _pageController, physics: const NeverScrollableScrollPhysics(), diff --git a/lib/presentation/auth/widgets/legal_notice.dart b/lib/presentation/auth/widgets/legal_notice.dart new file mode 100644 index 00000000..fdec656d --- /dev/null +++ b/lib/presentation/auth/widgets/legal_notice.dart @@ -0,0 +1,61 @@ +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class LegalNotice extends StatelessWidget { + const LegalNotice({ + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + const textStyle = TextStyle(color: Color(0xFF666666)); + return RichText( + textAlign: TextAlign.center, + text: TextSpan( + children: [ + const TextSpan( + text: "By clicking the next button, you agree to CollAction’s ", + style: textStyle, + ), + TextSpan( + style: textStyle.copyWith(decoration: TextDecoration.underline), + text: "terms & conditions", + recognizer: TapGestureRecognizer() + ..onTap = () async { + const url = "https://www.collaction.org/terms"; + if (await canLaunch(url)) { + await launch( + url, + forceSafariVC: false, + ); + } + }, + ), + const TextSpan( + style: textStyle, + text: " and to our ", + ), + TextSpan( + style: textStyle.copyWith(decoration: TextDecoration.underline), + text: "privacy policy", + recognizer: TapGestureRecognizer() + ..onTap = () async { + const url = "https://www.collaction.org/privacy"; + if (await canLaunch(url)) { + await launch( + url, + forceSafariVC: false, + ); + } + }, + ), + const TextSpan( + style: textStyle, + text: ".", + ), + ], + ), + ); + } +} diff --git a/lib/presentation/auth/widgets/verify_phone.dart b/lib/presentation/auth/widgets/verify_phone.dart index 4affcf61..67763366 100644 --- a/lib/presentation/auth/widgets/verify_phone.dart +++ b/lib/presentation/auth/widgets/verify_phone.dart @@ -4,6 +4,7 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import '../../../application/auth/auth_bloc.dart'; import '../../shared_widgets/phone_input.dart'; import '../../shared_widgets/rectangular_button.dart'; +import 'legal_notice.dart'; class VerifyPhonePage extends StatefulWidget { const VerifyPhonePage({Key? key}) : super(key: key); @@ -69,6 +70,8 @@ class VerifyPhonePageState extends State { ), ], ), + const SizedBox(height: 20), + const LegalNotice(), ], ); },