-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat(recipient_app): Updated login registration flow #491
Changes from all commits
09a1a14
efc4890
ff365fb
af8946e
a0373e9
c63a4a1
fe4e1f7
71b594a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ class InputText extends StatelessWidget { | |
final bool isReadOnly; | ||
final Widget? suffixIcon; | ||
final TextInputType? keyboardType; | ||
final int? maxLength; | ||
|
||
const InputText({ | ||
super.key, | ||
|
@@ -25,6 +26,7 @@ class InputText extends StatelessWidget { | |
this.isReadOnly = false, | ||
this.suffixIcon, | ||
this.keyboardType = TextInputType.text, | ||
this.maxLength, | ||
}); | ||
|
||
@override | ||
|
@@ -37,6 +39,10 @@ class InputText extends StatelessWidget { | |
// labelText: hintText, | ||
suffixIcon: suffixIcon, | ||
floatingLabelBehavior: FloatingLabelBehavior.never, | ||
// when maxLength is added TextFormField shows counter e.g. 0/1, | ||
// we don't need it and one of the solutions is to provide SizedBox.shrink() | ||
// see https://stackoverflow.com/a/58819500 | ||
counter: const SizedBox.shrink() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this good for and why is it empty? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the characters limit is added Flutter is adding the counter on the bottom of the text input automatically. Which is not what we want AFAIK. One of the solutions (which also make it not adding extra space to the bottom of input fields is like above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe add this as a comment, otherwise we will stumble over this again :D? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure 👍 |
||
), | ||
style: AppStyles.inputText, | ||
readOnly: isReadOnly, | ||
|
@@ -47,6 +53,7 @@ class InputText extends StatelessWidget { | |
focusNode: focusNode, | ||
validator: validator, | ||
keyboardType: keyboardType, | ||
maxLength: maxLength, | ||
), | ||
if (hintText != null) | ||
Positioned( | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
import "package:app/core/cubits/auth/auth_cubit.dart"; | ||
import "package:app/ui/buttons/buttons.dart"; | ||
import "package:app/ui/configs/configs.dart"; | ||
import "package:flutter/gestures.dart"; | ||
import "package:flutter/material.dart"; | ||
import "package:flutter/services.dart"; | ||
import "package:flutter_bloc/flutter_bloc.dart"; | ||
import "package:url_launcher/url_launcher_string.dart"; | ||
|
||
class TermsAndConditionsPage extends StatelessWidget { | ||
const TermsAndConditionsPage({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
elevation: 0, | ||
title: const Text("Account"), | ||
centerTitle: true, | ||
), | ||
body: Padding( | ||
padding: AppSpacings.a16, | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: <Widget>[ | ||
Expanded( | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
crossAxisAlignment: CrossAxisAlignment.center, | ||
children: [ | ||
RichText( | ||
textAlign: TextAlign.center, | ||
text: TextSpan( | ||
children: [ | ||
TextSpan( | ||
text: "By creating an account, you agree with our ", | ||
style: Theme.of(context) | ||
.textTheme | ||
.headlineLarge! | ||
.copyWith( | ||
color: AppColors.primaryColor, | ||
fontWeight: FontWeight.bold, | ||
)), | ||
TextSpan( | ||
text: "privacy policy.", | ||
style: Theme.of(context) | ||
.textTheme | ||
.headlineLarge! | ||
.copyWith( | ||
color: AppColors.primaryColor, | ||
fontWeight: FontWeight.bold, | ||
decoration: TextDecoration.underline), | ||
recognizer: TapGestureRecognizer() | ||
..onTap = () async { | ||
const url = "https://socialincome.org/privacy"; | ||
if (await canLaunchUrlString(url)) { | ||
await launchUrlString(url); | ||
} else { | ||
Clipboard.setData( | ||
const ClipboardData( | ||
text: "https://socialincome.org/privacy", | ||
), | ||
).then((_) { | ||
ScaffoldMessenger.of(context).showSnackBar( | ||
const SnackBar( | ||
content: Text( | ||
"Can't open privacy policy right now. Copied website address to the clipboard."), | ||
), | ||
); | ||
}); | ||
} | ||
}, | ||
), | ||
], | ||
), | ||
), | ||
const SizedBox( | ||
height: 200, | ||
), | ||
], | ||
), | ||
), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
ButtonBig( | ||
onPressed: () { | ||
final updated = | ||
context.read<AuthCubit>().state.recipient?.copyWith( | ||
termsAccepted: true, | ||
); | ||
|
||
if (updated != null) { | ||
context.read<AuthCubit>().updateRecipient(updated); | ||
} | ||
}, | ||
label: "Create account", | ||
), | ||
], | ||
), | ||
const SizedBox(height: 32), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this to make sure that the same phone can be provided twice even if
auto retrieval timeout
hasn't passed yet.