Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legal links on registration screen #126

Merged
merged 1 commit into from
Jan 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/presentation/auth/auth_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class _AuthPageState extends State<AuthPage> {
child: Column(
children: [
SizedBox(
height: 470.0,
height: 520.0,
child: PageView(
controller: _pageController,
physics: const NeverScrollableScrollPhysics(),
Expand Down
61 changes: 61 additions & 0 deletions lib/presentation/auth/widgets/legal_notice.dart
Original file line number Diff line number Diff line change
@@ -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: ".",
),
],
),
);
}
}
3 changes: 3 additions & 0 deletions lib/presentation/auth/widgets/verify_phone.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -69,6 +70,8 @@ class VerifyPhonePageState extends State<VerifyPhonePage> {
),
],
),
const SizedBox(height: 20),
const LegalNotice(),
],
);
},
Expand Down